Make devtools API aware of devtools window.

This commit is contained in:
Cheng Zhao 2014-03-04 18:45:36 +08:00
parent 6bd0b82b2e
commit 01b42c9e59

View file

@ -188,11 +188,15 @@ void NativeWindow::OpenDevTools() {
} }
void NativeWindow::CloseDevTools() { void NativeWindow::CloseDevTools() {
inspectable_web_contents()->GetView()->CloseDevTools(); if (devtools_window_)
devtools_window_->Close();
else
inspectable_web_contents()->GetView()->CloseDevTools();
} }
bool NativeWindow::IsDevToolsOpened() { bool NativeWindow::IsDevToolsOpened() {
return inspectable_web_contents()->IsDevToolsViewShowing(); return (devtools_window_ && devtools_window_->IsFocused()) ||
inspectable_web_contents()->IsDevToolsViewShowing();
} }
void NativeWindow::InspectElement(int x, int y) { void NativeWindow::InspectElement(int x, int y) {