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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/browser/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
10 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 struct FrameMsg_Navigate_Params; | |
14 | |
13 namespace content { | 15 namespace content { |
14 | 16 |
15 class NavigationControllerImpl; | 17 class NavigationControllerImpl; |
16 class NavigatorDelegate; | 18 class NavigatorDelegate; |
17 struct LoadCommittedDetails; | 19 struct LoadCommittedDetails; |
18 | 20 |
19 // This class is an implementation of Navigator, responsible for managing | 21 // This class is an implementation of Navigator, responsible for managing |
20 // navigations in regular browser tabs. | 22 // navigations in regular browser tabs. |
21 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 23 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
22 public: | 24 public: |
23 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 25 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
24 NavigatorDelegate* delegate); | 26 NavigatorDelegate* delegate); |
25 | 27 |
28 // Fills in |params| based on the content of |entry|. | |
29 static void MakeNavigateParams(const NavigationEntryImpl& entry, | |
30 const NavigationControllerImpl& controller, | |
31 NavigationController::ReloadType reload_type, | |
32 base::TimeTicks navigation_start, | |
33 FrameMsg_Navigate_Params* params); | |
34 | |
26 // Navigator implementation. | 35 // Navigator implementation. |
27 virtual NavigationController* GetController() OVERRIDE; | 36 virtual NavigationController* GetController() OVERRIDE; |
28 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, | 37 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, |
29 const GURL& url, | 38 const GURL& url, |
30 bool is_transition_navigation) OVERRIDE; | 39 bool is_transition_navigation) OVERRIDE; |
31 virtual void DidFailProvisionalLoadWithError( | 40 virtual void DidFailProvisionalLoadWithError( |
32 RenderFrameHostImpl* render_frame_host, | 41 RenderFrameHostImpl* render_frame_host, |
33 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) | 42 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) |
34 OVERRIDE; | 43 OVERRIDE; |
35 virtual void DidFailLoadWithError( | 44 virtual void DidFailLoadWithError( |
(...skipping 23 matching lines...) Expand all Loading... | |
59 virtual void RequestTransferURL( | 68 virtual void RequestTransferURL( |
60 RenderFrameHostImpl* render_frame_host, | 69 RenderFrameHostImpl* render_frame_host, |
61 const GURL& url, | 70 const GURL& url, |
62 const std::vector<GURL>& redirect_chain, | 71 const std::vector<GURL>& redirect_chain, |
63 const Referrer& referrer, | 72 const Referrer& referrer, |
64 PageTransition page_transition, | 73 PageTransition page_transition, |
65 WindowOpenDisposition disposition, | 74 WindowOpenDisposition disposition, |
66 const GlobalRequestID& transferred_global_request_id, | 75 const GlobalRequestID& transferred_global_request_id, |
67 bool should_replace_current_entry, | 76 bool should_replace_current_entry, |
68 bool user_gesture) OVERRIDE; | 77 bool user_gesture) OVERRIDE; |
69 | 78 |
nasko
2014/08/13 00:08:00
nit: no new line needed
clamy
2014/08/13 13:27:24
Done.
| |
79 virtual void OnBeginNavigation( | |
80 RenderFrameHostImpl* render_frame_host, | |
81 const FrameHostMsg_BeginNavigation_Params& params) OVERRIDE; | |
82 virtual void CommitNavigation( | |
83 RenderFrameHostImpl* render_frame_host, | |
84 const NavigationBeforeCommitInfo& info) OVERRIDE; | |
85 | |
70 private: | 86 private: |
71 virtual ~NavigatorImpl() {} | 87 virtual ~NavigatorImpl() {} |
72 | 88 |
73 // Navigates to the given entry, which must be the pending entry. Private | 89 // Navigates to the given entry, which must be the pending entry. Private |
74 // because all callers should use NavigateToPendingEntry. | 90 // because all callers should use NavigateToPendingEntry. |
75 bool NavigateToEntry( | 91 bool NavigateToEntry( |
76 RenderFrameHostImpl* render_frame_host, | 92 RenderFrameHostImpl* render_frame_host, |
77 const NavigationEntryImpl& entry, | 93 const NavigationEntryImpl& entry, |
78 NavigationController::ReloadType reload_type); | 94 NavigationController::ReloadType reload_type); |
79 | 95 |
80 bool ShouldAssignSiteForURL(const GURL& url); | 96 bool ShouldAssignSiteForURL(const GURL& url); |
81 | 97 |
98 void CheckWebUIRendererDoesNotDisplayNormalURL( | |
99 RenderFrameHostImpl* render_frame_host, | |
100 const GURL& url); | |
101 | |
82 // The NavigationController that will keep track of session history for all | 102 // The NavigationController that will keep track of session history for all |
83 // RenderFrameHost objects using this NavigatorImpl. | 103 // RenderFrameHost objects using this NavigatorImpl. |
84 // TODO(nasko): Move ownership of the NavigationController from | 104 // TODO(nasko): Move ownership of the NavigationController from |
85 // WebContentsImpl to this class. | 105 // WebContentsImpl to this class. |
86 NavigationControllerImpl* controller_; | 106 NavigationControllerImpl* controller_; |
87 | 107 |
88 // Used to notify the object embedding this Navigator about navigation | 108 // Used to notify the object embedding this Navigator about navigation |
89 // events. Can be NULL in tests. | 109 // events. Can be NULL in tests. |
90 NavigatorDelegate* delegate_; | 110 NavigatorDelegate* delegate_; |
91 | 111 |
92 // System time at which the current load was started. | 112 // System time at which the current load was started. |
93 base::TimeTicks current_load_start_; | 113 base::TimeTicks current_load_start_; |
94 | 114 |
95 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 115 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
96 }; | 116 }; |
97 | 117 |
98 } // namespace content | 118 } // namespace content |
99 | 119 |
100 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 120 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |