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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 2451143003: <webview>: Correctly shift focus between WebContents. (Closed)
Patch Set: Fix final comments from creis and alexmos. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // void Paste() override; 639 // void Paste() override;
640 // void SelectAll() override; 640 // void SelectAll() override;
641 void MoveRangeSelectionExtent(const gfx::Point& extent) override; 641 void MoveRangeSelectionExtent(const gfx::Point& extent) override;
642 void SelectRange(const gfx::Point& base, const gfx::Point& extent) override; 642 void SelectRange(const gfx::Point& base, const gfx::Point& extent) override;
643 void AdjustSelectionByCharacterOffset(int start_adjust, int end_adjust) 643 void AdjustSelectionByCharacterOffset(int start_adjust, int end_adjust)
644 override; 644 override;
645 RenderWidgetHostInputEventRouter* GetInputEventRouter() override; 645 RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
646 void ReplicatePageFocus(bool is_focused) override; 646 void ReplicatePageFocus(bool is_focused) override;
647 RenderWidgetHostImpl* GetFocusedRenderWidgetHost( 647 RenderWidgetHostImpl* GetFocusedRenderWidgetHost(
648 RenderWidgetHostImpl* receiving_widget) override; 648 RenderWidgetHostImpl* receiving_widget) override;
649 RenderWidgetHostImpl* GetRenderWidgetHostWithPageFocus() override;
650 void FocusOwningWebContents(
651 RenderWidgetHostImpl* render_widget_host) override;
649 void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host, 652 void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host,
650 RendererUnresponsiveType type) override; 653 RendererUnresponsiveType type) override;
651 void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override; 654 void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override;
652 void RequestToLockMouse(RenderWidgetHostImpl* render_widget_host, 655 void RequestToLockMouse(RenderWidgetHostImpl* render_widget_host,
653 bool user_gesture, 656 bool user_gesture,
654 bool last_unlocked_by_target, 657 bool last_unlocked_by_target,
655 bool privileged) override; 658 bool privileged) override;
656 bool IsFullscreenForCurrentTab() const override; 659 bool IsFullscreenForCurrentTab() const override;
657 blink::WebDisplayMode GetDisplayMode( 660 blink::WebDisplayMode GetDisplayMode(
658 RenderWidgetHostImpl* render_widget_host) const override; 661 RenderWidgetHostImpl* render_widget_host) const override;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 const base::string16& main_text, 998 const base::string16& main_text,
996 const base::string16& sub_text); 999 const base::string16& sub_text);
997 void OnHideValidationMessage(); 1000 void OnHideValidationMessage();
998 void OnMoveValidationMessage(const gfx::Rect& anchor_in_root_view); 1001 void OnMoveValidationMessage(const gfx::Rect& anchor_in_root_view);
999 1002
1000 // Called by derived classes to indicate that we're no longer waiting for a 1003 // Called by derived classes to indicate that we're no longer waiting for a
1001 // response. This won't actually update the throbber, but it will get picked 1004 // response. This won't actually update the throbber, but it will get picked
1002 // up at the next animation step if the throbber is going. 1005 // up at the next animation step if the throbber is going.
1003 void SetNotWaitingForResponse() { waiting_for_response_ = false; } 1006 void SetNotWaitingForResponse() { waiting_for_response_ = false; }
1004 1007
1008
1009 // Guest View Helpers --------------------------------------------------------
Charlie Reis 2016/11/17 00:49:48 nit: GuestView isn't a concept within content, so
avallee 2016/11/17 02:37:49 Done.
1010 //
1011 // These functions are helpers in managing a hierharchy of WebContents
Charlie Reis 2016/11/17 00:49:48 nit: hierarchy
avallee 2016/11/17 02:37:49 Done.
1012 // involved in rendering Guest Views.
Charlie Reis 2016/11/17 00:49:48 nit: rendering inner WebContents.
avallee 2016/11/17 02:37:49 Done.
1013
1014 // When multiple WebContents are present, a single one is focused and will
Charlie Reis 2016/11/17 00:49:48 nit: present within a tab?
avallee 2016/11/17 02:37:49 Done.
1015 // route keyboard events in most cases to a RenderWidget contained within
1016 // it. |GetFocusedWebContents()|'s main frame widget will receive page focus
1017 // and blur events when the containing window changes focus state.
1018
1019
1005 // Returns the focused WebContents. 1020 // Returns the focused WebContents.
1006 // If there are multiple inner/outer WebContents (when embedding <webview>, 1021 // If there are multiple inner/outer WebContents (when embedding <webview>,
1007 // <guestview>, ...) returns the single one containing the currently focused 1022 // <guestview>, ...) returns the single one containing the currently focused
1008 // frame. Otherwise, returns this WebContents. 1023 // frame. Otherwise, returns this WebContents.
1009 WebContentsImpl* GetFocusedWebContents(); 1024 WebContentsImpl* GetFocusedWebContents();
1010 1025
1026 // Returns true if |this| is the focused WebContents or an ancestor of the
1027 // focused WebContents.
1028 bool ContainsOrIsFocusedWebContents();
1029
1030 // When inner or outer WebContents are present, become the focused
1031 // WebContentsImpl. This will activate this content's main frame RenderWidget
1032 // and indirectly all its subframe widgets. GetFocusedRenderWidgetHost will
1033 // search this WebContentsImpl for a focused RenderWidgetHost. The previously
1034 // focused WebContentsImpl, if any, will have its RenderWidgetHosts
1035 // deactivated.
1036 void SetAsFocusedWebContentsIfNecessary();
1037
1011 // Returns the root of the WebContents tree. 1038 // Returns the root of the WebContents tree.
1012 WebContentsImpl* GetOutermostWebContents(); 1039 WebContentsImpl* GetOutermostWebContents();
1013 1040
1014 // Navigation helpers -------------------------------------------------------- 1041 // Navigation helpers --------------------------------------------------------
1015 // 1042 //
1016 // These functions are helpers for Navigate() and DidNavigate(). 1043 // These functions are helpers for Navigate() and DidNavigate().
1017 1044
1018 // Handles post-navigation tasks in DidNavigate AFTER the entry has been 1045 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
1019 // committed to the navigation controller. Note that the navigation entry is 1046 // committed to the navigation controller. Note that the navigation entry is
1020 // not provided since it may be invalid/changed after being committed. The 1047 // not provided since it may be invalid/changed after being committed. The
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 // Adds/removes a callback called on creation of each new WebContents. 1484 // Adds/removes a callback called on creation of each new WebContents.
1458 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1485 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1459 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1486 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1460 1487
1461 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1488 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1462 }; 1489 };
1463 1490
1464 } // namespace content 1491 } // namespace content
1465 1492
1466 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1493 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698