summaryrefslogtreecommitdiffstats
path: root/content/browser/frame_host/navigator.h
diff options
context:
space:
mode:
authornasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-09 01:35:44 +0000
committernasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-09 01:35:44 +0000
commit190b8c5d848077c5a3402eb04f835e5fb1a44ecc (patch)
treea5dc598bbaedcb793530ef28f35f35bbea7a9c97 /content/browser/frame_host/navigator.h
parent9d64cb3cb87eee2483eab03fe45a01fe04139f38 (diff)
downloadchromium_src-190b8c5d848077c5a3402eb04f835e5fb1a44ecc.zip
chromium_src-190b8c5d848077c5a3402eb04f835e5fb1a44ecc.tar.gz
chromium_src-190b8c5d848077c5a3402eb04f835e5fb1a44ecc.tar.bz2
Add Navigator and NavigatorDelegate objects.
BUG=304341 Review URL: https://codereview.chromium.org/65363002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/frame_host/navigator.h')
-rw-r--r--content/browser/frame_host/navigator.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/content/browser/frame_host/navigator.h b/content/browser/frame_host/navigator.h
new file mode 100644
index 0000000..c20c9dd
--- /dev/null
+++ b/content/browser/frame_host/navigator.h
@@ -0,0 +1,53 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_
+#define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_
+
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class NavigationControllerImpl;
+class NavigatorDelegate;
+
+// This class is responsible for performing navigations in a node of the
+// FrameTree. Its lifetime is bound to all FrameTreeNode objects that are
+// using it and will be released once all nodes that use it are freed.
+// The Navigator is bound to a single frame tree and cannot be used by multiple
+// instances of FrameTree.
+// TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad
+// from WebContentsImpl to this class.
+class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> {
+ public:
+ Navigator(NavigationControllerImpl* nav_controller,
+ NavigatorDelegate* delegate);
+
+ NavigationControllerImpl* controller() {
+ return controller_;
+ }
+
+ NavigatorDelegate* delegate() {
+ return delegate_;
+ }
+
+ private:
+ friend class base::RefCounted<Navigator>;
+ virtual ~Navigator() {}
+
+ // The NavigationController that will keep track of session history for all
+ // RenderFrameHost objects using this Navigator.
+ // TODO(nasko): Move ownership of the NavigationController from
+ // WebContentsImpl to this class.
+ NavigationControllerImpl* controller_;
+
+ // Used to notify the object embedding this Navigator about navigation
+ // events. Can be NULL in tests.
+ NavigatorDelegate* delegate_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_