OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_HOST_NAVIGATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
7 | 7 |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 struct CommonNavigationParams; | 28 struct CommonNavigationParams; |
29 struct RequestNavigationParams; | 29 struct RequestNavigationParams; |
30 | 30 |
31 // This class is an implementation of Navigator, responsible for managing | 31 // This class is an implementation of Navigator, responsible for managing |
32 // navigations in regular browser tabs. | 32 // navigations in regular browser tabs. |
33 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 33 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
34 public: | 34 public: |
35 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 35 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
36 NavigatorDelegate* delegate); | 36 NavigatorDelegate* delegate); |
37 | 37 |
38 // PlzNavigate | |
39 // Returns the navigation request for a given node. Used in tests. | |
40 NavigationRequest* GetNavigationRequestForNodeForTesting( | |
41 FrameTreeNode* frame_tree_node); | |
nasko
2014/11/15 00:32:51
nit: Move this after the Navigator interface overr
clamy
2014/11/17 12:51:12
Done.
| |
42 | |
38 // Navigator implementation. | 43 // Navigator implementation. |
39 NavigationController* GetController() override; | 44 NavigationController* GetController() override; |
40 void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, | 45 void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, |
41 const GURL& url, | 46 const GURL& url, |
42 bool is_transition_navigation) override; | 47 bool is_transition_navigation) override; |
43 void DidFailProvisionalLoadWithError( | 48 void DidFailProvisionalLoadWithError( |
44 RenderFrameHostImpl* render_frame_host, | 49 RenderFrameHostImpl* render_frame_host, |
45 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) | 50 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) |
46 override; | 51 override; |
47 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, | 52 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 const GURL& url) override; | 84 const GURL& url) override; |
80 void LogBeforeUnloadTime( | 85 void LogBeforeUnloadTime( |
81 const base::TimeTicks& renderer_before_unload_start_time, | 86 const base::TimeTicks& renderer_before_unload_start_time, |
82 const base::TimeTicks& renderer_before_unload_end_time) override; | 87 const base::TimeTicks& renderer_before_unload_end_time) override; |
83 void CancelNavigation(FrameTreeNode* frame_tree_node) override; | 88 void CancelNavigation(FrameTreeNode* frame_tree_node) override; |
84 | 89 |
85 private: | 90 private: |
86 // Holds data used to track browser side navigation metrics. | 91 // Holds data used to track browser side navigation metrics. |
87 struct NavigationMetricsData; | 92 struct NavigationMetricsData; |
88 | 93 |
89 friend class NavigatorTest; | 94 friend class NavigatorTestWithBrowserSideNavigation; |
90 ~NavigatorImpl() override; | 95 ~NavigatorImpl() override; |
91 | 96 |
92 // Navigates to the given entry, which must be the pending entry. Private | 97 // Navigates to the given entry, which must be the pending entry. Private |
93 // because all callers should use NavigateToPendingEntry. | 98 // because all callers should use NavigateToPendingEntry. |
94 bool NavigateToEntry( | 99 bool NavigateToEntry( |
95 RenderFrameHostImpl* render_frame_host, | 100 RenderFrameHostImpl* render_frame_host, |
96 const NavigationEntryImpl& entry, | 101 const NavigationEntryImpl& entry, |
97 NavigationController::ReloadType reload_type); | 102 NavigationController::ReloadType reload_type); |
98 | 103 |
99 bool ShouldAssignSiteForURL(const GURL& url); | 104 bool ShouldAssignSiteForURL(const GURL& url); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 // different FrameTreeNodes, based on the frame_tree_node_id. | 136 // different FrameTreeNodes, based on the frame_tree_node_id. |
132 typedef base::ScopedPtrHashMap<int64, NavigationRequest> NavigationRequestMap; | 137 typedef base::ScopedPtrHashMap<int64, NavigationRequest> NavigationRequestMap; |
133 NavigationRequestMap navigation_request_map_; | 138 NavigationRequestMap navigation_request_map_; |
134 | 139 |
135 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 140 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
136 }; | 141 }; |
137 | 142 |
138 } // namespace content | 143 } // namespace content |
139 | 144 |
140 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 145 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |