Merge pull request #75 from brightray/devtools-toolbar

Make devtools toolbar more eye candy
This commit is contained in:
Cheng Zhao 2014-09-09 19:32:48 +09:00
commit 469f55ef5a
2 changed files with 29 additions and 1 deletions

View file

@ -36,7 +36,9 @@ const double kPresetZoomFactors[] = { 0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1.0,
const char kDevToolsScheme[] = "chrome-devtools";
const char kDevToolsHost[] = "devtools";
const char kChromeUIDevToolsURL[] = "chrome-devtools://devtools/devtools.html?"
"can_dock=true&&"
"can_dock=true&"
"toolbarColor=rgba(223,223,223,1)&"
"textColor=rgba(0,0,0,1)&"
"experiments=true";
const char kDevToolsBoundsPref[] = "brightray.devtools.bounds";

View file

@ -148,4 +148,30 @@ using namespace brightray;
inspectableWebContentsView_->inspectable_web_contents()->CloseDevTools();
}
- (void)windowDidBecomeMain:(NSNotification*)notification {
content::WebContents* web_contents =
inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
if (!web_contents)
return;
web_contents->RestoreFocus();
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetActive(true);
}
- (void)windowDidResignMain:(NSNotification*)notification {
content::WebContents* web_contents =
inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
if (!web_contents)
return;
web_contents->StoreFocus();
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetActive(false);
}
@end