Mac: Add DevTools tests and resources to cefclient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@290 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-09-20 15:07:27 +00:00
parent d27343bac5
commit 792e78795f
2 changed files with 24 additions and 1 deletions

View File

@ -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/',
],
},
{

View File

@ -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<CefBrowser> browser = g_handler->GetBrowser();
browser->ShowDevTools();
}
}
- (IBAction)testDevToolsClose:(id)sender {
if(g_handler.get() && g_handler->GetBrowserHwnd()) {
CefRefPtr<CefBrowser> browser = g_handler->GetBrowser();
browser->CloseDevTools();
}
}
// Sent by the default notification center immediately before the application
// terminates.
- (void)applicationWillTerminate:(NSNotification *)aNotification {