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 StoragePartition id to |
| 29 // SessionStorageNamespace. |
| 30 typedef std::map<std::string, scoped_refptr<SessionStorageNamespace> > |
| 31 SessionStorageNamespaceMap; |
| 32 |
26 // A NavigationController maintains the back-forward list for a WebContents and | 33 // A NavigationController maintains the back-forward list for a WebContents and |
27 // manages all navigation within that list. | 34 // manages all navigation within that list. |
28 // | 35 // |
29 // Each NavigationController belongs to one WebContents; each WebContents has | 36 // Each NavigationController belongs to one WebContents; each WebContents has |
30 // exactly one NavigationController. | 37 // exactly one NavigationController. |
31 class NavigationController { | 38 class NavigationController { |
32 public: | 39 public: |
33 enum ReloadType { | 40 enum ReloadType { |
34 NO_RELOAD, // Normal load. | 41 NO_RELOAD, // Normal load. |
35 RELOAD, // Normal (cache-validating) reload. | 42 RELOAD, // Normal (cache-validating) reload. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 227 |
221 // Removing of entries ------------------------------------------------------- | 228 // Removing of entries ------------------------------------------------------- |
222 | 229 |
223 // Removes the entry at the specified |index|. This call dicards any pending | 230 // 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 | 231 // and transient entries. If the index is the last committed index, this does |
225 // nothing and returns false. | 232 // nothing and returns false. |
226 virtual void RemoveEntryAtIndex(int index) = 0; | 233 virtual void RemoveEntryAtIndex(int index) = 0; |
227 | 234 |
228 // Random -------------------------------------------------------------------- | 235 // Random -------------------------------------------------------------------- |
229 | 236 |
230 // The session storage namespace that all child render views should use. | 237 // Returns all the SessionStorageNamespace objects that this |
231 virtual SessionStorageNamespace* GetSessionStorageNamespace() const = 0; | 238 // NavigationController knows about. |
| 239 virtual const SessionStorageNamespaceMap& |
| 240 GetSessionStorageNamespaceMap() const = 0; |
232 | 241 |
233 // Sets the max restored page ID this NavigationController has seen, if it | 242 // Sets the max restored page ID this NavigationController has seen, if it |
234 // was restored from a previous session. | 243 // was restored from a previous session. |
235 virtual void SetMaxRestoredPageID(int32 max_id) = 0; | 244 virtual void SetMaxRestoredPageID(int32 max_id) = 0; |
236 | 245 |
237 // Returns the largest restored page ID seen in this navigation controller, | 246 // Returns the largest restored page ID seen in this navigation controller, |
238 // if it was restored from a previous session. (-1 otherwise) | 247 // if it was restored from a previous session. (-1 otherwise) |
239 virtual int32 GetMaxRestoredPageID() const = 0; | 248 virtual int32 GetMaxRestoredPageID() const = 0; |
240 | 249 |
241 // Returns true if a reload happens when activated (SetActive(true) is | 250 // 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; | 279 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; |
271 | 280 |
272 // Removes all the entries except the active entry. If there is a new pending | 281 // Removes all the entries except the active entry. If there is a new pending |
273 // navigation it is preserved. | 282 // navigation it is preserved. |
274 virtual void PruneAllButActive() = 0; | 283 virtual void PruneAllButActive() = 0; |
275 }; | 284 }; |
276 | 285 |
277 } // namespace content | 286 } // namespace content |
278 | 287 |
279 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 288 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |