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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "content/browser/frame_host/navigation_controller_impl.h"
10 #include "content/browser/frame_host/navigator.h"
11 #include "content/common/content_export.h"
15 class NavigationControllerImpl;
16 class NavigatorDelegate;
17 struct LoadCommittedDetails;
19 // This class is an implementation of Navigator, responsible for managing
20 // navigations in regular browser tabs.
21 class CONTENT_EXPORT NavigatorImpl : public Navigator {
23 NavigatorImpl(NavigationControllerImpl* navigation_controller,
24 NavigatorDelegate* delegate);
26 // Navigator implementation.
27 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
29 int64 parent_frame_id,
31 const GURL& url) OVERRIDE;
32 virtual void DidFailProvisionalLoadWithError(
33 RenderFrameHostImpl* render_frame_host,
34 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params)
36 virtual void DidFailLoadWithError(
37 RenderFrameHostImpl* render_frame_host,
42 const base::string16& error_description) OVERRIDE;
43 virtual void DidRedirectProvisionalLoad(
44 RenderFrameHostImpl* render_frame_host,
46 const GURL& source_url,
47 const GURL& target_url) OVERRIDE;
48 virtual void DidNavigate(
49 RenderFrameHostImpl* render_frame_host,
50 const FrameHostMsg_DidCommitProvisionalLoad_Params&
51 input_params) OVERRIDE;
52 virtual bool NavigateToEntry(
53 RenderFrameHostImpl* render_frame_host,
54 const NavigationEntryImpl& entry,
55 NavigationController::ReloadType reload_type) OVERRIDE;
56 virtual bool NavigateToPendingEntry(
57 RenderFrameHostImpl* render_frame_host,
58 NavigationController::ReloadType reload_type) OVERRIDE;
59 virtual base::TimeTicks GetCurrentLoadStart() OVERRIDE;
62 virtual ~NavigatorImpl() {}
64 bool ShouldAssignSiteForURL(const GURL& url);
66 // The NavigationController that will keep track of session history for all
67 // RenderFrameHost objects using this NavigatorImpl.
68 // TODO(nasko): Move ownership of the NavigationController from
69 // WebContentsImpl to this class.
70 NavigationControllerImpl* controller_;
72 // Used to notify the object embedding this Navigator about navigation
73 // events. Can be NULL in tests.
74 NavigatorDelegate* delegate_;
76 // System time at which the current load was started.
77 base::TimeTicks current_load_start_;
79 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl);
82 } // namespace content
84 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_