Show();
}
+void NativeWindow::ShowDevTools() {
+ inspectable_web_contents()->ShowDevTools();
+}
+
+void NativeWindow::CloseDevTools() {
+ // inspectable_web_contents()->CloseDevTools();
+}
+
content::WebContents* NativeWindow::GetWebContents() const {
return inspectable_web_contents_->GetWebContents();
}
virtual void FlashFrame(bool flash) = 0;
virtual void SetKiosk(bool kiosk) = 0;
virtual bool IsKiosk() = 0;
+ virtual void ShowDevTools();
+ virtual void CloseDevTools();
content::WebContents* GetWebContents() const;
explicit NativeWindow(content::BrowserContext* browser_context,
base::DictionaryValue* options);
+ brightray::InspectableWebContents* inspectable_web_contents() const {
+ return inspectable_web_contents_.get();
+ }
+
private:
scoped_ptr<brightray::InspectableWebContents> inspectable_web_contents_;
#include "base/mac/mac_util.h"
#include "base/sys_string_conversions.h"
#include "base/values.h"
+#include "browser/atom_event_processing_window.h"
#include "common/options_switches.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
+@interface AtomNSWindow : AtomEventProcessingWindow {
+ @private
+ atom::NativeWindowMac* shell_;
+}
+- (void)setShell:(atom::NativeWindowMac*)shell;
+- (IBAction)showDevTools:(id)sender;
+@end
+
+@implementation AtomNSWindow
+
+- (void)setShell:(atom::NativeWindowMac*)shell {
+ shell_ = shell;
+}
+
+- (IBAction)showDevTools:(id)sender {
+ shell_->ShowDevTools();
+}
+
+@end
+
namespace atom {
NativeWindowMac::NativeWindowMac(content::BrowserContext* browser_context,
NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask |
NSTexturedBackgroundWindowMask;
- window_ = [[NSWindow alloc] initWithContentRect:cocoa_bounds
- styleMask:style_mask
- backing:NSBackingStoreBuffered
- defer:YES];
+ AtomNSWindow* atom_window = [[AtomNSWindow alloc]
+ initWithContentRect:cocoa_bounds
+ styleMask:style_mask
+ backing:NSBackingStoreBuffered
+ defer:YES];
+ [atom_window setShell:this];
+
+ window_ = atom_window;
// Disable fullscreen button when 'fullscreen' is specified to false.
bool fullscreen;