| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Returns the transient entry if any. Note that the returned entry is owned | 169 // Returns the transient entry if any. Note that the returned entry is owned |
| 170 // by the navigation controller and may be deleted at any time. | 170 // by the navigation controller and may be deleted at any time. |
| 171 NavigationEntry* GetTransientEntry() const; | 171 NavigationEntry* GetTransientEntry() const; |
| 172 | 172 |
| 173 // New navigations ----------------------------------------------------------- | 173 // New navigations ----------------------------------------------------------- |
| 174 | 174 |
| 175 // Loads the specified URL. | 175 // Loads the specified URL. |
| 176 void LoadURL(const GURL& url, const GURL& referrer, | 176 void LoadURL(const GURL& url, const GURL& referrer, |
| 177 PageTransition::Type type); | 177 PageTransition::Type type); |
| 178 | 178 |
| 179 // Loads the specified URL, specifying extra http headers to add to the |
| 180 // request. Extra headers are separated by \n. |
| 181 void LoadURLWithHeaders(const GURL& url, |
| 182 const GURL& referrer, |
| 183 PageTransition::Type type, |
| 184 const std::string& extra_headers); |
| 185 |
| 179 // Loads the current page if this NavigationController was restored from | 186 // Loads the current page if this NavigationController was restored from |
| 180 // history and the current page has not loaded yet. | 187 // history and the current page has not loaded yet. |
| 181 void LoadIfNecessary(); | 188 void LoadIfNecessary(); |
| 182 | 189 |
| 183 // Renavigation -------------------------------------------------------------- | 190 // Renavigation -------------------------------------------------------------- |
| 184 | 191 |
| 185 // Navigation relative to the "current entry" | 192 // Navigation relative to the "current entry" |
| 186 bool CanGoBack() const; | 193 bool CanGoBack() const; |
| 187 bool CanGoForward() const; | 194 bool CanGoForward() const; |
| 188 void GoBack(); | 195 void GoBack(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 327 |
| 321 // Cancels a repost that brought up a warning. | 328 // Cancels a repost that brought up a warning. |
| 322 void CancelPendingReload(); | 329 void CancelPendingReload(); |
| 323 // Continues a repost that brought up a warning. | 330 // Continues a repost that brought up a warning. |
| 324 void ContinuePendingReload(); | 331 void ContinuePendingReload(); |
| 325 | 332 |
| 326 // Returns true if we are navigating to the URL the tab is opened with. | 333 // Returns true if we are navigating to the URL the tab is opened with. |
| 327 bool IsInitialNavigation(); | 334 bool IsInitialNavigation(); |
| 328 | 335 |
| 329 // Creates navigation entry and translates the virtual url to a real one. | 336 // Creates navigation entry and translates the virtual url to a real one. |
| 330 // Used when navigating to a new URL using LoadURL. | 337 // Used when navigating to a new URL using LoadURL. Extra headers are |
| 338 // separated by \n. |
| 331 static NavigationEntry* CreateNavigationEntry( | 339 static NavigationEntry* CreateNavigationEntry( |
| 332 const GURL& url, | 340 const GURL& url, |
| 333 const GURL& referrer, | 341 const GURL& referrer, |
| 334 PageTransition::Type transition, | 342 PageTransition::Type transition, |
| 343 const std::string& extra_headers, |
| 335 content::BrowserContext* browser_context); | 344 content::BrowserContext* browser_context); |
| 336 | 345 |
| 337 private: | 346 private: |
| 338 class RestoreHelper; | 347 class RestoreHelper; |
| 339 friend class RestoreHelper; | 348 friend class RestoreHelper; |
| 340 friend class TabContents; // For invoking OnReservedPageIDRange. | 349 friend class TabContents; // For invoking OnReservedPageIDRange. |
| 341 | 350 |
| 342 // Classifies the given renderer navigation (see the NavigationType enum). | 351 // Classifies the given renderer navigation (see the NavigationType enum). |
| 343 NavigationType::Type ClassifyNavigation( | 352 NavigationType::Type ClassifyNavigation( |
| 344 const ViewHostMsg_FrameNavigate_Params& params) const; | 353 const ViewHostMsg_FrameNavigate_Params& params) const; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 static size_t max_entry_count_; | 488 static size_t max_entry_count_; |
| 480 | 489 |
| 481 // 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), |
| 482 // NO_RELOAD otherwise. | 491 // NO_RELOAD otherwise. |
| 483 ReloadType pending_reload_; | 492 ReloadType pending_reload_; |
| 484 | 493 |
| 485 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 494 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 486 }; | 495 }; |
| 487 | 496 |
| 488 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 497 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |