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> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/browser/global_request_id.h" | 14 #include "content/public/browser/global_request_id.h" |
| 15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class BrowserContext; | 21 class BrowserContext; |
| 22 class NavigationEntry; | 22 class NavigationEntry; |
| 23 class SessionStorageNamespace; | 23 class SessionStorageNamespace; |
| 24 class WebContents; | 24 class WebContents; |
| 25 struct Referrer; | 25 struct Referrer; |
| 26 | 26 |
| 27 // A NavigationController maintains the back-forward list for a single tab and | 27 // A NavigationController maintains the back-forward list for a single tab and |
| 28 // manages all navigation within that list. | 28 // manages all navigation within that list. |
| 29 // | 29 // |
| 30 // The NavigationController also owns all WebContents for the tab. This is to | 30 // Each NavigationController belongs to one WebContents; each WebContents has |
| 31 // make sure that we have at most one WebContents instance per type. | 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, aka shift-reload. |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Creates navigation entry and translates the virtual url to a real one. | 40 // Creates navigation entry and translates the virtual url to a real one. |
| 41 // Used when navigating to a new URL using LoadURL. Extra headers are | 41 // Used when navigating to a new URL using LoadURL. Extra headers are |
| 42 // separated by \n. | 42 // separated by \n. |
| 43 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( | 43 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( |
| 44 const GURL& url, | 44 const GURL& url, |
| 45 const Referrer& referrer, | 45 const Referrer& referrer, |
| 46 PageTransition transition, | 46 PageTransition transition, |
| 47 bool is_renderer_initiated, | 47 bool is_renderer_initiated, |
| 48 const std::string& extra_headers, | 48 const std::string& extra_headers, |
| 49 BrowserContext* browser_context); | 49 BrowserContext* browser_context); |
| 50 | 50 |
| 51 // Disables checking for a repost and prompting the user. This is used during | 51 // Disables checking for a repost and prompting the user. This is used during |
| 52 // testing. | 52 // testing. |
| 53 CONTENT_EXPORT static void DisablePromptOnRepost(); | 53 CONTENT_EXPORT static void DisablePromptOnRepost(); |
| 54 | 54 |
| 55 virtual ~NavigationController() {} | 55 virtual ~NavigationController() {} |
| 56 | 56 |
| 57 // Returns the web contents associated with this controller. Non-NULL except | 57 // Returns the web contents associated with this controller. Non-NULL except |
| 58 // during set-up of the tab. | 58 // during set-up. |
|
jochen (gone - plz use gerrit)
2012/05/24 21:38:55
is this true? I thought this is just implemented a
| |
| 59 virtual WebContents* GetWebContents() const = 0; | 59 virtual WebContents* GetWebContents() const = 0; |
| 60 | 60 |
| 61 // Get/set the browser context for this controller. It can never be NULL. | 61 // Get/set the browser context for this controller. It can never be NULL. |
| 62 virtual BrowserContext* GetBrowserContext() const = 0; | 62 virtual BrowserContext* GetBrowserContext() const = 0; |
| 63 virtual void SetBrowserContext(BrowserContext* browser_context) = 0; | 63 virtual void SetBrowserContext(BrowserContext* browser_context) = 0; |
| 64 | 64 |
| 65 // Initializes this NavigationController with the given saved navigations, | 65 // Initializes this NavigationController with the given saved navigations, |
| 66 // using selected_navigation as the currently loaded entry. Before this call | 66 // using selected_navigation as the currently loaded entry. Before this call |
| 67 // the controller should be unused (there should be no current entry). If | 67 // the controller should be unused (there should be no current entry). If |
| 68 // from_last_session is true, navigations are from the previous session, | 68 // from_last_session is true, navigations are from the previous session, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; | 249 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; |
| 250 | 250 |
| 251 // Removes all the entries except the active entry. If there is a new pending | 251 // Removes all the entries except the active entry. If there is a new pending |
| 252 // navigation it is preserved. | 252 // navigation it is preserved. |
| 253 virtual void PruneAllButActive() = 0; | 253 virtual void PruneAllButActive() = 0; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 } // namespace content | 256 } // namespace content |
| 257 | 257 |
| 258 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 258 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |