Make the devtools close button work
This commit is contained in:
parent
d20ecc0e2b
commit
001d0197de
4 changed files with 10 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "content/public/browser/devtools_client_host.h"
|
||||
#include "content/public/browser/devtools_http_handler.h"
|
||||
#include "content/public/browser/devtools_manager.h"
|
||||
#include "content/public/browser/web_contents_view.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
|
@ -60,6 +61,9 @@ void InspectableWebContentsImpl::ChangeAttachedWindowHeight(unsigned height) {
|
|||
}
|
||||
|
||||
void InspectableWebContentsImpl::CloseWindow() {
|
||||
view_->CloseDevTools();
|
||||
devtools_web_contents_.reset();
|
||||
web_contents_->GetView()->Focus();
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::MoveWindow(int x, int y) {
|
||||
|
@ -99,7 +103,6 @@ void InspectableWebContentsImpl::WebContentsDestroyed(content::WebContents*) {
|
|||
Observe(nullptr);
|
||||
agent_host_ = nullptr;
|
||||
frontend_host_.reset();
|
||||
devtools_web_contents_.reset();
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::HandleKeyboardEvent(content::WebContents* source, const content::NativeWebKeyboardEvent& event) {
|
||||
|
|
|
@ -12,6 +12,7 @@ public:
|
|||
virtual gfx::NativeView GetNativeView() const = 0;
|
||||
|
||||
virtual void ShowDevTools() = 0;
|
||||
virtual void CloseDevTools() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ public:
|
|||
|
||||
virtual gfx::NativeView GetNativeView() const OVERRIDE;
|
||||
virtual void ShowDevTools() OVERRIDE;
|
||||
virtual void CloseDevTools() OVERRIDE;
|
||||
|
||||
InspectableWebContentsImpl* inspectable_web_contents() { return inspectable_web_contents_; }
|
||||
|
||||
|
|
|
@ -25,4 +25,8 @@ void InspectableWebContentsViewMac::ShowDevTools() {
|
|||
[view_ setDevToolsVisible:YES];
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewMac::CloseDevTools() {
|
||||
[view_ setDevToolsVisible:NO];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue