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

Issue 2711683002: (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)

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

Description

(Set)IsOverridingUserAgent should be called on VisibleItem As explained in the associated bug, it always makes sense to call IsOverridingUserAgent() and SetIsOverridingUserAgent() on visible item instead of current item. Thus this CL changes CurrentItem to VisibleItem wherever necessary. Besides, this CL also does the following refactoring to have NavigationManagerImpl encapsulate VisibleItem for calling (Set)IsOverridingUserAgent() to provide one more layer of abstraction. BUG=693794 Review-Url: https://codereview.chromium.org/2711683002 Cr-Commit-Position: refs/heads/master@{#452570} Committed: https://chromium.googlesource.com/chromium/src/+/21359189a7883d38a531e8681cc250bdf301fa85

Patch Set 1 #

Total comments: 19

Patch Set 2 : Addressed feedback #

Total comments: 2

Patch Set 3 : Rename function names #

Total comments: 13

Patch Set 4 : Addressed feedback #

Patch Set 5 : Remove IsUsingDesktopUserAgent in NavigationManagerImpl #

Total comments: 7

Patch Set 6 : Addressed feedback #

Patch Set 7 : Update function name #

Total comments: 6

Patch Set 8 : Remove getter for usesDesktopUserAgent property #

Total comments: 8

Patch Set 9 : Change to call property method using dot #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -24 lines) Patch
M ios/chrome/browser/tabs/tab.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -1 line 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -4 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M ios/web/navigation/crw_session_controller.mm View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -10 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller.mm View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -7 lines 0 comments Download

Messages

Total messages: 37 (11 generated)
liaoyuke
Hi Eugene, Kurt, PTAL. Thank you very much! https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), ...
3 years, 10 months ago (2017-02-22 00:12:32 UTC) #2
Eugene But (OOO till 7-30)
I will let Kurt to do first pass review
3 years, 10 months ago (2017-02-22 00:14:57 UTC) #3
kkhorimoto
The logic looks good, but I have a few naming suggestions to make the code ...
3 years, 10 months ago (2017-02-22 01:08:40 UTC) #4
kkhorimoto
https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm#newcode1528 ios/chrome/browser/tabs/tab.mm:1528: - (BOOL)useDesktopUserAgent { On 2017/02/22 01:08:40, kkhorimoto_ wrote: > ...
3 years, 10 months ago (2017-02-22 01:16:33 UTC) #5
liaoyuke
PTAL. Thanks! https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm#newcode1528 ios/chrome/browser/tabs/tab.mm:1528: - (BOOL)useDesktopUserAgent { On 2017/02/22 01:08:40, kkhorimoto_ ...
3 years, 10 months ago (2017-02-22 01:37:43 UTC) #7
kkhorimoto
https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2711683002/diff/1/ios/chrome/browser/tabs/tab.mm#newcode1528 ios/chrome/browser/tabs/tab.mm:1528: - (BOOL)useDesktopUserAgent { On 2017/02/22 01:37:43, liaoyuke wrote: > ...
3 years, 10 months ago (2017-02-22 01:54:33 UTC) #8
liaoyuke
Totally agree that we should not be afraid to diverge if we are doing something ...
3 years, 10 months ago (2017-02-22 02:55:24 UTC) #9
kkhorimoto
lgtm!
3 years, 10 months ago (2017-02-22 21:38:35 UTC) #10
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), URL)); On 2017/02/22 00:12:32, liaoyuke wrote: > Confirmed ...
3 years, 10 months ago (2017-02-22 21:57:42 UTC) #11
kkhorimoto
https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), URL)); On 2017/02/22 21:57:41, Eugene But wrote: > ...
3 years, 10 months ago (2017-02-22 22:54:16 UTC) #12
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm#newcode424 ios/web/navigation/navigation_manager_impl.mm:424: return GetVisibleItem() && GetVisibleItem()->IsOverridingUserAgent(); On 2017/02/22 22:54:15, kkhorimoto_ wrote: ...
3 years, 10 months ago (2017-02-22 23:13:56 UTC) #13
liaoyuke
PTAL. Thanks! https://codereview.chromium.org/2711683002/diff/40001/ios/chrome/browser/tabs/tab.h File ios/chrome/browser/tabs/tab.h (right): https://codereview.chromium.org/2711683002/diff/40001/ios/chrome/browser/tabs/tab.h#newcode138 ios/chrome/browser/tabs/tab.h:138: @property(nonatomic, readonly, getter=isUsingDesktopUserAgent) On 2017/02/22 22:54:15, kkhorimoto_ ...
3 years, 10 months ago (2017-02-22 23:48:31 UTC) #14
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm File ios/web/navigation/navigation_manager_impl.mm (right): https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm#newcode424 ios/web/navigation/navigation_manager_impl.mm:424: return GetVisibleItem() && GetVisibleItem()->IsOverridingUserAgent(); > Given that user agent ...
3 years, 10 months ago (2017-02-23 00:03:14 UTC) #15
liaoyuke
On 2017/02/23 00:03:14, Eugene But wrote: > https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm > File ios/web/navigation/navigation_manager_impl.mm (right): > > https://codereview.chromium.org/2711683002/diff/40001/ios/web/navigation/navigation_manager_impl.mm#newcode424 ...
3 years, 10 months ago (2017-02-23 00:25:13 UTC) #16
liaoyuke
PTAL. Thanks!
3 years, 10 months ago (2017-02-23 00:35:03 UTC) #17
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), URL)); On 2017/02/22 22:54:15, kkhorimoto_ wrote: > On ...
3 years, 10 months ago (2017-02-23 00:54:24 UTC) #18
liaoyuke
PTAL. Thanks! https://codereview.chromium.org/2711683002/diff/80001/ios/chrome/browser/tabs/tab.h File ios/chrome/browser/tabs/tab.h (right): https://codereview.chromium.org/2711683002/diff/80001/ios/chrome/browser/tabs/tab.h#newcode137 ios/chrome/browser/tabs/tab.h:137: // Whether or not desktop user agent ...
3 years, 10 months ago (2017-02-23 01:10:14 UTC) #19
kkhorimoto
https://codereview.chromium.org/2711683002/diff/80001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2711683002/diff/80001/ios/web/web_state/ui/crw_web_controller.mm#newcode4205 ios/web/web_state/ui/crw_web_controller.mm:4205: web::NavigationItem* visibleItem = On 2017/02/23 01:10:14, liaoyuke wrote: > ...
3 years, 10 months ago (2017-02-23 01:16:25 UTC) #20
liaoyuke
On 2017/02/23 01:16:25, kkhorimoto_ wrote: > https://codereview.chromium.org/2711683002/diff/80001/ios/web/web_state/ui/crw_web_controller.mm > File ios/web/web_state/ui/crw_web_controller.mm (right): > > https://codereview.chromium.org/2711683002/diff/80001/ios/web/web_state/ui/crw_web_controller.mm#newcode4205 > ...
3 years, 10 months ago (2017-02-23 01:31:12 UTC) #21
Eugene But (OOO till 7-30)
Yuke, please address comment for crw_session_controller.mm https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), URL)); On ...
3 years, 10 months ago (2017-02-23 02:36:59 UTC) #22
liaoyuke
PTAL. Thank you very much! https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (left): https://codereview.chromium.org/2711683002/diff/1/ios/web/navigation/crw_session_controller.mm#oldcode501 ios/web/navigation/crw_session_controller.mm:501: currentItem->GetURL(), URL)); On 2017/02/23 ...
3 years, 10 months ago (2017-02-23 17:50:42 UTC) #24
Eugene But (OOO till 7-30)
lgtm with changes. Thank you for your patience. https://codereview.chromium.org/2711683002/diff/160001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2711683002/diff/160001/ios/chrome/browser/tabs/tab.mm#newcode1571 ios/chrome/browser/tabs/tab.mm:1571: if ...
3 years, 10 months ago (2017-02-23 18:00:12 UTC) #25
liaoyuke
Thank you all for the patience in reviewing the code! https://codereview.chromium.org/2711683002/diff/160001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2711683002/diff/160001/ios/chrome/browser/tabs/tab.mm#newcode1571 ...
3 years, 10 months ago (2017-02-23 18:37:11 UTC) #26
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/2711683002/180001
3 years, 10 months ago (2017-02-23 18:54:58 UTC) #33
commit-bot: I haz the power
Committed patchset #9 (id:180001) as https://chromium.googlesource.com/chromium/src/+/21359189a7883d38a531e8681cc250bdf301fa85
3 years, 10 months ago (2017-02-23 19:00:52 UTC) #36
gchatz
3 years, 10 months ago (2017-02-24 01:44:07 UTC) #37
Message was sent while issue was closed.
A revert of this CL (patchset #9 id:180001) has been created in
https://codereview.chromium.org/2711733007/ by gchatz@chromium.org.

The reason for reverting is: Causes
ToolsPopupMenuTestCase.testToolsMenuRequestDesktopNetwork to fail with error:
../../ios/chrome/browser/ui/tools_menu/tools_popup_menu_egtest.mm:109: error:
-[ToolsPopupMenuTestCase testToolsMenuRequestDesktopNetwork] : Exception:
NoMatchingElementException.

Powered by Google App Engine
This is Rietveld 408576698