OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PUBLIC_NAVIGATION_MANAGER_H_ | 5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ |
6 #define IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ | 6 #define IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // TODO(crbug.com/700571): implement the logic for when |reload_type| is | 159 // TODO(crbug.com/700571): implement the logic for when |reload_type| is |
160 // ORIGINAL_REQUEST_URL. | 160 // ORIGINAL_REQUEST_URL. |
161 // TODO(crbug.com/700958): implement the logic for |check_for_repost|. | 161 // TODO(crbug.com/700958): implement the logic for |check_for_repost|. |
162 virtual void Reload(ReloadType reload_type, bool check_for_repost) = 0; | 162 virtual void Reload(ReloadType reload_type, bool check_for_repost) = 0; |
163 | 163 |
164 // Returns a list of all non-redirected NavigationItems whose index precedes | 164 // Returns a list of all non-redirected NavigationItems whose index precedes |
165 // or follows the current index. | 165 // or follows the current index. |
166 virtual NavigationItemList GetBackwardItems() const = 0; | 166 virtual NavigationItemList GetBackwardItems() const = 0; |
167 virtual NavigationItemList GetForwardItems() const = 0; | 167 virtual NavigationItemList GetForwardItems() const = 0; |
168 | 168 |
| 169 // Removes all items from this except the last committed item, and inserts |
| 170 // copies of all items from |source| at the beginning of the session history. |
| 171 // |
| 172 // For example: |
| 173 // source: A B *C* D |
| 174 // this: E F *G* |
| 175 // result: A B C *G* |
| 176 // |
| 177 // If there is a pending item after *G* in |this|, it is also preserved. |
| 178 // This ignores any pending or transient entries in |source|. This will be a |
| 179 // no-op if called while CanPruneAllButLastCommittedItem() is false. |
| 180 virtual void CopyStateFromAndPrune(const NavigationManager* source) = 0; |
| 181 |
| 182 // Whether the NavigationManager can prune all but the last committed item. |
| 183 // This is true when all the following conditions are met: |
| 184 // - There is a last committed NavigationItem. |
| 185 // - There is no pending history navigation. |
| 186 // - There is no transient NavigationItem. |
| 187 virtual bool CanPruneAllButLastCommittedItem() const = 0; |
| 188 |
169 // Forces the pending item to be loaded using desktop user agent. Note that | 189 // Forces the pending item to be loaded using desktop user agent. Note that |
170 // the pending item may or may not already exist. | 190 // the pending item may or may not already exist. |
171 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't | 191 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't |
172 // create a new NavigationItem. | 192 // create a new NavigationItem. |
173 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; | 193 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; |
174 }; | 194 }; |
175 | 195 |
176 } // namespace web | 196 } // namespace web |
177 | 197 |
178 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ | 198 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ |
OLD | NEW |