| 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 <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
| 16 #include "content/public/browser/session_storage_namespace.h" |
| 16 #include "content/public/common/page_transition_types.h" | 17 #include "content/public/common/page_transition_types.h" |
| 17 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
| 18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 | 22 |
| 22 class RefCountedMemory; | 23 class RefCountedMemory; |
| 23 | 24 |
| 24 } // namespace base | 25 } // namespace base |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 | 28 |
| 28 class BrowserContext; | 29 class BrowserContext; |
| 29 class NavigationEntry; | 30 class NavigationEntry; |
| 30 class SessionStorageNamespace; | |
| 31 class WebContents; | 31 class WebContents; |
| 32 | 32 |
| 33 // Used to store the mapping of a StoragePartition id to | |
| 34 // SessionStorageNamespace. | |
| 35 typedef std::map<std::string, scoped_refptr<SessionStorageNamespace> > | |
| 36 SessionStorageNamespaceMap; | |
| 37 | |
| 38 // A NavigationController maintains the back-forward list for a WebContents and | 33 // A NavigationController maintains the back-forward list for a WebContents and |
| 39 // manages all navigation within that list. | 34 // manages all navigation within that list. |
| 40 // | 35 // |
| 41 // Each NavigationController belongs to one WebContents; each WebContents has | 36 // Each NavigationController belongs to one WebContents; each WebContents has |
| 42 // exactly one NavigationController. | 37 // exactly one NavigationController. |
| 43 class NavigationController { | 38 class NavigationController { |
| 44 public: | 39 public: |
| 45 enum ReloadType { | 40 enum ReloadType { |
| 46 NO_RELOAD, // Normal load. | 41 NO_RELOAD, // Normal load. |
| 47 RELOAD, // Normal (cache-validating) reload. | 42 RELOAD, // Normal (cache-validating) reload. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // transient entries. If the index is the last committed index or the pending | 344 // transient entries. If the index is the last committed index or the pending |
| 350 // entry, this does nothing and returns false. | 345 // entry, this does nothing and returns false. |
| 351 virtual bool RemoveEntryAtIndex(int index) = 0; | 346 virtual bool RemoveEntryAtIndex(int index) = 0; |
| 352 | 347 |
| 353 // Random -------------------------------------------------------------------- | 348 // Random -------------------------------------------------------------------- |
| 354 | 349 |
| 355 // Session storage depends on dom_storage that depends on blink::WebString, | 350 // Session storage depends on dom_storage that depends on blink::WebString, |
| 356 // which cannot be used on iOS. | 351 // which cannot be used on iOS. |
| 357 #if !defined(OS_IOS) | 352 #if !defined(OS_IOS) |
| 358 // Returns all the SessionStorageNamespace objects that this | 353 // Returns all the SessionStorageNamespace objects that this |
| 359 // NavigationController knows about. | 354 // NavigationController knows about, the map key is a StoragePartition id. |
| 360 virtual const SessionStorageNamespaceMap& | 355 virtual const SessionStorageNamespaceMap& |
| 361 GetSessionStorageNamespaceMap() const = 0; | 356 GetSessionStorageNamespaceMap() const = 0; |
| 362 | 357 |
| 363 // TODO(ajwong): Remove this once prerendering, instant, and session restore | 358 // TODO(ajwong): Remove this once prerendering, instant, and session restore |
| 364 // are migrated. | 359 // are migrated. |
| 365 virtual SessionStorageNamespace* GetDefaultSessionStorageNamespace() = 0; | 360 virtual SessionStorageNamespace* GetDefaultSessionStorageNamespace() = 0; |
| 366 #endif | 361 #endif |
| 367 | 362 |
| 368 // Sets the max restored page ID this NavigationController has seen, if it | 363 // Sets the max restored page ID this NavigationController has seen, if it |
| 369 // was restored from a previous session. | 364 // was restored from a previous session. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 441 |
| 447 private: | 442 private: |
| 448 // This interface should only be implemented inside content. | 443 // This interface should only be implemented inside content. |
| 449 friend class NavigationControllerImpl; | 444 friend class NavigationControllerImpl; |
| 450 NavigationController() {} | 445 NavigationController() {} |
| 451 }; | 446 }; |
| 452 | 447 |
| 453 } // namespace content | 448 } // namespace content |
| 454 | 449 |
| 455 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 450 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |