summaryrefslogtreecommitdiffstats
path: root/ios
diff options
context:
space:
mode:
authorrohitrao <rohitrao@chromium.org>2014-10-10 04:48:28 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-10 11:48:54 +0000
commitcce127badb2d4150e8458921e393721c80b23981 (patch)
tree686714ea410fd5ceca142cbbe971bf2e67949e3b /ios
parentd993d06a69153686d5a99c07d7825c5557a7ffd0 (diff)
downloadchromium_src-cce127badb2d4150e8458921e393721c80b23981.zip
chromium_src-cce127badb2d4150e8458921e393721c80b23981.tar.gz
chromium_src-cce127badb2d4150e8458921e393721c80b23981.tar.bz2
Adds web::NavigationItem.
This is the web/ analogue of content's NavigationEntry, intended for use on iOS because iOS cannot depend on content. NavigationItem captures all the data required to recreate a browsing state, such as URL, title, and transition type. BUG=422033 TEST=None Review URL: https://codereview.chromium.org/647543002 Cr-Commit-Position: refs/heads/master@{#299093}
Diffstat (limited to 'ios')
-rw-r--r--ios/web/DEPS3
-rw-r--r--ios/web/ios_web.gyp1
-rw-r--r--ios/web/public/navigation_item.h45
3 files changed, 49 insertions, 0 deletions
diff --git a/ios/web/DEPS b/ios/web/DEPS
new file mode 100644
index 0000000..3cbaa8f
--- /dev/null
+++ b/ios/web/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+ui",
+]
diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp
index df20bcc..a7df3d8 100644
--- a/ios/web/ios_web.gyp
+++ b/ios/web/ios_web.gyp
@@ -17,6 +17,7 @@
'../../base/base.gyp:base',
],
'sources': [
+ 'public/navigation_item.h',
'public/user_agent.h',
'public/user_agent.mm',
],
diff --git a/ios/web/public/navigation_item.h b/ios/web/public/navigation_item.h
new file mode 100644
index 0000000..59638f7d
--- /dev/null
+++ b/ios/web/public/navigation_item.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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 IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_
+#define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_
+
+#include "base/strings/string16.h"
+#include "ui/base/page_transition_types.h"
+
+class GURL;
+
+namespace web {
+
+// A NavigationItem is a data structure that captures all the information
+// required to recreate a browsing state. It represents one point in the
+// chain of navigation managed by a NavigationManager.
+class NavigationItem {
+ public:
+ virtual ~NavigationItem() {}
+
+ // The actual URL of the page. For some about pages, this may be a scary
+ // data: URL or something like that. Use GetVirtualURL() below for showing to
+ // the user.
+ virtual const GURL& GetURL() const = 0;
+
+ // The URL that should be shown to the user. In most cases this is the same
+ // as the URL above, but in some case the underlying URL might not be
+ // suitable for display to the user.
+ virtual const GURL& GetVirtualURL() const = 0;
+
+ // The title as set by the page. This will be empty if there is no title set.
+ // The caller is responsible for detecting when there is no title and
+ // displaying the appropriate "Untitled" label if this is being displayed to
+ // the user.
+ virtual const base::string16& GetTitle() const = 0;
+
+ // The transition type indicates what the user did to move to this page from
+ // the previous page.
+ virtual ui::PageTransition GetTransitionType() const = 0;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_