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_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/memory/ref_counted.h" | |
12 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
13 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
14 #include "content/public/common/page_transition_types.h" | 16 #include "content/public/common/page_transition_types.h" |
15 | 17 |
16 class GURL; | 18 class GURL; |
17 | 19 |
18 namespace content { | 20 namespace content { |
19 | 21 |
20 class BrowserContext; | 22 class BrowserContext; |
21 class NavigationEntry; | 23 class NavigationEntry; |
22 class SessionStorageNamespace; | 24 class SessionStorageNamespace; |
23 class WebContents; | 25 class WebContents; |
24 struct Referrer; | 26 struct Referrer; |
25 | 27 |
28 // Used to store the mapping of a StoragePartion id to SessionStorageNamespace. | |
Charlie Reis
2012/08/02 23:06:47
StoragePartition
awong
2012/08/03 00:31:04
Done.
| |
29 typedef std::map<std::string, scoped_refptr<SessionStorageNamespace> > | |
30 SessionStorageNamespaceMap; | |
Charlie Reis
2012/08/02 23:06:47
Topic for discussion: would it be better for this
awong
2012/08/03 00:31:04
General rule is not to go to large lengths to avoi
| |
31 | |
26 // A NavigationController maintains the back-forward list for a WebContents and | 32 // A NavigationController maintains the back-forward list for a WebContents and |
27 // manages all navigation within that list. | 33 // manages all navigation within that list. |
28 // | 34 // |
29 // Each NavigationController belongs to one WebContents; each WebContents has | 35 // Each NavigationController belongs to one WebContents; each WebContents has |
30 // exactly one NavigationController. | 36 // exactly one NavigationController. |
31 class NavigationController { | 37 class NavigationController { |
32 public: | 38 public: |
33 enum ReloadType { | 39 enum ReloadType { |
34 NO_RELOAD, // Normal load. | 40 NO_RELOAD, // Normal load. |
35 RELOAD, // Normal (cache-validating) reload. | 41 RELOAD, // Normal (cache-validating) reload. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 226 |
221 // Removing of entries ------------------------------------------------------- | 227 // Removing of entries ------------------------------------------------------- |
222 | 228 |
223 // Removes the entry at the specified |index|. This call dicards any pending | 229 // Removes the entry at the specified |index|. This call dicards any pending |
224 // and transient entries. If the index is the last committed index, this does | 230 // and transient entries. If the index is the last committed index, this does |
225 // nothing and returns false. | 231 // nothing and returns false. |
226 virtual void RemoveEntryAtIndex(int index) = 0; | 232 virtual void RemoveEntryAtIndex(int index) = 0; |
227 | 233 |
228 // Random -------------------------------------------------------------------- | 234 // Random -------------------------------------------------------------------- |
229 | 235 |
230 // The session storage namespace that all child render views should use. | 236 // The session storage namespace that all child render views of a renderer |
Charlie Reis
2012/08/02 23:06:47
nits: all child RenderViews in the renderer proces
awong
2012/08/03 00:31:04
Done.
| |
231 virtual SessionStorageNamespace* GetSessionStorageNamespace() const = 0; | 237 // for the given renderer_id should use. |
238 virtual SessionStorageNamespace* GetSessionStorageNamespace( | |
239 int renderer_id) = 0; | |
240 | |
241 // Returns all the SessionStorageNamespace objects that this | |
242 // NavigationController knows about. | |
243 virtual const SessionStorageNamespaceMap& | |
244 GetSessionStorageNamespaceMap() const = 0; | |
232 | 245 |
233 // Sets the max restored page ID this NavigationController has seen, if it | 246 // Sets the max restored page ID this NavigationController has seen, if it |
234 // was restored from a previous session. | 247 // was restored from a previous session. |
235 virtual void SetMaxRestoredPageID(int32 max_id) = 0; | 248 virtual void SetMaxRestoredPageID(int32 max_id) = 0; |
236 | 249 |
237 // Returns the largest restored page ID seen in this navigation controller, | 250 // Returns the largest restored page ID seen in this navigation controller, |
238 // if it was restored from a previous session. (-1 otherwise) | 251 // if it was restored from a previous session. (-1 otherwise) |
239 virtual int32 GetMaxRestoredPageID() const = 0; | 252 virtual int32 GetMaxRestoredPageID() const = 0; |
240 | 253 |
241 // Returns true if a reload happens when activated (SetActive(true) is | 254 // Returns true if a reload happens when activated (SetActive(true) is |
(...skipping 28 matching lines...) Expand all Loading... | |
270 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; | 283 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; |
271 | 284 |
272 // Removes all the entries except the active entry. If there is a new pending | 285 // Removes all the entries except the active entry. If there is a new pending |
273 // navigation it is preserved. | 286 // navigation it is preserved. |
274 virtual void PruneAllButActive() = 0; | 287 virtual void PruneAllButActive() = 0; |
275 }; | 288 }; |
276 | 289 |
277 } // namespace content | 290 } // namespace content |
278 | 291 |
279 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 292 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |