OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ | 5 #ifndef IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ |
6 #define IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ | 6 #define IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // source: A B *C* D | 127 // source: A B *C* D |
128 // this: E F *G* | 128 // this: E F *G* |
129 // result: A B C *G* | 129 // result: A B C *G* |
130 // | 130 // |
131 // If there is a pending item after *G* in |this|, it is also preserved. | 131 // If there is a pending item after *G* in |this|, it is also preserved. |
132 // This ignores any pending or transient entries in |source|. No-op if | 132 // This ignores any pending or transient entries in |source|. No-op if |
133 // |canPruneAllButLastCommittedItem| is false. | 133 // |canPruneAllButLastCommittedItem| is false. |
134 - (void)copyStateFromSessionControllerAndPrune:(CRWSessionController*)source; | 134 - (void)copyStateFromSessionControllerAndPrune:(CRWSessionController*)source; |
135 | 135 |
136 // Sets |lastCommittedItemIndex| to the |index| if it's in the entries bounds. | 136 // Sets |lastCommittedItemIndex| to the |index| if it's in the entries bounds. |
137 - (void)goToItemAtIndex:(NSInteger)index; | 137 // Discards pending and transient entries if |discard| is YES. |
| 138 - (void)goToItemAtIndex:(NSInteger)index discardNonCommittedItems:(BOOL)discard; |
138 | 139 |
139 // Removes the item at |index| after discarding any noncomitted entries. | 140 // Removes the item at |index| after discarding any noncomitted entries. |
140 // |index| must not be the index of the last committed item, or a noncomitted | 141 // |index| must not be the index of the last committed item, or a noncomitted |
141 // item. | 142 // item. |
142 - (void)removeItemAtIndex:(NSInteger)index; | 143 - (void)removeItemAtIndex:(NSInteger)index; |
143 | 144 |
144 // Determines whether a navigation between |firstEntry| and |secondEntry| is a | 145 // Determines whether a navigation between |firstEntry| and |secondEntry| is a |
145 // same-document navigation. Entries can be passed in any order. | 146 // same-document navigation. Entries can be passed in any order. |
146 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem | 147 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem |
147 andItem:(web::NavigationItem*)secondItem; | 148 andItem:(web::NavigationItem*)secondItem; |
148 | 149 |
149 // Returns the index of |item| in |items|. | 150 // Returns the index of |item| in |items|. |
150 - (NSInteger)indexOfItem:(const web::NavigationItem*)item; | 151 - (NSInteger)indexOfItem:(const web::NavigationItem*)item; |
151 | 152 |
152 // Returns the item at |index| in |items|. | 153 // Returns the item at |index| in |items|. |
153 - (web::NavigationItemImpl*)itemAtIndex:(NSInteger)index; | 154 - (web::NavigationItemImpl*)itemAtIndex:(NSInteger)index; |
154 | 155 |
155 @end | 156 @end |
156 | 157 |
157 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ | 158 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ |
OLD | NEW |