mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
Merge pull request #96 from deepak1556/web_contents_patch
detecting focus on devtools webcontents
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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([])"));
|
||||
|
||||
@@ -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<content::WebContents> web_contents_;
|
||||
scoped_ptr<content::WebContents> devtools_web_contents_;
|
||||
|
||||
Reference in New Issue
Block a user