| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 // New navigations ----------------------------------------------------------- | 174 // New navigations ----------------------------------------------------------- |
| 175 | 175 |
| 176 // Loads the specified URL, specifying extra http headers to add to the | 176 // Loads the specified URL, specifying extra http headers to add to the |
| 177 // request. Extra headers are separated by \n. | 177 // request. Extra headers are separated by \n. |
| 178 void LoadURL(const GURL& url, | 178 void LoadURL(const GURL& url, |
| 179 const GURL& referrer, | 179 const GURL& referrer, |
| 180 content::PageTransition type, | 180 content::PageTransition type, |
| 181 const std::string& extra_headers); | 181 const std::string& extra_headers); |
| 182 | 182 |
| 183 // Same as LoadURL, but for renderer-initiated navigations. This state is |
| 184 // important for tracking whether to display pending URLs. |
| 185 void LoadURLFromRenderer(const GURL& url, |
| 186 const GURL& referrer, |
| 187 content::PageTransition type, |
| 188 const std::string& extra_headers); |
| 189 |
| 183 // Loads the current page if this NavigationController was restored from | 190 // Loads the current page if this NavigationController was restored from |
| 184 // history and the current page has not loaded yet. | 191 // history and the current page has not loaded yet. |
| 185 void LoadIfNecessary(); | 192 void LoadIfNecessary(); |
| 186 | 193 |
| 187 // Renavigation -------------------------------------------------------------- | 194 // Renavigation -------------------------------------------------------------- |
| 188 | 195 |
| 189 // Navigation relative to the "current entry" | 196 // Navigation relative to the "current entry" |
| 190 bool CanGoBack() const; | 197 bool CanGoBack() const; |
| 191 bool CanGoForward() const; | 198 bool CanGoForward() const; |
| 192 void GoBack(); | 199 void GoBack(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // Returns true if we are navigating to the URL the tab is opened with. | 331 // Returns true if we are navigating to the URL the tab is opened with. |
| 325 bool IsInitialNavigation(); | 332 bool IsInitialNavigation(); |
| 326 | 333 |
| 327 // Creates navigation entry and translates the virtual url to a real one. | 334 // Creates navigation entry and translates the virtual url to a real one. |
| 328 // Used when navigating to a new URL using LoadURL. Extra headers are | 335 // Used when navigating to a new URL using LoadURL. Extra headers are |
| 329 // separated by \n. | 336 // separated by \n. |
| 330 static NavigationEntry* CreateNavigationEntry( | 337 static NavigationEntry* CreateNavigationEntry( |
| 331 const GURL& url, | 338 const GURL& url, |
| 332 const GURL& referrer, | 339 const GURL& referrer, |
| 333 content::PageTransition transition, | 340 content::PageTransition transition, |
| 341 bool is_renderer_initiated, |
| 334 const std::string& extra_headers, | 342 const std::string& extra_headers, |
| 335 content::BrowserContext* browser_context); | 343 content::BrowserContext* browser_context); |
| 336 | 344 |
| 337 private: | 345 private: |
| 338 class RestoreHelper; | 346 class RestoreHelper; |
| 339 friend class RestoreHelper; | 347 friend class RestoreHelper; |
| 340 friend class TabContents; // For invoking OnReservedPageIDRange. | 348 friend class TabContents; // For invoking OnReservedPageIDRange. |
| 341 | 349 |
| 342 // Classifies the given renderer navigation (see the NavigationType enum). | 350 // Classifies the given renderer navigation (see the NavigationType enum). |
| 343 NavigationType::Type ClassifyNavigation( | 351 NavigationType::Type ClassifyNavigation( |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 static size_t max_entry_count_; | 487 static size_t max_entry_count_; |
| 480 | 488 |
| 481 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), | 489 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), |
| 482 // NO_RELOAD otherwise. | 490 // NO_RELOAD otherwise. |
| 483 ReloadType pending_reload_; | 491 ReloadType pending_reload_; |
| 484 | 492 |
| 485 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 493 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 486 }; | 494 }; |
| 487 | 495 |
| 488 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 496 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |