| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 6 #define CHROME_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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // entry and resets the |session_id_| of this to match |source|. This is | 367 // entry and resets the |session_id_| of this to match |source|. This is |
| 368 // intended for use when you're going to throw away |source| and replace it | 368 // intended for use when you're going to throw away |source| and replace it |
| 369 // with this. This method is intended for use when the last entry of |this| | 369 // with this. This method is intended for use when the last entry of |this| |
| 370 // is the active entry. For example: | 370 // is the active entry. For example: |
| 371 // source: A B *C* D | 371 // source: A B *C* D |
| 372 // this: E F *G* (last must be active or pending) | 372 // this: E F *G* (last must be active or pending) |
| 373 // result: A B *G* | 373 // result: A B *G* |
| 374 // This ignores the transient index of the source and honors that of 'this'. | 374 // This ignores the transient index of the source and honors that of 'this'. |
| 375 void CopyStateFromAndPrune(const NavigationController& source); | 375 void CopyStateFromAndPrune(const NavigationController& source); |
| 376 | 376 |
| 377 // Removes all the entries except the active entry. If there is a new pending |
| 378 // navigation it is preserved. |
| 379 void PruneAllButActive(); |
| 380 |
| 377 // Random data --------------------------------------------------------------- | 381 // Random data --------------------------------------------------------------- |
| 378 | 382 |
| 379 // Returns the identifier used by session restore. | 383 // Returns the identifier used by session restore. |
| 380 const SessionID& session_id() const { return session_id_; } | 384 const SessionID& session_id() const { return session_id_; } |
| 381 | 385 |
| 382 // Identifier of the window we're in. | 386 // Identifier of the window we're in. |
| 383 void SetWindowID(const SessionID& id); | 387 void SetWindowID(const SessionID& id); |
| 384 const SessionID& window_id() const { return window_id_; } | 388 const SessionID& window_id() const { return window_id_; } |
| 385 | 389 |
| 386 SSLManager* ssl_manager() { return &ssl_manager_; } | 390 SSLManager* ssl_manager() { return &ssl_manager_; } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 // Returns true if the navigation is likley to be automatic rather than | 514 // Returns true if the navigation is likley to be automatic rather than |
| 511 // user-initiated. | 515 // user-initiated. |
| 512 bool IsLikelyAutoNavigation(base::TimeTicks now); | 516 bool IsLikelyAutoNavigation(base::TimeTicks now); |
| 513 | 517 |
| 514 // Creates a new NavigationEntry for each TabNavigation in navigations, adding | 518 // Creates a new NavigationEntry for each TabNavigation in navigations, adding |
| 515 // the NavigationEntry to entries. This is used during session restore. | 519 // the NavigationEntry to entries. This is used during session restore. |
| 516 void CreateNavigationEntriesFromTabNavigations( | 520 void CreateNavigationEntriesFromTabNavigations( |
| 517 const std::vector<TabNavigation>& navigations, | 521 const std::vector<TabNavigation>& navigations, |
| 518 std::vector<linked_ptr<NavigationEntry> >* entries); | 522 std::vector<linked_ptr<NavigationEntry> >* entries); |
| 519 | 523 |
| 520 // Removes all the entries except the active entry. If there is a new pending | |
| 521 // navigation it is preserved. | |
| 522 void PruneAllButActive(); | |
| 523 | |
| 524 // Inserts up to |max_index| entries from |source| into this. This does NOT | 524 // Inserts up to |max_index| entries from |source| into this. This does NOT |
| 525 // adjust any of the members that reference entries_ | 525 // adjust any of the members that reference entries_ |
| 526 // (last_committed_entry_index_, pending_entry_index_ or | 526 // (last_committed_entry_index_, pending_entry_index_ or |
| 527 // transient_entry_index_). | 527 // transient_entry_index_). |
| 528 void InsertEntriesFrom(const NavigationController& source, int max_index); | 528 void InsertEntriesFrom(const NavigationController& source, int max_index); |
| 529 | 529 |
| 530 // --------------------------------------------------------------------------- | 530 // --------------------------------------------------------------------------- |
| 531 | 531 |
| 532 // The user profile associated with this controller | 532 // The user profile associated with this controller |
| 533 Profile* profile_; | 533 Profile* profile_; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 static size_t max_entry_count_; | 596 static size_t max_entry_count_; |
| 597 | 597 |
| 598 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), | 598 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), |
| 599 // NO_RELOAD otherwise. | 599 // NO_RELOAD otherwise. |
| 600 ReloadType pending_reload_; | 600 ReloadType pending_reload_; |
| 601 | 601 |
| 602 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 602 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 603 }; | 603 }; |
| 604 | 604 |
| 605 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 605 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |