Chromium Code Reviews| Index: ios/web/public/navigation_manager.h |
| diff --git a/ios/web/public/navigation_manager.h b/ios/web/public/navigation_manager.h |
| index 876cee6d046edfbfb4518308d233dd4bf9c4b8d0..57715435180872c206a24e94bd637d382b5210f2 100644 |
| --- a/ios/web/public/navigation_manager.h |
| +++ b/ios/web/public/navigation_manager.h |
| @@ -30,6 +30,19 @@ class WebState; |
| // exactly one NavigationManager. |
| class NavigationManager { |
| public: |
| + // User agent override option used in LoadURLParams. |
| + enum class UserAgentOverrideOption : short { |
| + // Inherit the user agent type from the last committed non-app specific item |
|
Eugene But (OOO till 7-30)
2017/03/30 19:21:24
What if there are no committed items?
liaoyuke
2017/03/30 19:56:25
Done.
|
| + // in the NavigationManager. |
| + INHERIT = 0, |
| + |
| + // Use the mobile user agent. |
| + MOBILE, |
| + |
| + // Use the desktop user agent. |
| + DESKTOP |
|
Eugene But (OOO till 7-30)
2017/03/30 19:21:24
Optional nit: it's a good practice to have comma a
liaoyuke
2017/03/30 19:56:25
Done.
|
| + }; |
| + |
| // Parameters for URL loading. Most parameters are optional, and can be left |
| // at the default values set by the constructor. |
| struct WebLoadParams { |
| @@ -43,6 +56,9 @@ class NavigationManager { |
| // The transition type for the load. Defaults to PAGE_TRANSITION_LINK. |
| ui::PageTransition transition_type; |
| + // The user agent override option for the load. Defualts to INHERIT. |
| + UserAgentOverrideOption user_agent_override_option; |
| + |
| // True for renderer-initiated navigations. This is |
| // important for tracking whether to display pending URLs. |
| bool is_renderer_initiated; |
| @@ -179,12 +195,6 @@ class NavigationManager { |
| // - There is no pending history navigation. |
| // - There is no transient NavigationItem. |
| virtual bool CanPruneAllButLastCommittedItem() const = 0; |
| - |
| - // Forces the pending item to be loaded using desktop user agent. Note that |
| - // the pending item may or may not already exist. |
| - // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't |
| - // create a new NavigationItem. |
| - virtual void OverrideDesktopUserAgentForNextPendingItem() = 0; |
| }; |
| } // namespace web |