diff --git a/atom/browser/native_window_win.cc b/atom/browser/native_window_win.cc index 8682dc0aa98..f78a3fec725 100644 --- a/atom/browser/native_window_win.cc +++ b/atom/browser/native_window_win.cc @@ -21,7 +21,6 @@ #include "content/public/browser/web_contents_view.h" #include "ui/gfx/path.h" #include "ui/base/models/simple_menu_model.h" -#include "ui/views/controls/webview/webview.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/native_widget_win.h" #include "ui/views/window/client_view.h" @@ -218,7 +217,7 @@ NativeWindowWin::NativeWindowWin(content::WebContents* web_contents, base::DictionaryValue* options) : NativeWindow(web_contents, options), window_(new views::Widget), - web_view_(new views::WebView(NULL)), + web_view_(inspectable_web_contents_view()->GetView()), use_content_size_(false), resizable_(true) { options->GetBoolean(switches::kResizable, &resizable_); @@ -245,7 +244,6 @@ NativeWindowWin::NativeWindowWin(content::WebContents* web_contents, window_->CenterWindow(size); window_->UpdateWindowIcon(); - web_view_->SetWebContents(web_contents); OnViewWasResized(); } @@ -494,7 +492,7 @@ void NativeWindowWin::DeleteDelegate() { } views::View* NativeWindowWin::GetInitiallyFocusedView() { - return web_view_; + return inspectable_web_contents_view()->GetWebView(); } bool NativeWindowWin::CanResize() const { diff --git a/atom/browser/native_window_win.h b/atom/browser/native_window_win.h index 8d25fcba8c8..9d34098a72c 100644 --- a/atom/browser/native_window_win.h +++ b/atom/browser/native_window_win.h @@ -16,13 +16,13 @@ #include "ui/gfx/size.h" #include "ui/views/focus/widget_focus_manager.h" #include "ui/views/widget/widget_delegate.h" +#include "vendor/brightray/browser/win/inspectable_web_contents_view_win.h" namespace ui { class MenuModel; } namespace views { -class WebView; class Widget; } @@ -80,6 +80,12 @@ class NativeWindowWin : public NativeWindow, // Set the native window menu. void SetMenu(ui::MenuModel* menu_model); + brightray::InspectableWebContentsViewWin* inspectable_web_contents_view() + const { + return static_cast( + inspectable_web_contents()->GetView()); + } + views::Widget* window() const { return window_.get(); } atom::Menu2* menu() const { return menu_.get(); } SkRegion* draggable_region() { return draggable_region_.get(); } @@ -130,7 +136,7 @@ class NativeWindowWin : public NativeWindow, void RegisterAccelerators(); scoped_ptr window_; - views::WebView* web_view_; // managed by window_. + views::View* web_view_; // managed by window_. // The window menu. scoped_ptr menu_; diff --git a/vendor/brightray b/vendor/brightray index ab818b4aa2d..e6db5b381b2 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit ab818b4aa2d77441203bd30c0e789e5e69529728 +Subproject commit e6db5b381b2d5f721ab3de3fa9b811e112a18b12