| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class NavigationEntry; | 22 class NavigationEntry; |
| 23 class SessionStorageNamespace; | 23 class SessionStorageNamespace; |
| 24 class SiteInstance; | 24 class SiteInstance; |
| 25 class TabContents; | 25 class TabContents; |
| 26 struct ViewHostMsg_FrameNavigate_Params; | 26 struct ViewHostMsg_FrameNavigate_Params; |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class BrowserContext; | 29 class BrowserContext; |
| 30 struct LoadCommittedDetails; | 30 struct LoadCommittedDetails; |
| 31 struct Referrer; |
| 31 } | 32 } |
| 32 | 33 |
| 33 // A NavigationController maintains the back-forward list for a single tab and | 34 // A NavigationController maintains the back-forward list for a single tab and |
| 34 // manages all navigation within that list. | 35 // manages all navigation within that list. |
| 35 // | 36 // |
| 36 // The NavigationController also owns all TabContents for the tab. This is to | 37 // The NavigationController also owns all TabContents for the tab. This is to |
| 37 // make sure that we have at most one TabContents instance per type. | 38 // make sure that we have at most one TabContents instance per type. |
| 38 class CONTENT_EXPORT NavigationController { | 39 class CONTENT_EXPORT NavigationController { |
| 39 public: | 40 public: |
| 40 | 41 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 170 |
| 170 // Returns the transient entry if any. Note that the returned entry is owned | 171 // Returns the transient entry if any. Note that the returned entry is owned |
| 171 // by the navigation controller and may be deleted at any time. | 172 // by the navigation controller and may be deleted at any time. |
| 172 NavigationEntry* GetTransientEntry() const; | 173 NavigationEntry* GetTransientEntry() const; |
| 173 | 174 |
| 174 // New navigations ----------------------------------------------------------- | 175 // New navigations ----------------------------------------------------------- |
| 175 | 176 |
| 176 // Loads the specified URL, specifying extra http headers to add to the | 177 // Loads the specified URL, specifying extra http headers to add to the |
| 177 // request. Extra headers are separated by \n. | 178 // request. Extra headers are separated by \n. |
| 178 void LoadURL(const GURL& url, | 179 void LoadURL(const GURL& url, |
| 179 const GURL& referrer, | 180 const content::Referrer& referrer, |
| 180 content::PageTransition type, | 181 content::PageTransition type, |
| 181 const std::string& extra_headers); | 182 const std::string& extra_headers); |
| 182 | 183 |
| 183 // Same as LoadURL, but for renderer-initiated navigations. This state is | 184 // Same as LoadURL, but for renderer-initiated navigations. This state is |
| 184 // important for tracking whether to display pending URLs. | 185 // important for tracking whether to display pending URLs. |
| 185 void LoadURLFromRenderer(const GURL& url, | 186 void LoadURLFromRenderer(const GURL& url, |
| 186 const GURL& referrer, | 187 const content::Referrer& referrer, |
| 187 content::PageTransition type, | 188 content::PageTransition type, |
| 188 const std::string& extra_headers); | 189 const std::string& extra_headers); |
| 189 | 190 |
| 190 // Loads the current page if this NavigationController was restored from | 191 // Loads the current page if this NavigationController was restored from |
| 191 // history and the current page has not loaded yet. | 192 // history and the current page has not loaded yet. |
| 192 void LoadIfNecessary(); | 193 void LoadIfNecessary(); |
| 193 | 194 |
| 194 // Renavigation -------------------------------------------------------------- | 195 // Renavigation -------------------------------------------------------------- |
| 195 | 196 |
| 196 // Navigation relative to the "current entry" | 197 // Navigation relative to the "current entry" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 void ContinuePendingReload(); | 330 void ContinuePendingReload(); |
| 330 | 331 |
| 331 // Returns true if we are navigating to the URL the tab is opened with. | 332 // Returns true if we are navigating to the URL the tab is opened with. |
| 332 bool IsInitialNavigation(); | 333 bool IsInitialNavigation(); |
| 333 | 334 |
| 334 // Creates navigation entry and translates the virtual url to a real one. | 335 // Creates navigation entry and translates the virtual url to a real one. |
| 335 // Used when navigating to a new URL using LoadURL. Extra headers are | 336 // Used when navigating to a new URL using LoadURL. Extra headers are |
| 336 // separated by \n. | 337 // separated by \n. |
| 337 static NavigationEntry* CreateNavigationEntry( | 338 static NavigationEntry* CreateNavigationEntry( |
| 338 const GURL& url, | 339 const GURL& url, |
| 339 const GURL& referrer, | 340 const content::Referrer& referrer, |
| 340 content::PageTransition transition, | 341 content::PageTransition transition, |
| 341 bool is_renderer_initiated, | 342 bool is_renderer_initiated, |
| 342 const std::string& extra_headers, | 343 const std::string& extra_headers, |
| 343 content::BrowserContext* browser_context); | 344 content::BrowserContext* browser_context); |
| 344 | 345 |
| 345 private: | 346 private: |
| 346 class RestoreHelper; | 347 class RestoreHelper; |
| 347 friend class RestoreHelper; | 348 friend class RestoreHelper; |
| 348 friend class TabContents; // For invoking OnReservedPageIDRange. | 349 friend class TabContents; // For invoking OnReservedPageIDRange. |
| 349 | 350 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 static size_t max_entry_count_; | 488 static size_t max_entry_count_; |
| 488 | 489 |
| 489 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), | 490 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), |
| 490 // NO_RELOAD otherwise. | 491 // NO_RELOAD otherwise. |
| 491 ReloadType pending_reload_; | 492 ReloadType pending_reload_; |
| 492 | 493 |
| 493 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 494 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 494 }; | 495 }; |
| 495 | 496 |
| 496 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 497 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |