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

Unified Diff: ios/web/navigation/navigation_item_impl.mm

Issue 2705293014: Created web::UserAgentType. (Closed)
Patch Set: rebase + compile fix Created 3 years, 10 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
« no previous file with comments | « ios/web/navigation/navigation_item_impl.h ('k') | ios/web/navigation/navigation_item_storage_builder.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_item_impl.mm
diff --git a/ios/web/navigation/navigation_item_impl.mm b/ios/web/navigation/navigation_item_impl.mm
index 31f357566080a0b3b5613312130691500edc34bc..7e682a9d733c8f368cd60edf1743f91905d0954f 100644
--- a/ios/web/navigation/navigation_item_impl.mm
+++ b/ios/web/navigation/navigation_item_impl.mm
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "components/url_formatter/url_formatter.h"
#import "ios/web/navigation/navigation_manager_impl.h"
+#import "ios/web/public/web_client.h"
#include "ui/base/page_transition_types.h"
#include "ui/gfx/text_elider.h"
@@ -40,7 +41,7 @@ static int GetUniqueIDInConstructor() {
NavigationItemImpl::NavigationItemImpl()
: unique_id_(GetUniqueIDInConstructor()),
transition_type_(ui::PAGE_TRANSITION_LINK),
- is_overriding_user_agent_(false),
+ user_agent_type_(UserAgentType::MOBILE),
is_created_from_push_state_(false),
has_state_been_replaced_(false),
is_created_from_hash_change_(false),
@@ -64,7 +65,7 @@ static int GetUniqueIDInConstructor() {
favicon_(item.favicon_),
ssl_(item.ssl_),
timestamp_(item.timestamp_),
- is_overriding_user_agent_(item.is_overriding_user_agent_),
+ user_agent_type_(item.user_agent_type_),
http_request_headers_([item.http_request_headers_ copy]),
serialized_state_object_([item.serialized_state_object_ copy]),
is_created_from_push_state_(item.is_created_from_push_state_),
@@ -206,13 +207,14 @@ static int GetUniqueIDInConstructor() {
return timestamp_;
}
-void NavigationItemImpl::SetIsOverridingUserAgent(
- bool is_overriding_user_agent) {
- is_overriding_user_agent_ = is_overriding_user_agent;
+void NavigationItemImpl::SetUserAgentType(UserAgentType type) {
+ user_agent_type_ = type;
+ DCHECK_EQ(GetWebClient()->IsAppSpecificURL(GetVirtualURL()),
+ user_agent_type_ == UserAgentType::NONE);
}
-bool NavigationItemImpl::IsOverridingUserAgent() const {
- return is_overriding_user_agent_;
+UserAgentType NavigationItemImpl::GetUserAgentType() const {
+ return user_agent_type_;
}
bool NavigationItemImpl::HasPostData() const {
« no previous file with comments | « ios/web/navigation/navigation_item_impl.h ('k') | ios/web/navigation/navigation_item_storage_builder.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698