blob: e537069f80df8f8354e77afbbf198649b60a95c3 [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;
[email protected]37567b432014-02-12 01:12:2217struct LoadCommittedDetails;
[email protected]6ea6bdf2013-12-06 13:35:0118
19// This class is an implementation of Navigator, responsible for managing
20// navigations in regular browser tabs.
21class CONTENT_EXPORT NavigatorImpl : public Navigator {
22 public:
23 NavigatorImpl(NavigationControllerImpl* navigation_controller,
24 NavigatorDelegate* delegate);
25
[email protected]52913802013-12-10 05:52:1826 // Navigator implementation.
27 virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
28 int64 frame_id,
29 int64 parent_frame_id,
30 bool main_frame,
31 const GURL& url) OVERRIDE;
[email protected]3109fbb72014-01-06 23:57:1532 virtual void DidFailProvisionalLoadWithError(
33 RenderFrameHostImpl* render_frame_host,
34 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params)
35 OVERRIDE;
[email protected]b80624c2014-02-09 02:46:5536 virtual void DidFailLoadWithError(
37 RenderFrameHostImpl* render_frame_host,
38 int64 frame_id,
39 const GURL& url,
40 bool is_main_frame,
41 int error_code,
42 const base::string16& error_description) OVERRIDE;
[email protected]66256d72014-01-10 22:41:5843 virtual void DidRedirectProvisionalLoad(
44 RenderFrameHostImpl* render_frame_host,
45 int32 page_id,
46 const GURL& source_url,
47 const GURL& target_url) OVERRIDE;
[email protected]37567b432014-02-12 01:12:2248 virtual void DidNavigate(
49 RenderFrameHostImpl* render_frame_host,
50 const FrameHostMsg_DidCommitProvisionalLoad_Params&
51 input_params) OVERRIDE;
[email protected]3691e5cf2014-01-22 10:16:2052 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;
[email protected]52913802013-12-10 05:52:1860
[email protected]6ea6bdf2013-12-06 13:35:0161 private:
62 virtual ~NavigatorImpl() {}
63
[email protected]37567b432014-02-12 01:12:2264 bool ShouldAssignSiteForURL(const GURL& url);
65
[email protected]52913802013-12-10 05:52:1866 // 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_;
71
72 // Used to notify the object embedding this Navigator about navigation
73 // events. Can be NULL in tests.
74 NavigatorDelegate* delegate_;
75
[email protected]3691e5cf2014-01-22 10:16:2076 // System time at which the current load was started.
77 base::TimeTicks current_load_start_;
78
[email protected]6ea6bdf2013-12-06 13:35:0179 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl);
80};
81
82} // namespace content
83
84#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_