OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // | 66 // |
67 // GetVirtualURL() will return the URL to display to the user in all cases, so | 67 // GetVirtualURL() will return the URL to display to the user in all cases, so |
68 // if there is no overridden display URL, it will return the actual one. | 68 // if there is no overridden display URL, it will return the actual one. |
69 virtual void SetVirtualURL(const GURL& url) = 0; | 69 virtual void SetVirtualURL(const GURL& url) = 0; |
70 virtual const GURL& GetVirtualURL() const = 0; | 70 virtual const GURL& GetVirtualURL() const = 0; |
71 | 71 |
72 // The title as set by the page. This will be empty if there is no title set. | 72 // The title as set by the page. This will be empty if there is no title set. |
73 // The caller is responsible for detecting when there is no title and | 73 // The caller is responsible for detecting when there is no title and |
74 // displaying the appropriate "Untitled" label if this is being displayed to | 74 // displaying the appropriate "Untitled" label if this is being displayed to |
75 // the user. | 75 // the user. |
76 virtual void SetTitle(const string16& title) = 0; | 76 virtual void SetTitle(const base::string16& title) = 0; |
77 virtual const string16& GetTitle() const = 0; | 77 virtual const base::string16& GetTitle() const = 0; |
78 | 78 |
79 // Page state is an opaque blob created by Blink that represents the state of | 79 // Page state is an opaque blob created by Blink that represents the state of |
80 // the page. This includes form entries and scroll position for each frame. | 80 // the page. This includes form entries and scroll position for each frame. |
81 // We store it so that we can supply it back to Blink to restore form state | 81 // We store it so that we can supply it back to Blink to restore form state |
82 // properly when the user goes back and forward. | 82 // properly when the user goes back and forward. |
83 // | 83 // |
84 // NOTE: This state is saved to disk and used to restore previous states. If | 84 // NOTE: This state is saved to disk and used to restore previous states. If |
85 // the format is modified in the future, we should still be able to deal with | 85 // the format is modified in the future, we should still be able to deal with |
86 // older versions. | 86 // older versions. |
87 virtual void SetPageState(const PageState& state) = 0; | 87 virtual void SetPageState(const PageState& state) = 0; |
88 virtual const PageState& GetPageState() const = 0; | 88 virtual const PageState& GetPageState() const = 0; |
89 | 89 |
90 // Describes the current page that the tab represents. This is the ID that the | 90 // Describes the current page that the tab represents. This is the ID that the |
91 // renderer generated for the page and is how we can tell new versus | 91 // renderer generated for the page and is how we can tell new versus |
92 // renavigations. | 92 // renavigations. |
93 virtual void SetPageID(int page_id) = 0; | 93 virtual void SetPageID(int page_id) = 0; |
94 virtual int32 GetPageID() const = 0; | 94 virtual int32 GetPageID() const = 0; |
95 | 95 |
96 // Page-related helpers ------------------------------------------------------ | 96 // Page-related helpers ------------------------------------------------------ |
97 | 97 |
98 // Returns the title to be displayed on the tab. This could be the title of | 98 // Returns the title to be displayed on the tab. This could be the title of |
99 // the page if it is available or the URL. |languages| is the list of | 99 // the page if it is available or the URL. |languages| is the list of |
100 // accpeted languages (e.g., prefs::kAcceptLanguages) or empty if proper | 100 // accpeted languages (e.g., prefs::kAcceptLanguages) or empty if proper |
101 // URL formatting isn't needed (e.g., unit tests). | 101 // URL formatting isn't needed (e.g., unit tests). |
102 virtual const string16& GetTitleForDisplay( | 102 virtual const base::string16& GetTitleForDisplay( |
103 const std::string& languages) const = 0; | 103 const std::string& languages) const = 0; |
104 | 104 |
105 // Returns true if the current tab is in view source mode. This will be false | 105 // Returns true if the current tab is in view source mode. This will be false |
106 // if there is no navigation. | 106 // if there is no navigation. |
107 virtual bool IsViewSourceMode() const = 0; | 107 virtual bool IsViewSourceMode() const = 0; |
108 | 108 |
109 // Tracking stuff ------------------------------------------------------------ | 109 // Tracking stuff ------------------------------------------------------------ |
110 | 110 |
111 // The transition type indicates what the user did to move to this page from | 111 // The transition type indicates what the user did to move to this page from |
112 // the previous page. | 112 // the previous page. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 virtual bool GetCanLoadLocalResources() const = 0; | 185 virtual bool GetCanLoadLocalResources() const = 0; |
186 | 186 |
187 // Used to specify which frame to navigate. If empty, the main frame is | 187 // Used to specify which frame to navigate. If empty, the main frame is |
188 // navigated. This is currently not persisted in session restore, because it | 188 // navigated. This is currently not persisted in session restore, because it |
189 // is currently only used in tests. | 189 // is currently only used in tests. |
190 virtual void SetFrameToNavigate(const std::string& frame_name) = 0; | 190 virtual void SetFrameToNavigate(const std::string& frame_name) = 0; |
191 virtual const std::string& GetFrameToNavigate() const = 0; | 191 virtual const std::string& GetFrameToNavigate() const = 0; |
192 | 192 |
193 // Set extra data on this NavigationEntry according to the specified |key|. | 193 // Set extra data on this NavigationEntry according to the specified |key|. |
194 // This data is not persisted by default. | 194 // This data is not persisted by default. |
195 virtual void SetExtraData(const std::string& key, const string16& data) = 0; | 195 virtual void SetExtraData(const std::string& key, |
| 196 const base::string16& data) = 0; |
196 // If present, fills the |data| present at the specified |key|. | 197 // If present, fills the |data| present at the specified |key|. |
197 virtual bool GetExtraData(const std::string& key, string16* data) const = 0; | 198 virtual bool GetExtraData(const std::string& key, |
| 199 base::string16* data) const = 0; |
198 // Removes the data at the specified |key|. | 200 // Removes the data at the specified |key|. |
199 virtual void ClearExtraData(const std::string& key) = 0; | 201 virtual void ClearExtraData(const std::string& key) = 0; |
200 | 202 |
201 // The status code of the last known successful navigation. If | 203 // The status code of the last known successful navigation. If |
202 // GetHttpStatusCode() returns 0 that means that either: | 204 // GetHttpStatusCode() returns 0 that means that either: |
203 // | 205 // |
204 // - this navigation hasn't completed yet; | 206 // - this navigation hasn't completed yet; |
205 // - a response wasn't received; | 207 // - a response wasn't received; |
206 // - or this navigation was restored and for some reason the | 208 // - or this navigation was restored and for some reason the |
207 // status code wasn't available. | 209 // status code wasn't available. |
208 virtual void SetHttpStatusCode(int http_status_code) = 0; | 210 virtual void SetHttpStatusCode(int http_status_code) = 0; |
209 virtual int GetHttpStatusCode() const = 0; | 211 virtual int GetHttpStatusCode() const = 0; |
210 }; | 212 }; |
211 | 213 |
212 } // namespace content | 214 } // namespace content |
213 | 215 |
214 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ | 216 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ |
OLD | NEW |