| 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 "base/time/time.h" |
| 9 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 10 #include "content/browser/frame_host/navigator.h" | 11 #include "content/browser/frame_host/navigator.h" |
| 11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "url/gurl.h" |
| 12 | 14 |
| 13 struct FrameMsg_Navigate_Params; | 15 struct FrameMsg_Navigate_Params; |
| 14 | 16 |
| 15 namespace content { | 17 namespace content { |
| 16 | 18 |
| 17 class NavigationControllerImpl; | 19 class NavigationControllerImpl; |
| 18 class NavigatorDelegate; | 20 class NavigatorDelegate; |
| 19 struct LoadCommittedDetails; | 21 struct LoadCommittedDetails; |
| 20 | 22 |
| 21 // This class is an implementation of Navigator, responsible for managing | 23 // This class is an implementation of Navigator, responsible for managing |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 const Referrer& referrer, | 73 const Referrer& referrer, |
| 72 ui::PageTransition page_transition, | 74 ui::PageTransition page_transition, |
| 73 WindowOpenDisposition disposition, | 75 WindowOpenDisposition disposition, |
| 74 const GlobalRequestID& transferred_global_request_id, | 76 const GlobalRequestID& transferred_global_request_id, |
| 75 bool should_replace_current_entry, | 77 bool should_replace_current_entry, |
| 76 bool user_gesture) OVERRIDE; | 78 bool user_gesture) OVERRIDE; |
| 77 virtual void CommitNavigation( | 79 virtual void CommitNavigation( |
| 78 RenderFrameHostImpl* render_frame_host, | 80 RenderFrameHostImpl* render_frame_host, |
| 79 const NavigationBeforeCommitInfo& info) OVERRIDE; | 81 const NavigationBeforeCommitInfo& info) OVERRIDE; |
| 80 | 82 |
| 83 virtual void LogResourceRequestTime( |
| 84 base::TimeTicks timestamp, const GURL& url) OVERRIDE; |
| 85 |
| 81 private: | 86 private: |
| 82 virtual ~NavigatorImpl() {} | 87 virtual ~NavigatorImpl() {} |
| 83 | 88 |
| 84 // 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 |
| 85 // because all callers should use NavigateToPendingEntry. | 90 // because all callers should use NavigateToPendingEntry. |
| 86 bool NavigateToEntry( | 91 bool NavigateToEntry( |
| 87 RenderFrameHostImpl* render_frame_host, | 92 RenderFrameHostImpl* render_frame_host, |
| 88 const NavigationEntryImpl& entry, | 93 const NavigationEntryImpl& entry, |
| 89 NavigationController::ReloadType reload_type); | 94 NavigationController::ReloadType reload_type); |
| 90 | 95 |
| 91 bool ShouldAssignSiteForURL(const GURL& url); | 96 bool ShouldAssignSiteForURL(const GURL& url); |
| 92 | 97 |
| 93 void CheckWebUIRendererDoesNotDisplayNormalURL( | 98 void CheckWebUIRendererDoesNotDisplayNormalURL( |
| 94 RenderFrameHostImpl* render_frame_host, | 99 RenderFrameHostImpl* render_frame_host, |
| 95 const GURL& url); | 100 const GURL& url); |
| 96 | 101 |
| 97 // The NavigationController that will keep track of session history for all | 102 // The NavigationController that will keep track of session history for all |
| 98 // RenderFrameHost objects using this NavigatorImpl. | 103 // RenderFrameHost objects using this NavigatorImpl. |
| 99 // TODO(nasko): Move ownership of the NavigationController from | 104 // TODO(nasko): Move ownership of the NavigationController from |
| 100 // WebContentsImpl to this class. | 105 // WebContentsImpl to this class. |
| 101 NavigationControllerImpl* controller_; | 106 NavigationControllerImpl* controller_; |
| 102 | 107 |
| 103 // Used to notify the object embedding this Navigator about navigation | 108 // Used to notify the object embedding this Navigator about navigation |
| 104 // events. Can be NULL in tests. | 109 // events. Can be NULL in tests. |
| 105 NavigatorDelegate* delegate_; | 110 NavigatorDelegate* delegate_; |
| 106 | 111 |
| 112 // The time the latest navigation request started, used for a few histograms |
| 113 // under the Navigation group. |
| 114 base::TimeTicks navigation_start_time_; |
| 115 |
| 116 // The URL of the navigation request to allow later matching when recording |
| 117 // histogram data. |
| 118 GURL navigation_start_url_; |
| 119 |
| 107 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 120 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
| 108 }; | 121 }; |
| 109 | 122 |
| 110 } // namespace content | 123 } // namespace content |
| 111 | 124 |
| 112 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 125 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| OLD | NEW |