Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 struct Referrer; | 25 struct Referrer; |
| 26 | 26 |
| 27 // A NavigationController maintains the back-forward list for a WebContents and | 27 // A NavigationController maintains the back-forward list for a WebContents and |
| 28 // manages all navigation within that list. | 28 // manages all navigation within that list. |
| 29 // | 29 // |
| 30 // Each NavigationController belongs to one WebContents; each WebContents has | 30 // Each NavigationController belongs to one WebContents; each WebContents has |
| 31 // exactly one NavigationController. | 31 // exactly one NavigationController. |
| 32 class NavigationController { | 32 class NavigationController { |
| 33 public: | 33 public: |
| 34 enum ReloadType { | 34 enum ReloadType { |
| 35 NO_RELOAD, // Normal load. | 35 NO_RELOAD, // Normal load. |
| 36 RELOAD, // Normal (cache-validating) reload. | 36 RELOAD, // Normal (cache-validating) reload. |
| 37 RELOAD_IGNORING_CACHE // Reload bypassing the cache, aka shift-reload. | 37 RELOAD_IGNORING_CACHE, // Reload bypassing the cache (shift-reload). |
| 38 RELOAD_ORIGINAL_REQUEST_URL // Reload using the original request URL. | |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 // Creates a navigation entry and translates the virtual url to a real one. | 41 // Creates a navigation entry and translates the virtual url to a real one. |
| 41 // This is a general call; prefer LoadURL[FromRenderer]/TransferURL below. | 42 // This is a general call; prefer LoadURL[FromRenderer]/TransferURL below. |
| 42 // Extra headers are separated by \n. | 43 // Extra headers are separated by \n. |
| 43 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( | 44 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( |
| 44 const GURL& url, | 45 const GURL& url, |
| 45 const Referrer& referrer, | 46 const Referrer& referrer, |
| 46 PageTransition transition, | 47 PageTransition transition, |
| 47 bool is_renderer_initiated, | 48 bool is_renderer_initiated, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 virtual void GoToOffset(int offset) = 0; | 213 virtual void GoToOffset(int offset) = 0; |
| 213 | 214 |
| 214 // Reloads the current entry. If |check_for_repost| is true and the current | 215 // Reloads the current entry. If |check_for_repost| is true and the current |
| 215 // entry has POST data the user is prompted to see if they really want to | 216 // entry has POST data the user is prompted to see if they really want to |
| 216 // reload the page. In nearly all cases pass in true. | 217 // reload the page. In nearly all cases pass in true. |
| 217 virtual void Reload(bool check_for_repost) = 0; | 218 virtual void Reload(bool check_for_repost) = 0; |
| 218 | 219 |
| 219 // Like Reload(), but don't use caches (aka "shift-reload"). | 220 // Like Reload(), but don't use caches (aka "shift-reload"). |
| 220 virtual void ReloadIgnoringCache(bool check_for_repost) = 0; | 221 virtual void ReloadIgnoringCache(bool check_for_repost) = 0; |
| 221 | 222 |
| 223 // Reloads the current entry using the original URL used to create it. This | |
| 224 // is used for cases where the user wants to refresh a page using a different | |
| 225 // user agent after following a redirect. | |
| 226 virtual void ReloadOriginalRequestURL() = 0; | |
|
jam
2012/06/29 21:46:17
is this being called from code that's outside of c
gone
2012/06/29 21:59:10
It hasn't been upstreamed, yet; the only place it'
jam
2012/06/29 22:58:58
ok, in that case, it should be on the impl only (s
gone
2012/07/03 00:07:47
Moved it over to the Impl.
| |
| 227 | |
| 222 // Removing of entries ------------------------------------------------------- | 228 // Removing of entries ------------------------------------------------------- |
| 223 | 229 |
| 224 // 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 |
| 225 // 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 |
| 226 // nothing and returns false. | 232 // nothing and returns false. |
| 227 virtual void RemoveEntryAtIndex(int index) = 0; | 233 virtual void RemoveEntryAtIndex(int index) = 0; |
| 228 | 234 |
| 229 // Random -------------------------------------------------------------------- | 235 // Random -------------------------------------------------------------------- |
| 230 | 236 |
| 231 // The session storage namespace that all child render views should use. | 237 // The session storage namespace that all child render views should use. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; | 277 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; |
| 272 | 278 |
| 273 // Removes all the entries except the active entry. If there is a new pending | 279 // Removes all the entries except the active entry. If there is a new pending |
| 274 // navigation it is preserved. | 280 // navigation it is preserved. |
| 275 virtual void PruneAllButActive() = 0; | 281 virtual void PruneAllButActive() = 0; |
| 276 }; | 282 }; |
| 277 | 283 |
| 278 } // namespace content | 284 } // namespace content |
| 279 | 285 |
| 280 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 286 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |