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

Side by Side Diff: content/public/browser/navigation_entry.h

Issue 14985014: Introduce content::PageState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to the top of page_state.h Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/public/common/page_transition_types.h" 14 #include "content/public/common/page_transition_types.h"
15 #include "content/public/common/page_type.h" 15 #include "content/public/common/page_type.h"
16 #include "content/public/common/referrer.h" 16 #include "content/public/common/referrer.h"
17 17
18 class GURL; 18 class GURL;
19 19
20 namespace content { 20 namespace content {
21 21
22 class PageState;
22 struct FaviconStatus; 23 struct FaviconStatus;
23 struct SSLStatus; 24 struct SSLStatus;
24 25
25 // A NavigationEntry is a data structure that captures all the information 26 // A NavigationEntry is a data structure that captures all the information
26 // required to recreate a browsing state. This includes some opaque binary 27 // required to recreate a browsing state. This includes some opaque binary
27 // state as provided by the WebContentsImpl as well as some clear text title and 28 // state as provided by the WebContentsImpl as well as some clear text title and
28 // URL which is used for our user interface. 29 // URL which is used for our user interface.
29 class NavigationEntry { 30 class NavigationEntry {
30 public: 31 public:
31 virtual ~NavigationEntry() {} 32 virtual ~NavigationEntry() {}
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 virtual void SetVirtualURL(const GURL& url) = 0; 69 virtual void SetVirtualURL(const GURL& url) = 0;
69 virtual const GURL& GetVirtualURL() const = 0; 70 virtual const GURL& GetVirtualURL() const = 0;
70 71
71 // 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.
72 // 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
73 // displaying the appropriate "Untitled" label if this is being displayed to 74 // displaying the appropriate "Untitled" label if this is being displayed to
74 // the user. 75 // the user.
75 virtual void SetTitle(const string16& title) = 0; 76 virtual void SetTitle(const string16& title) = 0;
76 virtual const string16& GetTitle() const = 0; 77 virtual const string16& GetTitle() const = 0;
77 78
79 // XXX
78 // Content state is an opaque blob created by WebKit that represents the 80 // Content state is an opaque blob created by WebKit that represents the
79 // state of the page. This includes form entries and scroll position for each 81 // state of the page. This includes form entries and scroll position for each
80 // frame. We store it so that we can supply it back to WebKit to restore form 82 // frame. We store it so that we can supply it back to WebKit to restore form
81 // state properly when the user goes back and forward. 83 // state properly when the user goes back and forward.
82 // 84 //
83 // WARNING: This state is saved to the file and used to restore previous 85 // WARNING: This state is saved to the file and used to restore previous
84 // states. If the format is modified in the future, we should still be able to 86 // states. If the format is modified in the future, we should still be able to
85 // deal with older versions. 87 // deal with older versions.
86 virtual void SetContentState(const std::string& state) = 0; 88 virtual void SetPageState(const PageState& state) = 0;
87 virtual const std::string& GetContentState() const = 0; 89 virtual const PageState& GetPageState() const = 0;
88 90
89 // Describes the current page that the tab represents. This is the ID that the 91 // Describes the current page that the tab represents. This is the ID that the
90 // renderer generated for the page and is how we can tell new versus 92 // renderer generated for the page and is how we can tell new versus
91 // renavigations. 93 // renavigations.
92 virtual void SetPageID(int page_id) = 0; 94 virtual void SetPageID(int page_id) = 0;
93 virtual int32 GetPageID() const = 0; 95 virtual int32 GetPageID() const = 0;
94 96
95 // Page-related helpers ------------------------------------------------------ 97 // Page-related helpers ------------------------------------------------------
96 98
97 // Returns the title to be displayed on the tab. This could be the title of 99 // Returns the title to be displayed on the tab. This could be the title of
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 virtual void SetExtraData(const std::string& key, const string16& data) = 0; 196 virtual void SetExtraData(const std::string& key, const string16& data) = 0;
195 // If present, fills the |data| present at the specified |key|. 197 // If present, fills the |data| present at the specified |key|.
196 virtual bool GetExtraData(const std::string& key, string16* data) const = 0; 198 virtual bool GetExtraData(const std::string& key, string16* data) const = 0;
197 // Removes the data at the specified |key|. 199 // Removes the data at the specified |key|.
198 virtual void ClearExtraData(const std::string& key) = 0; 200 virtual void ClearExtraData(const std::string& key) = 0;
199 }; 201 };
200 202
201 } // namespace content 203 } // namespace content
202 204
203 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_ 205 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698