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

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

Issue 2451143003: <webview>: Correctly shift focus between WebContents. (Closed)
Patch Set: Address comments from alexmos and lfg. 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 // void Paste() override; 647 // void Paste() override;
648 // void SelectAll() override; 648 // void SelectAll() override;
649 void MoveRangeSelectionExtent(const gfx::Point& extent) override; 649 void MoveRangeSelectionExtent(const gfx::Point& extent) override;
650 void SelectRange(const gfx::Point& base, const gfx::Point& extent) override; 650 void SelectRange(const gfx::Point& base, const gfx::Point& extent) override;
651 void AdjustSelectionByCharacterOffset(int start_adjust, int end_adjust) 651 void AdjustSelectionByCharacterOffset(int start_adjust, int end_adjust)
652 override; 652 override;
653 RenderWidgetHostInputEventRouter* GetInputEventRouter() override; 653 RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
654 void ReplicatePageFocus(bool is_focused) override; 654 void ReplicatePageFocus(bool is_focused) override;
655 RenderWidgetHostImpl* GetFocusedRenderWidgetHost( 655 RenderWidgetHostImpl* GetFocusedRenderWidgetHost(
656 RenderWidgetHostImpl* receiving_widget) override; 656 RenderWidgetHostImpl* receiving_widget) override;
657 RenderWidgetHostImpl* GetRenderWidgetHostWithPageFocus() override;
658 void EnsureOwningContentsIsFocused(
659 RenderWidgetHostImpl* render_widget_host) override;
657 void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host, 660 void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host,
658 RendererUnresponsiveType type) override; 661 RendererUnresponsiveType type) override;
659 void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override; 662 void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override;
660 void RequestToLockMouse(RenderWidgetHostImpl* render_widget_host, 663 void RequestToLockMouse(RenderWidgetHostImpl* render_widget_host,
661 bool user_gesture, 664 bool user_gesture,
662 bool last_unlocked_by_target, 665 bool last_unlocked_by_target,
663 bool privileged) override; 666 bool privileged) override;
664 bool IsFullscreenForCurrentTab() const override; 667 bool IsFullscreenForCurrentTab() const override;
665 blink::WebDisplayMode GetDisplayMode( 668 blink::WebDisplayMode GetDisplayMode(
666 RenderWidgetHostImpl* render_widget_host) const override; 669 RenderWidgetHostImpl* render_widget_host) const override;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 1013
1011 // Returns the focused WebContents. 1014 // Returns the focused WebContents.
1012 // If there are multiple inner/outer WebContents (when embedding <webview>, 1015 // If there are multiple inner/outer WebContents (when embedding <webview>,
1013 // <guestview>, ...) returns the single one containing the currently focused 1016 // <guestview>, ...) returns the single one containing the currently focused
1014 // frame. Otherwise, returns this WebContents. 1017 // frame. Otherwise, returns this WebContents.
1015 WebContentsImpl* GetFocusedWebContents(); 1018 WebContentsImpl* GetFocusedWebContents();
1016 1019
1017 // Returns the root of the WebContents tree. 1020 // Returns the root of the WebContents tree.
1018 WebContentsImpl* GetOutermostWebContents(); 1021 WebContentsImpl* GetOutermostWebContents();
1019 1022
1023 // Become the focused WebContentsImpl. This will activate this content's
1024 // RenderWidget and direct keyboard input to it. The previously focused
alexmos 2016/10/31 18:57:57 Is it a bit ambiguous what "this content's RenderW
avallee 2016/11/07 19:18:44 Yes, focusing the Widget will call back into WebCo
1025 // WebContentsImpl, if any, will have its RenderWidget deactivated.
1026 void ChangeFocusIfNecessary();
alexmos 2016/10/31 18:57:57 Perhaps something like SetAsFocusedWebContentsIfNe
avallee 2016/11/07 19:18:44 Good idea. Done.
1027
1020 // Navigation helpers -------------------------------------------------------- 1028 // Navigation helpers --------------------------------------------------------
1021 // 1029 //
1022 // These functions are helpers for Navigate() and DidNavigate(). 1030 // These functions are helpers for Navigate() and DidNavigate().
1023 1031
1024 // Handles post-navigation tasks in DidNavigate AFTER the entry has been 1032 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
1025 // committed to the navigation controller. Note that the navigation entry is 1033 // committed to the navigation controller. Note that the navigation entry is
1026 // 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
1027 // current navigation entry is in the NavigationController at this point. 1035 // current navigation entry is in the NavigationController at this point.
1028 1036
1029 // Helper for CreateNewWidget/CreateNewFullscreenWidget. 1037 // Helper for CreateNewWidget/CreateNewFullscreenWidget.
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 // Adds/removes a callback called on creation of each new WebContents. 1469 // Adds/removes a callback called on creation of each new WebContents.
1462 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1470 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1463 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1471 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1464 1472
1465 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1473 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1466 }; 1474 };
1467 1475
1468 } // namespace content 1476 } // namespace content
1469 1477
1470 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1478 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698