zoom_factor_(1.0),
inspectable_web_contents_(inspectable_web_contents),
weak_factory_(this) {
+ inspectable_web_contents->GetView()->SetDelegate(this);
+
options.Get(switches::kFrame, &has_frame_);
options.Get(switches::kTransparent, &transparent_);
options.Get(switches::kEnableLargerThanScreen, &enable_larger_than_screen_);
}
void NativeWindow::CloseContents(content::WebContents* source) {
+ inspectable_web_contents_->GetView()->SetDelegate(nullptr);
inspectable_web_contents_ = nullptr;
// When the web contents is gone, close the window immediately, but the
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnRendererResponsive());
}
+void NativeWindow::DevToolsFocused() {
+ FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnDevToolsFocus());
+}
+
+void NativeWindow::DevToolsOpened() {
+ FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnDevToolsOpened());
+}
+
+void NativeWindow::DevToolsClosed() {
+ FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnDevToolsClosed());
+}
+
void NativeWindow::BeforeUnloadDialogCancelled() {
WindowList::WindowCloseCancelled(this);
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "brightray/browser/inspectable_web_contents_view_delegate.h"
#include "content/public/browser/readback_types.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
struct DraggableRegion;
-class NativeWindow : public content::WebContentsObserver {
+class NativeWindow : public content::WebContentsObserver,
+ public brightray::InspectableWebContentsViewDelegate {
public:
typedef base::Callback<void(const SkBitmap& bitmap)> CapturePageCallback;
virtual void UpdateDraggableRegions(
const std::vector<DraggableRegion>& regions) = 0;
- // Implementations of content::WebContentsObserver.
+ // brightray::InspectableWebContentsViewDelegate:
+ void DevToolsFocused() override;
+ void DevToolsOpened() override;
+ void DevToolsClosed() override;
+
+ // content::WebContentsObserver:
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void BeforeUnloadDialogCancelled() override;
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override;
bool ExecuteWindowsCommand(int command_id) override;
#endif
- // brightray::InspectableWebContentsDelegate:
+ // brightray::InspectableWebContentsViewDelegate:
gfx::ImageSkia GetDevToolsWindowIcon() override;
#if defined(USE_X11)
void GetDevToolsWindowWMClass(
-Subproject commit 20871355cb590e009d7ee394a7d9da0e4666ea0b
+Subproject commit b05e019d2f66023fad1ae2f16cc765e3d62ffd5e