Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: ios/web/public/navigation_item.h

Issue 647543002: Adds web::NavigationItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing include. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/ios_web.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/navigation_item.h
diff --git a/ios/web/public/navigation_item.h b/ios/web/public/navigation_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..59638f7ddf63183d1c30a47b56a9077f0ac6e868
--- /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_
« no previous file with comments | « ios/web/ios_web.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698