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" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/browser/frame_host/navigation_controller_impl.h" | 12 #include "content/browser/frame_host/navigation_controller_impl.h" |
13 #include "content/browser/frame_host/navigator.h" | 13 #include "content/browser/frame_host/navigator.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/common/navigation_params.h" |
15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 class NavigationControllerImpl; | 22 class NavigationControllerImpl; |
22 class NavigatorDelegate; | 23 class NavigatorDelegate; |
23 class NavigatorTest; | 24 class NavigatorTest; |
24 struct LoadCommittedDetails; | 25 struct LoadCommittedDetails; |
25 struct CommitNavigationParams; | 26 struct CommitNavigationParams; |
26 struct CommonNavigationParams; | 27 struct CommonNavigationParams; |
27 struct RequestNavigationParams; | |
28 | 28 |
29 // This class is an implementation of Navigator, responsible for managing | 29 // This class is an implementation of Navigator, responsible for managing |
30 // navigations in regular browser tabs. | 30 // navigations in regular browser tabs. |
31 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 31 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
32 public: | 32 public: |
33 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 33 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
34 NavigatorDelegate* delegate); | 34 NavigatorDelegate* delegate); |
35 | 35 |
36 // Navigator implementation. | 36 // Navigator implementation. |
37 NavigatorDelegate* GetDelegate() override; | 37 NavigatorDelegate* GetDelegate() override; |
38 NavigationController* GetController() override; | 38 NavigationController* GetController() override; |
39 void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, | 39 void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, |
40 const GURL& url) override; | 40 const GURL& url) override; |
41 void DidFailProvisionalLoadWithError( | 41 void DidFailProvisionalLoadWithError( |
42 RenderFrameHostImpl* render_frame_host, | 42 RenderFrameHostImpl* render_frame_host, |
43 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) | 43 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) |
44 override; | 44 override; |
45 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, | 45 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, |
46 const GURL& url, | 46 const GURL& url, |
47 int error_code, | 47 int error_code, |
48 const base::string16& error_description, | 48 const base::string16& error_description, |
49 bool was_ignored_by_handler) override; | 49 bool was_ignored_by_handler) override; |
50 void DidNavigate( | 50 void DidNavigate( |
51 RenderFrameHostImpl* render_frame_host, | 51 RenderFrameHostImpl* render_frame_host, |
52 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) override; | 52 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) override; |
53 bool NavigateToPendingEntry(FrameTreeNode* frame_tree_node, | 53 bool NavigateToPendingEntry(FrameTreeNode* frame_tree_node, |
54 const FrameNavigationEntry& frame_entry, | 54 const FrameNavigationEntry& frame_entry, |
55 NavigationController::ReloadType reload_type, | 55 NavigationController::ReloadType reload_type, |
56 bool is_same_document_history_load) override; | 56 bool is_same_document_history_load, |
| 57 LoFiState lofi_state) override; |
57 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, | 58 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, |
58 const GURL& url, | 59 const GURL& url, |
59 SiteInstance* source_site_instance, | 60 SiteInstance* source_site_instance, |
60 const Referrer& referrer, | 61 const Referrer& referrer, |
61 WindowOpenDisposition disposition, | 62 WindowOpenDisposition disposition, |
62 bool should_replace_current_entry, | 63 bool should_replace_current_entry, |
63 bool user_gesture) override; | 64 bool user_gesture) override; |
64 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, | 65 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, |
65 const GURL& url, | 66 const GURL& url, |
66 SiteInstance* source_site_instance, | 67 SiteInstance* source_site_instance, |
(...skipping 28 matching lines...) Expand all Loading... |
95 | 96 |
96 friend class NavigatorTestWithBrowserSideNavigation; | 97 friend class NavigatorTestWithBrowserSideNavigation; |
97 ~NavigatorImpl() override; | 98 ~NavigatorImpl() override; |
98 | 99 |
99 // Navigates to the given entry, which must be the pending entry. Private | 100 // Navigates to the given entry, which must be the pending entry. Private |
100 // because all callers should use NavigateToPendingEntry. | 101 // because all callers should use NavigateToPendingEntry. |
101 bool NavigateToEntry(FrameTreeNode* frame_tree_node, | 102 bool NavigateToEntry(FrameTreeNode* frame_tree_node, |
102 const FrameNavigationEntry& frame_entry, | 103 const FrameNavigationEntry& frame_entry, |
103 const NavigationEntryImpl& entry, | 104 const NavigationEntryImpl& entry, |
104 NavigationController::ReloadType reload_type, | 105 NavigationController::ReloadType reload_type, |
105 bool is_same_document_history_load); | 106 bool is_same_document_history_load, |
| 107 LoFiState lofi_state); |
106 | 108 |
107 bool ShouldAssignSiteForURL(const GURL& url); | 109 bool ShouldAssignSiteForURL(const GURL& url); |
108 | 110 |
109 void CheckWebUIRendererDoesNotDisplayNormalURL( | 111 void CheckWebUIRendererDoesNotDisplayNormalURL( |
110 RenderFrameHostImpl* render_frame_host, | 112 RenderFrameHostImpl* render_frame_host, |
111 const GURL& url); | 113 const GURL& url); |
112 | 114 |
113 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it | 115 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it |
114 // to execute the beforeUnload event. Otherwise, the navigation request will | 116 // to execute the beforeUnload event. Otherwise, the navigation request will |
115 // be started. | 117 // be started. |
(...skipping 28 matching lines...) Expand all Loading... |
144 NavigatorDelegate* delegate_; | 146 NavigatorDelegate* delegate_; |
145 | 147 |
146 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 148 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
147 | 149 |
148 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 150 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
149 }; | 151 }; |
150 | 152 |
151 } // namespace content | 153 } // namespace content |
152 | 154 |
153 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 155 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |