| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/linked_ptr.h" | 10 #include "base/linked_ptr.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // Note that adding a transient entry does not change the active contents. | 249 // Note that adding a transient entry does not change the active contents. |
| 250 void AddTransientEntry(NavigationEntry* entry); | 250 void AddTransientEntry(NavigationEntry* entry); |
| 251 | 251 |
| 252 // Returns the transient entry if any. Note that the returned entry is owned | 252 // Returns the transient entry if any. Note that the returned entry is owned |
| 253 // by the navigation controller and may be deleted at any time. | 253 // by the navigation controller and may be deleted at any time. |
| 254 NavigationEntry* GetTransientEntry() const; | 254 NavigationEntry* GetTransientEntry() const; |
| 255 | 255 |
| 256 // New navigations ----------------------------------------------------------- | 256 // New navigations ----------------------------------------------------------- |
| 257 | 257 |
| 258 // Loads the specified URL. | 258 // Loads the specified URL. |
| 259 void LoadURL(const GURL& url, PageTransition::Type type); | 259 void LoadURL(const GURL& url, const GURL& referrer, |
| 260 PageTransition::Type type); |
| 260 | 261 |
| 261 // Load the specified URL the next time it becomes active. | 262 // Load the specified URL the next time it becomes active. |
| 262 void LoadURLLazily(const GURL& url, PageTransition::Type type, | 263 void LoadURLLazily(const GURL& url, const GURL& referrer, |
| 263 const std::wstring& title, SkBitmap* icon); | 264 PageTransition::Type type, const std::wstring& title, |
| 265 SkBitmap* icon); |
| 264 | 266 |
| 265 // Loads the current page if this NavigationController was restored from | 267 // Loads the current page if this NavigationController was restored from |
| 266 // history and the current page has not loaded yet. | 268 // history and the current page has not loaded yet. |
| 267 void LoadIfNecessary(); | 269 void LoadIfNecessary(); |
| 268 | 270 |
| 269 // Renavigation -------------------------------------------------------------- | 271 // Renavigation -------------------------------------------------------------- |
| 270 | 272 |
| 271 // Navigation relative to the "current entry" | 273 // Navigation relative to the "current entry" |
| 272 bool CanGoBack() const; | 274 bool CanGoBack() const; |
| 273 bool CanGoForward() const; | 275 bool CanGoForward() const; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 const NavigationEntry& entry); | 440 const NavigationEntry& entry); |
| 439 | 441 |
| 440 // Register the provided tab contents. This tab contents will be owned | 442 // Register the provided tab contents. This tab contents will be owned |
| 441 // and deleted by this navigation controller | 443 // and deleted by this navigation controller |
| 442 void RegisterTabContents(TabContents* some_contents); | 444 void RegisterTabContents(TabContents* some_contents); |
| 443 | 445 |
| 444 // Sets the max restored page ID this NavigationController has seen, if it | 446 // Sets the max restored page ID this NavigationController has seen, if it |
| 445 // was restored from a previous session. | 447 // was restored from a previous session. |
| 446 void set_max_restored_page_id(int max_id) { max_restored_page_id_ = max_id; } | 448 void set_max_restored_page_id(int max_id) { max_restored_page_id_ = max_id; } |
| 447 | 449 |
| 448 NavigationEntry* CreateNavigationEntry(const GURL& url, | 450 NavigationEntry* CreateNavigationEntry(const GURL& url, const GURL& referrer, |
| 449 PageTransition::Type transition); | 451 PageTransition::Type transition); |
| 450 | 452 |
| 451 // Invokes ScheduleTabContentsCollection for all TabContents but the active | 453 // Invokes ScheduleTabContentsCollection for all TabContents but the active |
| 452 // one. | 454 // one. |
| 453 void ScheduleTabContentsCollectionForInactiveTabs(); | 455 void ScheduleTabContentsCollectionForInactiveTabs(); |
| 454 | 456 |
| 455 // Schedule the TabContents currently allocated for |tc| for collection. | 457 // Schedule the TabContents currently allocated for |tc| for collection. |
| 456 // The TabContents will be destroyed later from a different event. | 458 // The TabContents will be destroyed later from a different event. |
| 457 void ScheduleTabContentsCollection(TabContentsType t); | 459 void ScheduleTabContentsCollection(TabContentsType t); |
| 458 | 460 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // when testing. | 551 // when testing. |
| 550 static bool check_for_repost_; | 552 static bool check_for_repost_; |
| 551 | 553 |
| 552 // The maximum number of entries that a navigation controller can store. | 554 // The maximum number of entries that a navigation controller can store. |
| 553 static size_t max_entry_count_; | 555 static size_t max_entry_count_; |
| 554 | 556 |
| 555 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 557 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 556 }; | 558 }; |
| 557 | 559 |
| 558 #endif // CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ | 560 #endif // CHROME_BROWSER_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |