Chromium Code Reviews| 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/referrer.h" | 12 #include "ios/web/public/referrer.h" |
| 13 #include "ui/base/page_transition_types.h" | 13 #include "ui/base/page_transition_types.h" |
| 14 | 14 |
| 15 @class NSDictionary; | 15 @class NSDictionary; |
| 16 @class NSData; | 16 @class NSData; |
| 17 | 17 |
| 18 namespace web { | 18 namespace web { |
| 19 | 19 |
| 20 class BrowserState; | 20 class BrowserState; |
| 21 class NavigationItem; | 21 class NavigationItem; |
| 22 class WebState; | 22 class WebState; |
| 23 enum class ReloadType : short; | |
|
kkhorimoto
2017/03/10 21:26:45
same comment about includes
liaoyuke
2017/03/10 21:42:35
Done.
| |
| 23 | 24 |
| 24 // A NavigationManager maintains the back-forward list for a WebState and | 25 // A NavigationManager maintains the back-forward list for a WebState and |
| 25 // manages all navigation within that list. | 26 // manages all navigation within that list. |
| 26 // | 27 // |
| 27 // Each NavigationManager belongs to one WebState; each WebState has | 28 // Each NavigationManager belongs to one WebState; each WebState has |
| 28 // exactly one NavigationManager. | 29 // exactly one NavigationManager. |
| 29 class NavigationManager { | 30 class NavigationManager { |
| 30 public: | 31 public: |
| 31 // Parameters for URL loading. Most parameters are optional, and can be left | 32 // Parameters for URL loading. Most parameters are optional, and can be left |
| 32 // at the default values set by the constructor. | 33 // at the default values set by the constructor. |
| (...skipping 109 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 |
| 152 // Reloads the current item. If |check_for_repost| is true and the current | 153 // Reloads the visible item under the specified ReloadType. If |
| 153 // item has POST data the user is prompted to see if they really want to | 154 // |check_for_repost| is true and the current item has POST data the user is |
| 154 // reload the page. In nearly all cases pass in true. If a transient item is | 155 // prompted to see if they really want to reload the page. In nearly all cases |
| 155 // showing, initiates a new navigation to its URL. | 156 // pass in true. If a transient item is showing, initiates a new navigation |
| 156 virtual void Reload(bool check_for_repost) = 0; | 157 // to its URL. |
| 158 virtual void Reload(ReloadType reload_type, bool check_for_repost) = 0; | |
|
Eugene But (OOO till 7-30)
2017/03/10 18:37:32
Content reload does not have this argument. Can we
kkhorimoto
2017/03/10 18:47:46
This is because content// stores the ReloadType in
Eugene But (OOO till 7-30)
2017/03/10 18:58:04
Sorry, I did not realize that proposed approach di
liaoyuke
2017/03/10 21:16:23
Acknowledged.
| |
| 157 | 159 |
| 158 // Forces the pending item to be loaded using desktop user agent. Note that | 160 // Forces the pending item to be loaded using desktop user agent. Note that |
| 159 // the pending item may or may not already exist. | 161 // the pending item may or may not already exist. |
| 160 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't | 162 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't |
| 161 // create a new NavigationItem. | 163 // create a new NavigationItem. |
| 162 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; | 164 virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; |
| 163 }; | 165 }; |
| 164 | 166 |
| 165 } // namespace web | 167 } // namespace web |
| 166 | 168 |
| 167 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ | 169 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_ |
| OLD | NEW |