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 namespace content { | 13 namespace content { |
14 | 14 |
15 class NavigationControllerImpl; | 15 class NavigationControllerImpl; |
16 class NavigatorDelegate; | 16 class NavigatorDelegate; |
| 17 struct LoadCommittedDetails; |
17 | 18 |
18 // This class is an implementation of Navigator, responsible for managing | 19 // This class is an implementation of Navigator, responsible for managing |
19 // navigations in regular browser tabs. | 20 // navigations in regular browser tabs. |
20 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 21 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
21 public: | 22 public: |
22 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 23 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
23 NavigatorDelegate* delegate); | 24 NavigatorDelegate* delegate); |
24 | 25 |
25 // Navigator implementation. | 26 // Navigator implementation. |
26 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, | 27 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, |
27 int64 frame_id, | 28 int64 frame_id, |
28 int64 parent_frame_id, | 29 int64 parent_frame_id, |
29 bool main_frame, | 30 bool main_frame, |
30 const GURL& url) OVERRIDE; | 31 const GURL& url) OVERRIDE; |
31 virtual void DidFailProvisionalLoadWithError( | 32 virtual void DidFailProvisionalLoadWithError( |
32 RenderFrameHostImpl* render_frame_host, | 33 RenderFrameHostImpl* render_frame_host, |
33 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) | 34 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) |
34 OVERRIDE; | 35 OVERRIDE; |
35 virtual void DidRedirectProvisionalLoad( | 36 virtual void DidRedirectProvisionalLoad( |
36 RenderFrameHostImpl* render_frame_host, | 37 RenderFrameHostImpl* render_frame_host, |
37 int32 page_id, | 38 int32 page_id, |
38 const GURL& source_url, | 39 const GURL& source_url, |
39 const GURL& target_url) OVERRIDE; | 40 const GURL& target_url) OVERRIDE; |
| 41 virtual void DidNavigate( |
| 42 RenderFrameHostImpl* render_frame_host, |
| 43 const FrameHostMsg_DidCommitProvisionalLoad_Params& |
| 44 input_params) OVERRIDE; |
40 virtual bool NavigateToEntry( | 45 virtual bool NavigateToEntry( |
41 RenderFrameHostImpl* render_frame_host, | 46 RenderFrameHostImpl* render_frame_host, |
42 const NavigationEntryImpl& entry, | 47 const NavigationEntryImpl& entry, |
43 NavigationController::ReloadType reload_type) OVERRIDE; | 48 NavigationController::ReloadType reload_type) OVERRIDE; |
44 virtual bool NavigateToPendingEntry( | 49 virtual bool NavigateToPendingEntry( |
45 RenderFrameHostImpl* render_frame_host, | 50 RenderFrameHostImpl* render_frame_host, |
46 NavigationController::ReloadType reload_type) OVERRIDE; | 51 NavigationController::ReloadType reload_type) OVERRIDE; |
47 virtual base::TimeTicks GetCurrentLoadStart() OVERRIDE; | 52 virtual base::TimeTicks GetCurrentLoadStart() OVERRIDE; |
48 | 53 |
49 private: | 54 private: |
50 virtual ~NavigatorImpl() {} | 55 virtual ~NavigatorImpl() {} |
51 | 56 |
| 57 bool ShouldAssignSiteForURL(const GURL& url); |
| 58 |
52 // The NavigationController that will keep track of session history for all | 59 // The NavigationController that will keep track of session history for all |
53 // RenderFrameHost objects using this NavigatorImpl. | 60 // RenderFrameHost objects using this NavigatorImpl. |
54 // TODO(nasko): Move ownership of the NavigationController from | 61 // TODO(nasko): Move ownership of the NavigationController from |
55 // WebContentsImpl to this class. | 62 // WebContentsImpl to this class. |
56 NavigationControllerImpl* controller_; | 63 NavigationControllerImpl* controller_; |
57 | 64 |
58 // Used to notify the object embedding this Navigator about navigation | 65 // Used to notify the object embedding this Navigator about navigation |
59 // events. Can be NULL in tests. | 66 // events. Can be NULL in tests. |
60 NavigatorDelegate* delegate_; | 67 NavigatorDelegate* delegate_; |
61 | 68 |
62 // System time at which the current load was started. | 69 // System time at which the current load was started. |
63 base::TimeTicks current_load_start_; | 70 base::TimeTicks current_load_start_; |
64 | 71 |
65 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 72 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
66 }; | 73 }; |
67 | 74 |
68 } // namespace content | 75 } // namespace content |
69 | 76 |
70 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 77 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |