| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 bool from_last_session, | 71 bool from_last_session, |
| 72 std::vector<NavigationEntry*>* entries); | 72 std::vector<NavigationEntry*>* entries); |
| 73 | 73 |
| 74 // Active entry -------------------------------------------------------------- | 74 // Active entry -------------------------------------------------------------- |
| 75 | 75 |
| 76 // Returns the active entry, which is the transient entry if any, the pending | 76 // Returns the active entry, which is the transient entry if any, the pending |
| 77 // entry if a navigation is in progress or the last committed entry otherwise. | 77 // entry if a navigation is in progress or the last committed entry otherwise. |
| 78 // NOTE: This can be NULL!! | 78 // NOTE: This can be NULL!! |
| 79 // | 79 // |
| 80 // If you are trying to get the current state of the NavigationController, | 80 // If you are trying to get the current state of the NavigationController, |
| 81 // this is the method you will typically want to call. | 81 // this is the method you will typically want to call. If you want to display |
| 82 // the active entry to the user (e.g., in the location bar), use |
| 83 // GetVisibleEntry instead. |
| 82 NavigationEntry* GetActiveEntry() const; | 84 NavigationEntry* GetActiveEntry() const; |
| 83 | 85 |
| 86 // Returns the same entry as GetActiveEntry, except that it ignores pending |
| 87 // history navigation entries. This should be used when displaying info to |
| 88 // the user, so that the location bar and other indicators do not update for |
| 89 // a back/forward navigation until the pending entry commits. This approach |
| 90 // guards against URL spoofs on slow history navigations. |
| 91 NavigationEntry* GetVisibleEntry() const; |
| 92 |
| 84 // Returns the index from which we would go back/forward or reload. This is | 93 // Returns the index from which we would go back/forward or reload. This is |
| 85 // the last_committed_entry_index_ if pending_entry_index_ is -1. Otherwise, | 94 // the last_committed_entry_index_ if pending_entry_index_ is -1. Otherwise, |
| 86 // it is the pending_entry_index_. | 95 // it is the pending_entry_index_. |
| 87 int GetCurrentEntryIndex() const; | 96 int GetCurrentEntryIndex() const; |
| 88 | 97 |
| 89 // Returns the last committed entry, which may be null if there are no | 98 // Returns the last committed entry, which may be null if there are no |
| 90 // committed entries. | 99 // committed entries. |
| 91 NavigationEntry* GetLastCommittedEntry() const; | 100 NavigationEntry* GetLastCommittedEntry() const; |
| 92 | 101 |
| 93 // Returns true if the source for the current entry can be viewed. | 102 // Returns true if the source for the current entry can be viewed. |
| (...skipping 376 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 |