Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 EnsureOwningContentsIsFocused( | |
| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| 1005 // Returns the focused WebContents. | 1008 // Returns the focused WebContents. |
| 1006 // If there are multiple inner/outer WebContents (when embedding <webview>, | 1009 // If there are multiple inner/outer WebContents (when embedding <webview>, |
| 1007 // <guestview>, ...) returns the single one containing the currently focused | 1010 // <guestview>, ...) returns the single one containing the currently focused |
| 1008 // frame. Otherwise, returns this WebContents. | 1011 // frame. Otherwise, returns this WebContents. |
| 1009 WebContentsImpl* GetFocusedWebContents(); | 1012 WebContentsImpl* GetFocusedWebContents(); |
| 1010 | 1013 |
| 1014 // Returns true if |this| is the focused WebContents or an ancestor of the | |
| 1015 // focused WebContents. | |
| 1016 bool ContainsOrIsFocusedWebContents(); | |
| 1017 | |
| 1011 // Returns the root of the WebContents tree. | 1018 // Returns the root of the WebContents tree. |
| 1012 WebContentsImpl* GetOutermostWebContents(); | 1019 WebContentsImpl* GetOutermostWebContents(); |
| 1013 | 1020 |
| 1021 // Become the focused WebContentsImpl. This will activate this content's main | |
| 1022 // frame RenderWidget and indirectly all its subframe widgets. | |
| 1023 // GetFocusedRenderWidgetHost will search this WebContentsImpl for a focused | |
| 1024 // RenderWidgetHost. The previously focused WebContentsImpl, if any, will have | |
| 1025 // its RenderWidgetHosts deactivated. | |
| 1026 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.
| |
| 1027 | |
| 1014 // Navigation helpers -------------------------------------------------------- | 1028 // Navigation helpers -------------------------------------------------------- |
| 1015 // | 1029 // |
| 1016 // These functions are helpers for Navigate() and DidNavigate(). | 1030 // These functions are helpers for Navigate() and DidNavigate(). |
| 1017 | 1031 |
| 1018 // Handles post-navigation tasks in DidNavigate AFTER the entry has been | 1032 // Handles post-navigation tasks in DidNavigate AFTER the entry has been |
| 1019 // committed to the navigation controller. Note that the navigation entry is | 1033 // committed to the navigation controller. Note that the navigation entry is |
| 1020 // not provided since it may be invalid/changed after being committed. The | 1034 // not provided since it may be invalid/changed after being committed. The |
| 1021 // current navigation entry is in the NavigationController at this point. | 1035 // current navigation entry is in the NavigationController at this point. |
| 1022 | 1036 |
| 1023 // Helper for CreateNewWidget/CreateNewFullscreenWidget. | 1037 // Helper for CreateNewWidget/CreateNewFullscreenWidget. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1457 // Adds/removes a callback called on creation of each new WebContents. | 1471 // Adds/removes a callback called on creation of each new WebContents. |
| 1458 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1472 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1459 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1473 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1460 | 1474 |
| 1461 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1475 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1462 }; | 1476 }; |
| 1463 | 1477 |
| 1464 } // namespace content | 1478 } // namespace content |
| 1465 | 1479 |
| 1466 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1480 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |