OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
| 6 #define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
| 7 |
| 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/page_transition_types.h" |
| 10 |
| 11 class GURL; |
| 12 |
| 13 namespace web { |
| 14 |
| 15 // A NavigationItem is a data structure that captures all the information |
| 16 // required to recreate a browsing state. It represents one point in the |
| 17 // chain of navigation managed by a NavigationManager. |
| 18 class NavigationItem { |
| 19 public: |
| 20 virtual ~NavigationItem() {} |
| 21 |
| 22 // The actual URL of the page. For some about pages, this may be a scary |
| 23 // data: URL or something like that. Use GetVirtualURL() below for showing to |
| 24 // the user. |
| 25 virtual const GURL& GetURL() const = 0; |
| 26 |
| 27 // The URL that should be shown to the user. In most cases this is the same |
| 28 // as the URL above, but in some case the underlying URL might not be |
| 29 // suitable for display to the user. |
| 30 virtual const GURL& GetVirtualURL() const = 0; |
| 31 |
| 32 // The title as set by the page. This will be empty if there is no title set. |
| 33 // The caller is responsible for detecting when there is no title and |
| 34 // displaying the appropriate "Untitled" label if this is being displayed to |
| 35 // the user. |
| 36 virtual const base::string16& GetTitle() const = 0; |
| 37 |
| 38 // The transition type indicates what the user did to move to this page from |
| 39 // the previous page. |
| 40 virtual ui::PageTransition GetTransitionType() const = 0; |
| 41 }; |
| 42 |
| 43 } // namespace web |
| 44 |
| 45 #endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
OLD | NEW |