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

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

Issue 2779383002: implement user agent override option. (Closed)
Patch Set: Rebase 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..3d8a52be3dcc1e9ec93e0eb24bb035b85450182e 100644
--- a/ios/web/public/navigation_manager.h
+++ b/ios/web/public/navigation_manager.h
@@ -30,6 +30,20 @@ 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-native item if
+ // there is one, otherwise keep the default type, which is NONE for native
+ // item and MOBILE for non-native item.
+ 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 +57,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 +196,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
« no previous file with comments | « ios/web/navigation/navigation_manager_impl_unittest.mm ('k') | ios/web/public/test/fakes/test_navigation_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698