| 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; |
| 78 virtual void CommitNavigation( |
| 79 RenderFrameHostImpl* render_frame_host, |
| 80 const NavigationBeforeCommitInfo& info) OVERRIDE; |
| 69 | 81 |
| 70 private: | 82 private: |
| 71 virtual ~NavigatorImpl() {} | 83 virtual ~NavigatorImpl() {} |
| 72 | 84 |
| 73 // Navigates to the given entry, which must be the pending entry. Private | 85 // Navigates to the given entry, which must be the pending entry. Private |
| 74 // because all callers should use NavigateToPendingEntry. | 86 // because all callers should use NavigateToPendingEntry. |
| 75 bool NavigateToEntry( | 87 bool NavigateToEntry( |
| 76 RenderFrameHostImpl* render_frame_host, | 88 RenderFrameHostImpl* render_frame_host, |
| 77 const NavigationEntryImpl& entry, | 89 const NavigationEntryImpl& entry, |
| 78 NavigationController::ReloadType reload_type); | 90 NavigationController::ReloadType reload_type); |
| 79 | 91 |
| 80 bool ShouldAssignSiteForURL(const GURL& url); | 92 bool ShouldAssignSiteForURL(const GURL& url); |
| 81 | 93 |
| 94 void CheckWebUIRendererDoesNotDisplayNormalURL( |
| 95 RenderFrameHostImpl* render_frame_host, |
| 96 const GURL& url); |
| 97 |
| 82 // The NavigationController that will keep track of session history for all | 98 // The NavigationController that will keep track of session history for all |
| 83 // RenderFrameHost objects using this NavigatorImpl. | 99 // RenderFrameHost objects using this NavigatorImpl. |
| 84 // TODO(nasko): Move ownership of the NavigationController from | 100 // TODO(nasko): Move ownership of the NavigationController from |
| 85 // WebContentsImpl to this class. | 101 // WebContentsImpl to this class. |
| 86 NavigationControllerImpl* controller_; | 102 NavigationControllerImpl* controller_; |
| 87 | 103 |
| 88 // Used to notify the object embedding this Navigator about navigation | 104 // Used to notify the object embedding this Navigator about navigation |
| 89 // events. Can be NULL in tests. | 105 // events. Can be NULL in tests. |
| 90 NavigatorDelegate* delegate_; | 106 NavigatorDelegate* delegate_; |
| 91 | 107 |
| 92 // System time at which the current load was started. | 108 // System time at which the current load was started. |
| 93 base::TimeTicks current_load_start_; | 109 base::TimeTicks current_load_start_; |
| 94 | 110 |
| 95 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 111 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
| 96 }; | 112 }; |
| 97 | 113 |
| 98 } // namespace content | 114 } // namespace content |
| 99 | 115 |
| 100 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 116 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| OLD | NEW |