blob: 769b5d227076312fbc60ee21f277bdfc1877bdaa [file] [log] [blame]
[email protected]6ea6bdf2013-12-06 13:35:011// 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.
4
5#ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
6#define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
7
8#include "base/memory/ref_counted.h"
[email protected]3691e5cf2014-01-22 10:16:209#include "content/browser/frame_host/navigation_controller_impl.h"
[email protected]6ea6bdf2013-12-06 13:35:0110#include "content/browser/frame_host/navigator.h"
11#include "content/common/content_export.h"
12
13namespace content {
14
15class NavigationControllerImpl;
16class NavigatorDelegate;
17
18// This class is an implementation of Navigator, responsible for managing
19// navigations in regular browser tabs.
20class CONTENT_EXPORT NavigatorImpl : public Navigator {
21 public:
22 NavigatorImpl(NavigationControllerImpl* navigation_controller,
23 NavigatorDelegate* delegate);
24
[email protected]52913802013-12-10 05:52:1825 // Navigator implementation.
26 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
27 int64 frame_id,
28 int64 parent_frame_id,
29 bool main_frame,
30 const GURL& url) OVERRIDE;
[email protected]3109fbb72014-01-06 23:57:1531 virtual void DidFailProvisionalLoadWithError(
32 RenderFrameHostImpl* render_frame_host,
33 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params)
34 OVERRIDE;
[email protected]66256d72014-01-10 22:41:5835 virtual void DidRedirectProvisionalLoad(
36 RenderFrameHostImpl* render_frame_host,
37 int32 page_id,
38 const GURL& source_url,
39 const GURL& target_url) OVERRIDE;
[email protected]3691e5cf2014-01-22 10:16:2040 virtual bool NavigateToEntry(
41 RenderFrameHostImpl* render_frame_host,
42 const NavigationEntryImpl& entry,
43 NavigationController::ReloadType reload_type) OVERRIDE;
44 virtual bool NavigateToPendingEntry(
45 RenderFrameHostImpl* render_frame_host,
46 NavigationController::ReloadType reload_type) OVERRIDE;
47 virtual base::TimeTicks GetCurrentLoadStart() OVERRIDE;
[email protected]52913802013-12-10 05:52:1848
[email protected]6ea6bdf2013-12-06 13:35:0149 private:
50 virtual ~NavigatorImpl() {}
51
[email protected]52913802013-12-10 05:52:1852 // The NavigationController that will keep track of session history for all
53 // RenderFrameHost objects using this NavigatorImpl.
54 // TODO(nasko): Move ownership of the NavigationController from
55 // WebContentsImpl to this class.
56 NavigationControllerImpl* controller_;
57
58 // Used to notify the object embedding this Navigator about navigation
59 // events. Can be NULL in tests.
60 NavigatorDelegate* delegate_;
61
[email protected]3691e5cf2014-01-22 10:16:2062 // System time at which the current load was started.
63 base::TimeTicks current_load_start_;
64
[email protected]6ea6bdf2013-12-06 13:35:0165 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl);
66};
67
68} // namespace content
69
70#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_