From 792e78795fca919b117f8760bf155af8da45eeeb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 20 Sep 2011 15:07:27 +0000 Subject: [PATCH] Mac: Add DevTools tests and resources to cefclient. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@290 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef.gyp | 3 ++- tests/cefclient/cefclient_mac.mm | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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 {