зеркало из https://github.com/electron/electron.git
notify devtools opened and closed once per lifetime
This commit is contained in:
Родитель
7e0918f95a
Коммит
a01f8ba739
|
@ -368,6 +368,9 @@ void InspectableWebContentsImpl::LoadCompleted() {
|
|||
// If the devtools can dock, "SetIsDocked" will be called by devtools itself.
|
||||
if (!can_dock_)
|
||||
SetIsDocked(DispatchCallback(), false);
|
||||
|
||||
if (view_->GetDelegate())
|
||||
view_->GetDelegate()->DevToolsOpened();
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) {
|
||||
|
@ -618,6 +621,9 @@ void InspectableWebContentsImpl::WebContentsDestroyed() {
|
|||
|
||||
for (const auto& pair : pending_requests_)
|
||||
delete pair.first;
|
||||
|
||||
if (view_ && view_->GetDelegate())
|
||||
view_->GetDelegate()->DevToolsClosed();
|
||||
}
|
||||
|
||||
bool InspectableWebContentsImpl::AddMessageToConsole(
|
||||
|
|
|
@ -29,14 +29,10 @@ gfx::NativeView InspectableWebContentsViewMac::GetNativeView() const {
|
|||
|
||||
void InspectableWebContentsViewMac::ShowDevTools() {
|
||||
[view_ setDevToolsVisible:YES];
|
||||
if (GetDelegate())
|
||||
GetDelegate()->DevToolsOpened();
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewMac::CloseDevTools() {
|
||||
[view_ setDevToolsVisible:NO];
|
||||
if (GetDelegate())
|
||||
GetDelegate()->DevToolsClosed();
|
||||
}
|
||||
|
||||
bool InspectableWebContentsViewMac::IsDevToolsViewShowing() {
|
||||
|
|
|
@ -118,8 +118,6 @@ void InspectableWebContentsViewViews::ShowDevTools() {
|
|||
devtools_web_view_->RequestFocus();
|
||||
Layout();
|
||||
}
|
||||
if (GetDelegate())
|
||||
GetDelegate()->DevToolsOpened();
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewViews::CloseDevTools() {
|
||||
|
@ -137,8 +135,6 @@ void InspectableWebContentsViewViews::CloseDevTools() {
|
|||
devtools_web_view_->SetWebContents(NULL);
|
||||
Layout();
|
||||
}
|
||||
if (GetDelegate())
|
||||
GetDelegate()->DevToolsClosed();
|
||||
}
|
||||
|
||||
bool InspectableWebContentsViewViews::IsDevToolsViewShowing() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче