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

Issue 2705293014: Created web::UserAgentType. (Closed)

Created:
3 years, 10 months ago by kkhorimoto
Modified:
3 years, 9 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, pkl (ping after 24h if needed), Eugene But (OOO till 7-30), net-reviews_chromium.org, noyau+watch_chromium.org, marq+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Created web::UserAgentType. Previously, NavigationItems contained a bool denoting whether a desktop user agent is used. However, the user agent as a concept does not apply to app-specific URLs, which are not loaded using HTTP requests. This CL introduces a UserAgentType enum, which contains the values NONE, MOBILE, and DESKTOP in order to differentiate between app-specific navigations and those using mobile/desktop user agents. This should assist with logic pertaining to whether to expose the option to use the desktop/mobile user agent, as app-specific URLs are handled by the enum type. BUG=none Review-Url: https://codereview.chromium.org/2705293014 Cr-Commit-Position: refs/heads/master@{#454426} Committed: https://chromium.googlesource.com/chromium/src/+/d79e11f6225265fcf1d5884b969796a0377dee8a

Patch Set 1 #

Patch Set 2 : self review #

Total comments: 10

Patch Set 3 : fix GetLastCommittedWebItem #

Total comments: 21

Patch Set 4 : Yuke's comments #

Patch Set 5 : Eugene's comments #

Total comments: 5

Patch Set 6 : simplify UA type setter, added TODO #

Total comments: 10

Patch Set 7 : Eugene's comments #

Total comments: 2

Patch Set 8 : Added DCHECK #

Patch Set 9 : rebase + compile fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+338 lines, -80 lines) Patch
M ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm View 1 chunk +2 lines, -1 line 0 comments Download
M ios/chrome/browser/ios_chrome_io_thread.mm View 1 chunk +2 lines, -1 line 0 comments Download
M ios/chrome/browser/net/ios_chrome_http_user_agent_settings.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M ios/chrome/browser/ui/webui/version_ui.mm View 1 chunk +3 lines, -2 lines 0 comments Download
M ios/chrome/browser/ui/webui/web_ui_egtest.mm View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/web/chrome_web_client.h View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/web/chrome_web_client.mm View 1 2 3 4 2 chunks +6 lines, -5 lines 0 comments Download
M ios/chrome/browser/web/chrome_web_client_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/BUILD.gn View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M ios/web/navigation/crw_navigation_item_storage_unittest.mm View 2 chunks +4 lines, -3 lines 0 comments Download
M ios/web/navigation/crw_session_controller.mm View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M ios/web/navigation/crw_session_entry.mm View 1 chunk +3 lines, -2 lines 0 comments Download
M ios/web/navigation/crw_session_entry_unittest.mm View 3 chunks +4 lines, -3 lines 0 comments Download
M ios/web/navigation/navigation_item_impl.h View 2 chunks +3 lines, -3 lines 0 comments Download
M ios/web/navigation/navigation_item_impl.mm View 1 2 3 4 5 4 chunks +9 lines, -7 lines 0 comments Download
M ios/web/navigation/navigation_item_storage_builder.mm View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/web/navigation/navigation_item_storage_test_util.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/navigation/navigation_manager_impl.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl.mm View 1 2 3 4 5 6 7 4 chunks +56 lines, -10 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl_unittest.mm View 1 2 3 4 5 6 2 chunks +85 lines, -1 line 0 comments Download
M ios/web/public/crw_navigation_item_storage.h View 1 2 3 4 4 chunks +9 lines, -4 lines 0 comments Download
M ios/web/public/crw_navigation_item_storage.mm View 7 chunks +30 lines, -7 lines 0 comments Download
M ios/web/public/navigation_item.h View 1 2 3 4 5 2 chunks +5 lines, -4 lines 0 comments Download
M ios/web/public/user_agent.h View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M ios/web/public/user_agent.mm View 2 chunks +26 lines, -0 lines 0 comments Download
A ios/web/public/user_agent_unittest.mm View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
M ios/web/public/web_client.h View 2 chunks +3 lines, -3 lines 0 comments Download
M ios/web/public/web_client.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/shell/shell_url_request_context_getter.mm View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M ios/web/shell/shell_web_client.h View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/shell/shell_web_client.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/web_state/ui/crw_web_controller.mm View 1 2 3 4 5 6 2 chunks +4 lines, -5 lines 0 comments Download
M ios/web/web_state/web_view_internal_creation_util.mm View 1 chunk +3 lines, -1 line 0 comments Download
M ios/web_view/internal/web_view_url_request_context_getter.mm View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M ios/web_view/internal/web_view_web_client.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ios/web_view/internal/web_view_web_client.mm View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 30 (9 generated)
kkhorimoto
3 years, 10 months ago (2017-02-25 00:57:03 UTC) #2
liaoyuke
Drive by. Thank you for creating the UserAgentType! https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return ...
3 years, 10 months ago (2017-02-25 01:28:19 UTC) #4
kkhorimoto
https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return std::string(); On 2017/02/25 01:28:19, liaoyuke wrote: > Do ...
3 years, 10 months ago (2017-02-25 01:35:05 UTC) #5
liaoyuke
https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return std::string(); On 2017/02/25 01:35:05, kkhorimoto_ wrote: > On ...
3 years, 10 months ago (2017-02-25 01:40:56 UTC) #6
liaoyuke
Or should we change this to a DCHECK_NEQ(type, web::UserAgentType::NONE)? On Fri, Feb 24, 2017 at ...
3 years, 10 months ago (2017-02-25 01:44:29 UTC) #7
Eugene But (OOO till 7-30)
Thank you for doing this! https://codereview.chromium.org/2705293014/diff/40001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/40001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return std::string(); DCHECK_NE(type, web::UserAgentType::NONE); ...
3 years, 10 months ago (2017-02-25 01:51:52 UTC) #8
kkhorimoto
https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/20001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return std::string(); On 2017/02/25 01:40:55, liaoyuke wrote: > On ...
3 years, 10 months ago (2017-02-25 01:52:09 UTC) #9
kkhorimoto
https://codereview.chromium.org/2705293014/diff/40001/ios/chrome/browser/web/chrome_web_client.mm File ios/chrome/browser/web/chrome_web_client.mm (right): https://codereview.chromium.org/2705293014/diff/40001/ios/chrome/browser/web/chrome_web_client.mm#newcode115 ios/chrome/browser/web/chrome_web_client.mm:115: return std::string(); On 2017/02/25 01:51:52, Eugene But wrote: > ...
3 years, 9 months ago (2017-02-27 23:29:04 UTC) #10
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm File ios/web/navigation/navigation_item_impl.mm (right): https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm#newcode212 ios/web/navigation/navigation_item_impl.mm:212: url_ = original_request_url_; Why? The old code and NavigationEntryImpl ...
3 years, 9 months ago (2017-02-27 23:55:19 UTC) #11
liaoyuke
https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm File ios/web/navigation/navigation_item_impl.mm (right): https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm#newcode212 ios/web/navigation/navigation_item_impl.mm:212: url_ = original_request_url_; On 2017/02/27 23:55:18, Eugene But wrote: ...
3 years, 9 months ago (2017-03-01 01:33:56 UTC) #12
kkhorimoto
https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm File ios/web/navigation/navigation_item_impl.mm (right): https://codereview.chromium.org/2705293014/diff/80001/ios/web/navigation/navigation_item_impl.mm#newcode212 ios/web/navigation/navigation_item_impl.mm:212: url_ = original_request_url_; On 2017/03/01 01:33:56, liaoyuke wrote: > ...
3 years, 9 months ago (2017-03-01 18:29:25 UTC) #13
kkhorimoto
PTAL so we can unblock Yuke. I've added a TODO for copying implementation to content//
3 years, 9 months ago (2017-03-02 02:45:40 UTC) #14
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2705293014/diff/40001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2705293014/diff/40001/ios/web/navigation/navigation_manager_impl.mm#newcode449 ios/web/navigation/navigation_manager_impl.mm:449: while (index >= 0) { On 2017/02/27 23:29:04, kkhorimoto_ ...
3 years, 9 months ago (2017-03-02 03:36:34 UTC) #15
kkhorimoto
https://codereview.chromium.org/2705293014/diff/100001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2705293014/diff/100001/ios/web/navigation/navigation_manager_impl.mm#newcode199 ios/web/navigation/navigation_manager_impl.mm:199: if (pending_item->GetUserAgentType() != UserAgentType::NONE) { On 2017/03/02 03:36:34, Eugene ...
3 years, 9 months ago (2017-03-02 04:12:55 UTC) #16
Eugene But (OOO till 7-30)
Thanks! lgtm https://codereview.chromium.org/2705293014/diff/120001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2705293014/diff/120001/ios/web/navigation/navigation_manager_impl.mm#newcode196 ios/web/navigation/navigation_manager_impl.mm:196: // UserAgentType::DESKTOP. Would it make sense to ...
3 years, 9 months ago (2017-03-02 06:44:06 UTC) #17
liaoyuke
On 2017/03/02 06:44:06, Eugene But wrote: > Thanks! lgtm > > https://codereview.chromium.org/2705293014/diff/120001/ios/web/navigation/navigation_manager_impl.mm > File ios/web/navigation/navigation_manager_impl.mm ...
3 years, 9 months ago (2017-03-02 19:08:09 UTC) #18
kkhorimoto
https://codereview.chromium.org/2705293014/diff/120001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2705293014/diff/120001/ios/web/navigation/navigation_manager_impl.mm#newcode196 ios/web/navigation/navigation_manager_impl.mm:196: // UserAgentType::DESKTOP. On 2017/03/02 06:44:06, Eugene But wrote: > ...
3 years, 9 months ago (2017-03-02 19:35:18 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2705293014/140001
3 years, 9 months ago (2017-03-02 19:35:59 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/165722) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 9 months ago (2017-03-02 19:51:42 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2705293014/160001
3 years, 9 months ago (2017-03-02 21:49:32 UTC) #27
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 23:21:04 UTC) #30
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/d79e11f6225265fcf1d5884b9697...

Powered by Google App Engine
This is Rietveld 408576698