diff --git a/cef.gyp b/cef.gyp index b540c7b91..fdbe64ea6 100644 --- a/cef.gyp +++ b/cef.gyp @@ -143,11 +143,12 @@ ], 'copies': [ { - # Add library dependencies and app launcher script to the bundle. + # Add library dependencies and inspector resources to the bundle. 'destination': '<(PRODUCT_DIR)/cefclient.app/Contents/MacOS/', 'files': [ '<(PRODUCT_DIR)/libcef.dylib', '<(PRODUCT_DIR)/ffmpegsumo.so', + '<(PRODUCT_DIR)/resources/', ], }, { diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index 7f40cb7c0..88b6b44af 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -204,6 +204,8 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) { - (IBAction)testZoomIn:(id)sender; - (IBAction)testZoomOut:(id)sender; - (IBAction)testZoomReset:(id)sender; +- (IBAction)testDevToolsShow:(id)sender; +- (IBAction)testDevToolsClose:(id)sender; @end @implementation ClientAppDelegate @@ -282,6 +284,12 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) { [testMenu addItemWithTitle:@"Zoom Reset" action:@selector(testZoomReset:) keyEquivalent:@""]; + [testMenu addItemWithTitle:@"Show DevTools" + action:@selector(testDevToolsShow:) + keyEquivalent:@""]; + [testMenu addItemWithTitle:@"Close DevTools" + action:@selector(testDevToolsClose:) + keyEquivalent:@""]; [testItem setSubmenu:testMenu]; [menubar addItem:testItem]; @@ -475,6 +483,20 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) { } } +- (IBAction)testDevToolsShow:(id)sender { + if(g_handler.get() && g_handler->GetBrowserHwnd()) { + CefRefPtr browser = g_handler->GetBrowser(); + browser->ShowDevTools(); + } +} + +- (IBAction)testDevToolsClose:(id)sender { + if(g_handler.get() && g_handler->GetBrowserHwnd()) { + CefRefPtr browser = g_handler->GetBrowser(); + browser->CloseDevTools(); + } +} + // Sent by the default notification center immediately before the application // terminates. - (void)applicationWillTerminate:(NSNotification *)aNotification {