Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: ios/web/public/navigation_manager.h

Issue 2779383002: implement user agent override option. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
+ // in the NavigationManager.
+ INHERIT = 0,
+
+ // Use the mobile user agent.
+ MOBILE,
+
+ // Use the desktop user agent.
+ DESKTOP
+ };
+
// 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

Powered by Google App Engine
This is Rietveld 408576698