]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix devtools.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 12 Apr 2013 08:41:15 +0000 (16:41 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 12 Apr 2013 08:41:15 +0000 (16:41 +0800)
browser/native_window.cc
browser/native_window_mac.mm

index b8651b4cb2f2e6db85dd4011b73709fe9d66298b..d911e827634c4efd1e9c794599be38bb88155af1 100644 (file)
@@ -83,7 +83,7 @@ void NativeWindow::ShowDevTools() {
 }
 
 void NativeWindow::CloseDevTools() {
-  // inspectable_web_contents()->CloseDevTools();
+  inspectable_web_contents()->GetView()->CloseDevTools();
 }
 
 content::WebContents* NativeWindow::GetWebContents() const {
index 3ae8811a6702707d2eedf14f259b2422f261234b..ddf43e93f88c63275f6ce27a52e5293dbf19b914 100644 (file)
@@ -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];
 }