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

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

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review: Fix works with oopif webview but does not fix crbug.com/609903 Created 4 years, 7 months 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 GeolocationServiceContext* GetGeolocationServiceContext() override; 456 GeolocationServiceContext* GetGeolocationServiceContext() override;
457 WakeLockServiceContext* GetWakeLockServiceContext() override; 457 WakeLockServiceContext* GetWakeLockServiceContext() override;
458 void EnterFullscreenMode(const GURL& origin) override; 458 void EnterFullscreenMode(const GURL& origin) override;
459 void ExitFullscreenMode(bool will_cause_resize) override; 459 void ExitFullscreenMode(bool will_cause_resize) override;
460 bool ShouldRouteMessageEvent( 460 bool ShouldRouteMessageEvent(
461 RenderFrameHost* target_rfh, 461 RenderFrameHost* target_rfh,
462 SiteInstance* source_site_instance) const override; 462 SiteInstance* source_site_instance) const override;
463 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override; 463 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override;
464 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( 464 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost(
465 const GURL& url) override; 465 const GURL& url) override;
466 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) override;
466 467
467 // RenderViewHostDelegate ---------------------------------------------------- 468 // RenderViewHostDelegate ----------------------------------------------------
468 RenderViewHostDelegateView* GetDelegateView() override; 469 RenderViewHostDelegateView* GetDelegateView() override;
469 bool OnMessageReceived(RenderViewHost* render_view_host, 470 bool OnMessageReceived(RenderViewHost* render_view_host,
470 const IPC::Message& message) override; 471 const IPC::Message& message) override;
471 // RenderFrameHostDelegate has the same method, so list it there because this 472 // RenderFrameHostDelegate has the same method, so list it there because this
472 // interface is going away. 473 // interface is going away.
473 // WebContents* GetAsWebContents() override; 474 // WebContents* GetAsWebContents() override;
474 void RenderViewCreated(RenderViewHost* render_view_host) override; 475 void RenderViewCreated(RenderViewHost* render_view_host) override;
475 void RenderViewReady(RenderViewHost* render_view_host) override; 476 void RenderViewReady(RenderViewHost* render_view_host) override;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 // 804 //
804 // Two WebContents with separate FrameTrees can be connected by 805 // Two WebContents with separate FrameTrees can be connected by
805 // outer/inner relationship using this class. Note that their FrameTrees 806 // outer/inner relationship using this class. Note that their FrameTrees
806 // still remain disjoint. 807 // still remain disjoint.
807 // The parent is referred to as "outer WebContents" and the descendents are 808 // The parent is referred to as "outer WebContents" and the descendents are
808 // referred to as "inner WebContents". 809 // referred to as "inner WebContents".
809 // For each inner WebContents, the outer WebContents will have a 810 // For each inner WebContents, the outer WebContents will have a
810 // corresponding FrameTreeNode. 811 // corresponding FrameTreeNode.
811 struct WebContentsTreeNode { 812 struct WebContentsTreeNode {
812 public: 813 public:
813 WebContentsTreeNode(); 814 WebContentsTreeNode(WebContentsImpl* inner);
814 ~WebContentsTreeNode(); 815 ~WebContentsTreeNode();
815 816
816 typedef std::set<WebContentsTreeNode*> ChildrenSet; 817 typedef std::unordered_map<int, WebContentsTreeNode*> ChildrenMap;
817 818
818 void ConnectToOuterWebContents(WebContentsImpl* outer_web_contents, 819 void ConnectToOuterWebContents(WebContentsImpl* outer_web_contents,
819 RenderFrameHostImpl* outer_contents_frame); 820 RenderFrameHostImpl* outer_contents_frame);
820 821
821 WebContentsImpl* outer_web_contents() { return outer_web_contents_; } 822 WebContentsImpl* outer_web_contents() const { return outer_web_contents_; }
822 int outer_contents_frame_tree_node_id() { 823 int outer_contents_frame_tree_node_id() const {
823 return outer_contents_frame_tree_node_id_; 824 return outer_contents_frame_tree_node_id_;
824 } 825 }
825 826
827 WebContentsImpl* find_contents_for_frame(int frame_id) const;
lfg 2016/05/06 21:23:33 Use FindContentsForFrame(int). Unix-style naming i
avallee 2016/05/11 18:26:11 Done.
828
826 private: 829 private:
827 // The outer WebContents. 830 // The web contents that owns this node
831 WebContentsImpl* const inner_web_contents_;
832
833 // The outer WebContents
828 WebContentsImpl* outer_web_contents_; 834 WebContentsImpl* outer_web_contents_;
829 // The ID of the FrameTreeNode in outer WebContents that is hosting us. 835 // The ID of the FrameTreeNode in outer WebContents that is hosting us.
830 int outer_contents_frame_tree_node_id_; 836 int outer_contents_frame_tree_node_id_;
831 // List of inner WebContents that we host. 837 // List of inner WebContents that we host.
832 ChildrenSet inner_web_contents_tree_nodes_; 838 ChildrenMap inner_web_contents_tree_nodes_;
833 }; 839 };
834 840
835 // See WebContents::Create for a description of these parameters. 841 // See WebContents::Create for a description of these parameters.
836 WebContentsImpl(BrowserContext* browser_context); 842 WebContentsImpl(BrowserContext* browser_context);
837 843
838 // Add and remove observers for page navigation notifications. The order in 844 // Add and remove observers for page navigation notifications. The order in
839 // which notifications are sent to observers is undefined. Clients must be 845 // which notifications are sent to observers is undefined. Clients must be
840 // sure to remove the observer before they go away. 846 // sure to remove the observer before they go away.
841 void AddObserver(WebContentsObserver* observer); 847 void AddObserver(WebContentsObserver* observer);
842 void RemoveObserver(WebContentsObserver* observer); 848 void RemoveObserver(WebContentsObserver* observer);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 void OnFirstVisuallyNonEmptyPaint(); 966 void OnFirstVisuallyNonEmptyPaint();
961 void OnShowValidationMessage(const gfx::Rect& anchor_in_root_view, 967 void OnShowValidationMessage(const gfx::Rect& anchor_in_root_view,
962 const base::string16& main_text, 968 const base::string16& main_text,
963 const base::string16& sub_text); 969 const base::string16& sub_text);
964 void OnHideValidationMessage(); 970 void OnHideValidationMessage();
965 void OnMoveValidationMessage(const gfx::Rect& anchor_in_root_view); 971 void OnMoveValidationMessage(const gfx::Rect& anchor_in_root_view);
966 972
967 // Called by derived classes to indicate that we're no longer waiting for a 973 // Called by derived classes to indicate that we're no longer waiting for a
968 // response. This won't actually update the throbber, but it will get picked 974 // response. This won't actually update the throbber, but it will get picked
969 // up at the next animation step if the throbber is going. 975 // up at the next animation step if the throbber is going.
970 void SetNotWaitingForResponse() { waiting_for_response_ = false; } 976 void SetNotWaitingForResponse() { waiting_for_response_ = false; }
lfg 2016/05/06 21:23:33 Add blank line, since the comment above doesn't ap
avallee 2016/05/11 18:26:11 Done.
977 void SetFocusedFrameInternal(FrameTreeNode* node,
978 SiteInstance* source,
979 bool can_visit_outer_contents);
971 980
972 // Navigation helpers -------------------------------------------------------- 981 // Navigation helpers --------------------------------------------------------
973 // 982 //
974 // These functions are helpers for Navigate() and DidNavigate(). 983 // These functions are helpers for Navigate() and DidNavigate().
975 984
976 // Handles post-navigation tasks in DidNavigate AFTER the entry has been 985 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
977 // committed to the navigation controller. Note that the navigation entry is 986 // committed to the navigation controller. Note that the navigation entry is
978 // not provided since it may be invalid/changed after being committed. The 987 // not provided since it may be invalid/changed after being committed. The
979 // current navigation entry is in the NavigationController at this point. 988 // current navigation entry is in the NavigationController at this point.
980 989
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 // Adds/removes a callback called on creation of each new WebContents. 1404 // Adds/removes a callback called on creation of each new WebContents.
1396 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1405 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1397 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1406 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1398 1407
1399 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1408 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1400 }; 1409 };
1401 1410
1402 } // namespace content 1411 } // namespace content
1403 1412
1404 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1413 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698