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

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

Issue 2451143003: <webview>: Correctly shift focus between WebContents. (Closed)
Patch Set: Fix creis comments. 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 // Inner WebContents Helpers -------------------------------------------------
1009 //
1010 // These functions are helpers in managing a hierarchy of WebContents
1011 // involved in rendering inner WebContents.
1012
1013 // When multiple WebContents are present within a tab or window, a single one
1014 // is focused and will route keyboard events in most cases to a RenderWidget
1015 // contained within it. |GetFocusedWebContents()|'s main frame widget will
1016 // receive page focus and blur events when the containing window changes focus
1017 // state.
1018
1005 // Returns the focused WebContents. 1019 // Returns the focused WebContents.
1006 // If there are multiple inner/outer WebContents (when embedding <webview>, 1020 // If there are multiple inner/outer WebContents (when embedding <webview>,
1007 // <guestview>, ...) returns the single one containing the currently focused 1021 // <guestview>, ...) returns the single one containing the currently focused
1008 // frame. Otherwise, returns this WebContents. 1022 // frame. Otherwise, returns this WebContents.
1009 WebContentsImpl* GetFocusedWebContents(); 1023 WebContentsImpl* GetFocusedWebContents();
1010 1024
1025 // Returns true if |this| is the focused WebContents or an ancestor of the
1026 // focused WebContents.
1027 bool ContainsOrIsFocusedWebContents();
1028
1029 // When inner or outer WebContents are present, become the focused
1030 // WebContentsImpl. This will activate this content's main frame RenderWidget
1031 // and indirectly all its subframe widgets. GetFocusedRenderWidgetHost will
1032 // search this WebContentsImpl for a focused RenderWidgetHost. The previously
1033 // focused WebContentsImpl, if any, will have its RenderWidgetHosts
1034 // deactivated.
1035 void SetAsFocusedWebContentsIfNecessary();
1036
1011 // Returns the root of the WebContents tree. 1037 // Returns the root of the WebContents tree.
1012 WebContentsImpl* GetOutermostWebContents(); 1038 WebContentsImpl* GetOutermostWebContents();
1013 1039
1014 // Navigation helpers -------------------------------------------------------- 1040 // Navigation helpers --------------------------------------------------------
1015 // 1041 //
1016 // These functions are helpers for Navigate() and DidNavigate(). 1042 // These functions are helpers for Navigate() and DidNavigate().
1017 1043
1018 // Handles post-navigation tasks in DidNavigate AFTER the entry has been 1044 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
1019 // committed to the navigation controller. Note that the navigation entry is 1045 // committed to the navigation controller. Note that the navigation entry is
1020 // not provided since it may be invalid/changed after being committed. The 1046 // 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. 1483 // Adds/removes a callback called on creation of each new WebContents.
1458 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1484 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1459 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1485 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1460 1486
1461 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1487 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1462 }; 1488 };
1463 1489
1464 } // namespace content 1490 } // namespace content
1465 1491
1466 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1492 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698