From f62b00eaac03eea6eee23e5459c40cef272753a6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 12 Apr 2013 16:41:15 +0800 Subject: [PATCH] Fix devtools. --- browser/native_window.cc | 2 +- browser/native_window_mac.mm | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/native_window.cc b/browser/native_window.cc index b8651b4cb2f2..d911e827634c 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -83,7 +83,7 @@ void NativeWindow::ShowDevTools() { } void NativeWindow::CloseDevTools() { - // inspectable_web_contents()->CloseDevTools(); + inspectable_web_contents()->GetView()->CloseDevTools(); } content::WebContents* NativeWindow::GetWebContents() const { diff --git a/browser/native_window_mac.mm b/browser/native_window_mac.mm index 3ae8811a6702..ddf43e93f88c 100644 --- a/browser/native_window_mac.mm +++ b/browser/native_window_mac.mm @@ -12,6 +12,8 @@ #include "base/sys_string_conversions.h" #include "base/values.h" #include "browser/atom_event_processing_window.h" +#include "brightray/browser/inspectable_web_contents.h" +#include "brightray/browser/inspectable_web_contents_view.h" #include "common/options_switches.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" @@ -75,9 +77,6 @@ NativeWindowMac::NativeWindowMac(content::BrowserContext* browser_context, [window() setCollectionBehavior:collectionBehavior]; } - NSView* view = GetWebContents()->GetView()->GetNativeView(); - [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - InstallView(); } @@ -295,7 +294,8 @@ bool NativeWindowMac::IsKiosk() { } void NativeWindowMac::InstallView() { - NSView* view = GetWebContents()->GetView()->GetNativeView(); + NSView* view = inspectable_web_contents()->GetView()->GetNativeView(); + [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [view setFrame:[[window() contentView] bounds]]; [[window() contentView] addSubview:view]; }