detecting focus on devtools webcontents
This commit is contained in:
parent
17f1fc618e
commit
4ae52721c4
3 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,7 @@ class InspectableWebContentsDelegate {
|
||||||
const std::string& url, const std::string& content, bool save_as) {}
|
const std::string& url, const std::string& content, bool save_as) {}
|
||||||
virtual void DevToolsAppendToFile(
|
virtual void DevToolsAppendToFile(
|
||||||
const std::string& url, const std::string& content) {}
|
const std::string& url, const std::string& content) {}
|
||||||
|
virtual void DevToolsFocused() {}
|
||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
// Called when creating devtools window.
|
// Called when creating devtools window.
|
||||||
|
|
|
@ -241,6 +241,12 @@ void InspectableWebContentsImpl::AppendToFile(
|
||||||
delegate_->DevToolsAppendToFile(url, content);
|
delegate_->DevToolsAppendToFile(url, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InspectableWebContentsImpl::WebContentsFocused(
|
||||||
|
content::WebContents* contents) {
|
||||||
|
if (delegate_)
|
||||||
|
delegate_->DevToolsFocused();
|
||||||
|
}
|
||||||
|
|
||||||
void InspectableWebContentsImpl::RequestFileSystems() {
|
void InspectableWebContentsImpl::RequestFileSystems() {
|
||||||
devtools_web_contents()->GetMainFrame()->ExecuteJavaScript(
|
devtools_web_contents()->GetMainFrame()->ExecuteJavaScript(
|
||||||
base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([])"));
|
base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([])"));
|
||||||
|
|
|
@ -127,6 +127,7 @@ class InspectableWebContentsImpl :
|
||||||
void HandleKeyboardEvent(
|
void HandleKeyboardEvent(
|
||||||
content::WebContents*, const content::NativeWebKeyboardEvent&) override;
|
content::WebContents*, const content::NativeWebKeyboardEvent&) override;
|
||||||
void CloseContents(content::WebContents* source) override;
|
void CloseContents(content::WebContents* source) override;
|
||||||
|
void WebContentsFocused(content::WebContents* contents) override;
|
||||||
|
|
||||||
scoped_ptr<content::WebContents> web_contents_;
|
scoped_ptr<content::WebContents> web_contents_;
|
||||||
scoped_ptr<content::WebContents> devtools_web_contents_;
|
scoped_ptr<content::WebContents> devtools_web_contents_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue