| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Returns the transient entry if any. Note that the returned entry is owned | 160 // Returns the transient entry if any. Note that the returned entry is owned |
| 161 // by the navigation controller and may be deleted at any time. | 161 // by the navigation controller and may be deleted at any time. |
| 162 NavigationEntry* GetTransientEntry() const; | 162 NavigationEntry* GetTransientEntry() const; |
| 163 | 163 |
| 164 // New navigations ----------------------------------------------------------- | 164 // New navigations ----------------------------------------------------------- |
| 165 | 165 |
| 166 // Loads the specified URL. | 166 // Loads the specified URL. |
| 167 void LoadURL(const GURL& url, const GURL& referrer, | 167 void LoadURL(const GURL& url, const GURL& referrer, |
| 168 PageTransition::Type type); | 168 PageTransition::Type type); |
| 169 | 169 |
| 170 // Loads the specified URL, specifying extra http headers to add to the |
| 171 // request. Extra headers are separated by \n. |
| 172 void LoadURLWithHeaders(const GURL& url, |
| 173 const GURL& referrer, |
| 174 PageTransition::Type type, |
| 175 const std::string& extra_headers); |
| 176 |
| 170 // Loads the current page if this NavigationController was restored from | 177 // Loads the current page if this NavigationController was restored from |
| 171 // history and the current page has not loaded yet. | 178 // history and the current page has not loaded yet. |
| 172 void LoadIfNecessary(); | 179 void LoadIfNecessary(); |
| 173 | 180 |
| 174 // Renavigation -------------------------------------------------------------- | 181 // Renavigation -------------------------------------------------------------- |
| 175 | 182 |
| 176 // Navigation relative to the "current entry" | 183 // Navigation relative to the "current entry" |
| 177 bool CanGoBack() const; | 184 bool CanGoBack() const; |
| 178 bool CanGoForward() const; | 185 bool CanGoForward() const; |
| 179 void GoBack(); | 186 void GoBack(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 318 |
| 312 // Cancels a repost that brought up a warning. | 319 // Cancels a repost that brought up a warning. |
| 313 void CancelPendingReload(); | 320 void CancelPendingReload(); |
| 314 // Continues a repost that brought up a warning. | 321 // Continues a repost that brought up a warning. |
| 315 void ContinuePendingReload(); | 322 void ContinuePendingReload(); |
| 316 | 323 |
| 317 // Returns true if we are navigating to the URL the tab is opened with. | 324 // Returns true if we are navigating to the URL the tab is opened with. |
| 318 bool IsInitialNavigation(); | 325 bool IsInitialNavigation(); |
| 319 | 326 |
| 320 // Creates navigation entry and translates the virtual url to a real one. | 327 // Creates navigation entry and translates the virtual url to a real one. |
| 321 // Used when navigating to a new URL using LoadURL. | 328 // Used when navigating to a new URL using LoadURL. Extra headers are |
| 329 // separated by \n. |
| 322 static NavigationEntry* CreateNavigationEntry( | 330 static NavigationEntry* CreateNavigationEntry( |
| 323 const GURL& url, | 331 const GURL& url, |
| 324 const GURL& referrer, | 332 const GURL& referrer, |
| 325 PageTransition::Type transition, | 333 PageTransition::Type transition, |
| 334 const std::string& extra_headers, |
| 326 content::BrowserContext* browser_context); | 335 content::BrowserContext* browser_context); |
| 327 | 336 |
| 328 private: | 337 private: |
| 329 class RestoreHelper; | 338 class RestoreHelper; |
| 330 friend class RestoreHelper; | 339 friend class RestoreHelper; |
| 331 friend class TabContents; // For invoking OnReservedPageIDRange. | 340 friend class TabContents; // For invoking OnReservedPageIDRange. |
| 332 | 341 |
| 333 // Classifies the given renderer navigation (see the NavigationType enum). | 342 // Classifies the given renderer navigation (see the NavigationType enum). |
| 334 NavigationType::Type ClassifyNavigation( | 343 NavigationType::Type ClassifyNavigation( |
| 335 const ViewHostMsg_FrameNavigate_Params& params) const; | 344 const ViewHostMsg_FrameNavigate_Params& params) const; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 static size_t max_entry_count_; | 479 static size_t max_entry_count_; |
| 471 | 480 |
| 472 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), | 481 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), |
| 473 // NO_RELOAD otherwise. | 482 // NO_RELOAD otherwise. |
| 474 ReloadType pending_reload_; | 483 ReloadType pending_reload_; |
| 475 | 484 |
| 476 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 485 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 477 }; | 486 }; |
| 478 | 487 |
| 479 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 488 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |