Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: content/browser/web_contents/web_contents_impl.h

Issue 2451143003: <webview>: Correctly shift focus between WebContents. (Closed)
Patch Set: Add fix for MacOS hang. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.h
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 358b8a6a0fa128ed851d627de3f369fea5733421..1d683c00fc06fee470e8e15441f83d8e538989c9 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -646,6 +646,9 @@ class CONTENT_EXPORT WebContentsImpl
void ReplicatePageFocus(bool is_focused) override;
RenderWidgetHostImpl* GetFocusedRenderWidgetHost(
RenderWidgetHostImpl* receiving_widget) override;
+ RenderWidgetHostImpl* GetRenderWidgetHostWithPageFocus() override;
+ void EnsureOwningContentsIsFocused(
+ RenderWidgetHostImpl* render_widget_host) override;
void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host,
RendererUnresponsiveType type) override;
void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override;
@@ -1008,9 +1011,20 @@ class CONTENT_EXPORT WebContentsImpl
// frame. Otherwise, returns this WebContents.
WebContentsImpl* GetFocusedWebContents();
+ // Returns true if |this| is the focused WebContents or an ancestor of the
+ // focused WebContents.
+ bool ContainsOrIsFocusedWebContents();
+
// Returns the root of the WebContents tree.
WebContentsImpl* GetOutermostWebContents();
+ // Become the focused WebContentsImpl. This will activate this content's main
+ // frame RenderWidget and indirectly all its subframe widgets.
+ // GetFocusedRenderWidgetHost will search this WebContentsImpl for a focused
+ // RenderWidgetHost. The previously focused WebContentsImpl, if any, will have
+ // its RenderWidgetHosts deactivated.
+ void SetAsFocusedWebContentsIfNecessary();
Charlie Reis 2016/11/16 20:28:23 This seems really subtle to me, and I'm concerned
avallee 2016/11/16 21:18:10 The concept of a "Focused" WebContents is for gues
Charlie Reis 2016/11/16 21:51:20 Ok, I'm glad it's limited to that case. I think i
avallee 2016/11/17 00:20:12 Added comment header block.
+
// Navigation helpers --------------------------------------------------------
//
// These functions are helpers for Navigate() and DidNavigate().

Powered by Google App Engine
This is Rietveld 408576698