Add DevToolsOpened and DevToolsClosed events
This commit is contained in:
parent
d1e70e7826
commit
51bb357405
2 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,8 @@ class InspectableWebContentsDelegate {
|
||||||
virtual void DevToolsAddFileSystem() {}
|
virtual void DevToolsAddFileSystem() {}
|
||||||
virtual void DevToolsRemoveFileSystem(
|
virtual void DevToolsRemoveFileSystem(
|
||||||
const std::string& file_system_path) {}
|
const std::string& file_system_path) {}
|
||||||
|
virtual void DevToolsOpened() {}
|
||||||
|
virtual void DevToolsClosed() {}
|
||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
// Called when creating devtools window.
|
// Called when creating devtools window.
|
||||||
|
|
|
@ -301,6 +301,9 @@ void InspectableWebContentsImpl::LoadCompleted() {
|
||||||
// If the devtools can dock, "SetIsDocked" will be called by devtools itself.
|
// If the devtools can dock, "SetIsDocked" will be called by devtools itself.
|
||||||
if (!can_dock_)
|
if (!can_dock_)
|
||||||
SetIsDocked(DispatchCallback(), false);
|
SetIsDocked(DispatchCallback(), false);
|
||||||
|
|
||||||
|
if (delegate_)
|
||||||
|
delegate_->DevToolsOpened();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) {
|
void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) {
|
||||||
|
@ -506,6 +509,9 @@ void InspectableWebContentsImpl::WebContentsDestroyed() {
|
||||||
|
|
||||||
for (const auto& pair : pending_requests_)
|
for (const auto& pair : pending_requests_)
|
||||||
delete pair.first;
|
delete pair.first;
|
||||||
|
|
||||||
|
if (delegate_)
|
||||||
|
delegate_->DevToolsClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InspectableWebContentsImpl::AddMessageToConsole(
|
bool InspectableWebContentsImpl::AddMessageToConsole(
|
||||||
|
|
Loading…
Reference in a new issue