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" |
11 #include "ios/web/public/browser_url_rewriter.h" | 11 #include "ios/web/public/browser_url_rewriter.h" |
12 #include "ios/web/public/navigation_item_list.h" | |
12 #include "ios/web/public/referrer.h" | 13 #include "ios/web/public/referrer.h" |
13 #include "ui/base/page_transition_types.h" | 14 #include "ui/base/page_transition_types.h" |
14 | 15 |
15 @class NSDictionary; | 16 @class NSDictionary; |
16 @class NSData; | 17 @class NSData; |
17 | 18 |
18 namespace web { | 19 namespace web { |
19 | 20 |
20 class BrowserState; | 21 class BrowserState; |
21 class NavigationItem; | 22 class NavigationItem; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 virtual bool CanGoBack() const = 0; | 143 virtual bool CanGoBack() const = 0; |
143 virtual bool CanGoForward() const = 0; | 144 virtual bool CanGoForward() const = 0; |
144 virtual bool CanGoToOffset(int offset) const = 0; | 145 virtual bool CanGoToOffset(int offset) const = 0; |
145 virtual void GoBack() = 0; | 146 virtual void GoBack() = 0; |
146 virtual void GoForward() = 0; | 147 virtual void GoForward() = 0; |
147 | 148 |
148 // Navigates to the specified absolute index. | 149 // Navigates to the specified absolute index. |
149 // TODO(crbug.com/533848): Update to use size_t. | 150 // TODO(crbug.com/533848): Update to use size_t. |
150 virtual void GoToIndex(int index) = 0; | 151 virtual void GoToIndex(int index) = 0; |
151 | 152 |
153 // Returns a list of all non-redirected NavigationItems whose index precedes | |
154 // or follows the current index. | |
155 virtual NavigationItemList GetBackwardItems() const = 0; | |
Eugene But (OOO till 7-30)
2017/03/10 16:23:27
Could you please add tests for these.
kkhorimoto
2017/03/10 23:02:20
They already exist in crw_session_controller_unitt
| |
156 virtual NavigationItemList GetForwardItems() const = 0; | |
157 | |
152 // Reloads the current item. If |check_for_repost| is true and the current | 158 // Reloads the current item. If |check_for_repost| is true and the current |
153 // item has POST data the user is prompted to see if they really want to | 159 // item has POST data the user is prompted to see if they really want to |
154 // reload the page. In nearly all cases pass in true. If a transient item is | 160 // reload the page. In nearly all cases pass in true. If a transient item is |
155 // showing, initiates a new navigation to its URL. | 161 // showing, initiates a new navigation to its URL. |
156 virtual void Reload(bool check_for_repost) = 0; | 162 virtual void Reload(bool check_for_repost) = 0; |
157 | 163 |
164 // Inserts copies of |other_controller|'s NavigationItems to the front of this | |
Eugene But (OOO till 7-30)
2017/03/10 16:23:27
NavigationController does not have this method, so
kkhorimoto
2017/03/10 23:02:20
Will do this on the other CL.
| |
165 // session history. | |
166 virtual void InsertStateFromManager(const NavigationManager* manager) = 0; | |
167 | |
158 // Forces the pending item to be loaded using desktop user agent. Note that | 168 // Forces the pending item to be loaded using desktop user agent. Note that |
159 // the pending item may or may not already exist. | 169 // the pending item may or may not already exist. |
160 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't | 170 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't |
161 // create a new NavigationItem. | 171 // create a new NavigationItem. |
162 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; | 172 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; |
163 }; | 173 }; |
164 | 174 |
165 } // namespace web | 175 } // namespace web |
166 | 176 |
167 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ | 177 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ |
OLD | NEW |