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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // The actual URL of the page. For some about pages, this may be a scary | 48 // The actual URL of the page. For some about pages, this may be a scary |
49 // data: URL or something like that. Use GetVirtualURL() below for showing to | 49 // data: URL or something like that. Use GetVirtualURL() below for showing to |
50 // the user. | 50 // the user. |
51 virtual void SetURL(const GURL& url) = 0; | 51 virtual void SetURL(const GURL& url) = 0; |
52 virtual const GURL& GetURL() const = 0; | 52 virtual const GURL& GetURL() const = 0; |
53 | 53 |
54 // Used for specifying a base URL for pages loaded via data URLs. | 54 // Used for specifying a base URL for pages loaded via data URLs. |
55 virtual void SetBaseURLForDataURL(const GURL& url) = 0; | 55 virtual void SetBaseURLForDataURL(const GURL& url) = 0; |
56 virtual const GURL& GetBaseURLForDataURL() const = 0; | 56 virtual const GURL& GetBaseURLForDataURL() const = 0; |
57 | 57 |
| 58 // Used for supplying the payload data of a data URL. Only used if |
| 59 // SetBaseURLForDataURL() is also called. |
| 60 virtual void SetDataForDataURL(base::RefCountedMemory* data) = 0; |
| 61 virtual base::RefCountedMemory* GetDataForDataURL() const = 0; |
| 62 |
58 // The referring URL. Can be empty. | 63 // The referring URL. Can be empty. |
59 virtual void SetReferrer(const content::Referrer& referrer) = 0; | 64 virtual void SetReferrer(const content::Referrer& referrer) = 0; |
60 virtual const content::Referrer& GetReferrer() const = 0; | 65 virtual const content::Referrer& GetReferrer() const = 0; |
61 | 66 |
62 // The virtual URL, when nonempty, will override the actual URL of the page | 67 // The virtual URL, when nonempty, will override the actual URL of the page |
63 // when we display it to the user. This allows us to have nice and friendly | 68 // when we display it to the user. This allows us to have nice and friendly |
64 // URLs that the user sees for things like about: URLs, but actually feed | 69 // URLs that the user sees for things like about: URLs, but actually feed |
65 // the renderer a data URL that results in the content loading. | 70 // the renderer a data URL that results in the content loading. |
66 // | 71 // |
67 // GetVirtualURL() will return the URL to display to the user in all cases, so | 72 // 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. | 73 // if there is no overridden display URL, it will return the actual one. |
69 virtual void SetVirtualURL(const GURL& url) = 0; | 74 virtual void SetVirtualURL(const GURL& url) = 0; |
70 virtual const GURL& GetVirtualURL() const = 0; | 75 virtual const GURL& GetVirtualURL() const = 0; |
71 | 76 |
72 // The title as set by the page. This will be empty if there is no title set. | 77 // 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 | 78 // The caller is responsible for detecting when there is no title and |
74 // displaying the appropriate "Untitled" label if this is being displayed to | 79 // displaying the appropriate "Untitled" label if this is being displayed to |
75 // the user. | 80 // the user. |
76 virtual void SetTitle(const string16& title) = 0; | 81 virtual void SetTitle(const string16& title) = 0; |
77 virtual const string16& GetTitle() const = 0; | 82 virtual const string16& GetTitle() const = 0; |
78 | 83 |
79 // XXX | |
80 // Content state is an opaque blob created by WebKit that represents the | 84 // Content state is an opaque blob created by WebKit that represents the |
81 // state of the page. This includes form entries and scroll position for each | 85 // state of the page. This includes form entries and scroll position for each |
82 // frame. We store it so that we can supply it back to WebKit to restore form | 86 // frame. We store it so that we can supply it back to WebKit to restore form |
83 // state properly when the user goes back and forward. | 87 // state properly when the user goes back and forward. |
84 // | 88 // |
85 // WARNING: This state is saved to the file and used to restore previous | 89 // WARNING: This state is saved to the file and used to restore previous |
86 // states. If the format is modified in the future, we should still be able to | 90 // states. If the format is modified in the future, we should still be able to |
87 // deal with older versions. | 91 // deal with older versions. |
88 virtual void SetPageState(const PageState& state) = 0; | 92 virtual void SetPageState(const PageState& state) = 0; |
89 virtual const PageState& GetPageState() const = 0; | 93 virtual const PageState& GetPageState() const = 0; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // - a response wasn't received; | 210 // - a response wasn't received; |
207 // - or this navigation was restored and for some reason the | 211 // - or this navigation was restored and for some reason the |
208 // status code wasn't available. | 212 // status code wasn't available. |
209 virtual void SetHttpStatusCode(int http_status_code) = 0; | 213 virtual void SetHttpStatusCode(int http_status_code) = 0; |
210 virtual int GetHttpStatusCode() const = 0; | 214 virtual int GetHttpStatusCode() const = 0; |
211 }; | 215 }; |
212 | 216 |
213 } // namespace content | 217 } // namespace content |
214 | 218 |
215 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ | 219 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ |
OLD | NEW |