OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
6 #define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 6 #define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "ios/web/public/web_state/page_scroll_state.h" |
11 #include "ui/base/page_transition_types.h" | 12 #include "ui/base/page_transition_types.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 | 15 |
15 namespace web { | 16 namespace web { |
16 struct FaviconStatus; | 17 struct FaviconStatus; |
17 struct Referrer; | 18 struct Referrer; |
18 struct SSLStatus; | 19 struct SSLStatus; |
19 | 20 |
20 // A NavigationItem is a data structure that captures all the information | 21 // A NavigationItem is a data structure that captures all the information |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // the user. | 62 // the user. |
62 virtual void SetTitle(const base::string16& title) = 0; | 63 virtual void SetTitle(const base::string16& title) = 0; |
63 virtual const base::string16& GetTitle() const = 0; | 64 virtual const base::string16& GetTitle() const = 0; |
64 | 65 |
65 // Describes the current page that the tab represents. This is the ID that the | 66 // Describes the current page that the tab represents. This is the ID that the |
66 // renderer generated for the page and is how we can tell new versus | 67 // renderer generated for the page and is how we can tell new versus |
67 // renavigations. | 68 // renavigations. |
68 virtual void SetPageID(int page_id) = 0; | 69 virtual void SetPageID(int page_id) = 0; |
69 virtual int32 GetPageID() const = 0; | 70 virtual int32 GetPageID() const = 0; |
70 | 71 |
| 72 // Stores the NavigationItem's last recorded scroll offset and zoom scale. |
| 73 virtual void SetPageScrollState(const PageScrollState& scroll_state) = 0; |
| 74 virtual const PageScrollState& GetPageScrollState() const = 0; |
| 75 |
71 // Page-related helpers ------------------------------------------------------ | 76 // Page-related helpers ------------------------------------------------------ |
72 | 77 |
73 // Returns the title to be displayed on the tab. This could be the title of | 78 // Returns the title to be displayed on the tab. This could be the title of |
74 // the page if it is available or the URL. |languages| is the list of | 79 // the page if it is available or the URL. |languages| is the list of |
75 // accpeted languages (e.g., prefs::kAcceptLanguages) or empty if proper | 80 // accpeted languages (e.g., prefs::kAcceptLanguages) or empty if proper |
76 // URL formatting isn't needed (e.g., unit tests). | 81 // URL formatting isn't needed (e.g., unit tests). |
77 virtual const base::string16& GetTitleForDisplay( | 82 virtual const base::string16& GetTitleForDisplay( |
78 const std::string& languages) const = 0; | 83 const std::string& languages) const = 0; |
79 | 84 |
80 // Tracking stuff ------------------------------------------------------------ | 85 // Tracking stuff ------------------------------------------------------------ |
(...skipping 16 matching lines...) Expand all Loading... |
97 // page is reloaded.) | 102 // page is reloaded.) |
98 // | 103 // |
99 // If GetTimestamp() returns a null time, that means that either: | 104 // If GetTimestamp() returns a null time, that means that either: |
100 // | 105 // |
101 // - this navigation hasn't completed yet; | 106 // - this navigation hasn't completed yet; |
102 // - this navigation was restored and for some reason the | 107 // - this navigation was restored and for some reason the |
103 // timestamp wasn't available; | 108 // timestamp wasn't available; |
104 // - or this navigation was copied from a foreign session. | 109 // - or this navigation was copied from a foreign session. |
105 virtual void SetTimestamp(base::Time timestamp) = 0; | 110 virtual void SetTimestamp(base::Time timestamp) = 0; |
106 virtual base::Time GetTimestamp() const = 0; | 111 virtual base::Time GetTimestamp() const = 0; |
| 112 |
| 113 // |true| if this item contains unsafe resources and will be removed. This |
| 114 // property doesn't get serialized. |
| 115 virtual void SetUnsafe(bool is_unsafe) = 0; |
| 116 virtual bool IsUnsafe() const = 0; |
107 }; | 117 }; |
108 | 118 |
109 } // namespace web | 119 } // namespace web |
110 | 120 |
111 #endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 121 #endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
OLD | NEW |