summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_view_qt.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 11:19:09 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 11:53:14 +0000
commitc8d11a21c648e87f3560042e1c022f031a6e6519 (patch)
treed8885fb28dd423258abc4eeadbdd7157c7b5c6c5 /src/core/web_contents_view_qt.h
parent01c763c83d0c846164dcb5b69b9343e6ee2ac0b7 (diff)
Fixup focus implementation
Follow the other implementation and pass TakeFocus to WebContents Delegate, and hook to our UI from there. Also fixes use of Blur instead of LostFocus, which means we now render unfocused more correctly. Change-Id: I34a1882489bc68b9ff36ed5139af0ee8a3a95b79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/core/web_contents_view_qt.h')
-rw-r--r--src/core/web_contents_view_qt.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index d1a2ff81e..7036907c5 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -69,6 +69,7 @@ public:
void initialize(WebContentsAdapterClient* client);
WebContentsAdapterClient *client() { return m_client; }
+ // content::WebContentsView overrides:
content::RenderWidgetHostViewBase *CreateViewForWidget(content::RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override;
void CreateView(const gfx::Size& initial_size, gfx::NativeView context) override;
@@ -107,6 +108,16 @@ public:
gfx::Rect GetViewBounds() const override { QT_NOT_YET_IMPLEMENTED return gfx::Rect(); }
+ void FocusThroughTabTraversal(bool reverse) override;
+
+#if defined(OS_MACOSX)
+ void SetAllowOtherViews(bool allow) override { m_allowOtherViews = allow; }
+ bool GetAllowOtherViews() const override { return m_allowOtherViews; }
+ void CloseTabAfterEventTracking() override { QT_NOT_YET_IMPLEMENTED }
+ bool IsEventTracking() const override { QT_NOT_YET_IMPLEMENTED; return false; }
+#endif // defined(OS_MACOSX)
+
+ // content::RenderViewHostDelegateView overrides:
void StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops,
const gfx::ImageSkia& image, const gfx::Vector2d& image_offset,
const content::DragEventSourceInfo& event_info,
@@ -116,18 +127,10 @@ public:
void ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params) override;
+ void GotFocus(content::RenderWidgetHostImpl *render_widget_host) override;
+ void LostFocus(content::RenderWidgetHostImpl *render_widget_host) override;
void TakeFocus(bool reverse) override;
- void FocusThroughTabTraversal(bool reverse) override;
-
-
-#if defined(OS_MACOSX)
- void SetAllowOtherViews(bool allow) override { m_allowOtherViews = allow; }
- bool GetAllowOtherViews() const override { return m_allowOtherViews; }
- void CloseTabAfterEventTracking() override { QT_NOT_YET_IMPLEMENTED }
- bool IsEventTracking() const override { QT_NOT_YET_IMPLEMENTED; return false; }
-#endif // defined(OS_MACOSX)
-
private:
content::WebContents *m_webContents;
WebContentsAdapterClient *m_client;