diff --git a/brightray/browser/inspectable_web_contents_delegate.h b/brightray/browser/inspectable_web_contents_delegate.h index 082343f2f640..d32b139ba941 100644 --- a/brightray/browser/inspectable_web_contents_delegate.h +++ b/brightray/browser/inspectable_web_contents_delegate.h @@ -19,6 +19,7 @@ class InspectableWebContentsDelegate { const std::string& url, const std::string& content, bool save_as) {} virtual void DevToolsAppendToFile( const std::string& url, const std::string& content) {} + virtual void DevToolsFocused() {} #if defined(USE_X11) // Called when creating devtools window. diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 88ed18dc1f93..9def5ad86301 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -241,6 +241,12 @@ void InspectableWebContentsImpl::AppendToFile( delegate_->DevToolsAppendToFile(url, content); } +void InspectableWebContentsImpl::WebContentsFocused( + content::WebContents* contents) { + if (delegate_) + delegate_->DevToolsFocused(); +} + void InspectableWebContentsImpl::RequestFileSystems() { devtools_web_contents()->GetMainFrame()->ExecuteJavaScript( base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([])")); diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 7e249e8aa650..a7e248d575d0 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -127,6 +127,7 @@ class InspectableWebContentsImpl : void HandleKeyboardEvent( content::WebContents*, const content::NativeWebKeyboardEvent&) override; void CloseContents(content::WebContents* source) override; + void WebContentsFocused(content::WebContents* contents) override; scoped_ptr web_contents_; scoped_ptr devtools_web_contents_;