Skip to content

Commit

Permalink
[M112][RDSD] Use switchUserAgent() instead of reload() for app menu R…
Browse files Browse the repository at this point in the history
…DS toggle

Merge to M112.

Use TabUtils.switchUserAgent() instead of Tab.reload(). Because we
need to reload with ReloadType::ORIGINAL_REQUEST_URL.

(cherry picked from commit 4b6644e)

Bug: 1418587
Change-Id: I58e8658e4188789ef44f4b730e2615494adb35e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4291767
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Shu Yang <shuyng@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1109882}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4293140
Auto-Submit: Shu Yang <shuyng@google.com>
Reviewed-by: Sirisha Kavuluru <skavuluru@google.com>
Cr-Commit-Position: refs/branch-heads/5615@{#31}
Cr-Branched-From: 9c6408e-refs/heads/main@{#1109224}
  • Loading branch information
Shu Yang authored and Chromium LUCI CQ committed Feb 27, 2023
1 parent 63f832d commit 769f4d9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,11 @@ public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
Profile profile = getCurrentTabModel().getProfile();
RequestDesktopUtils.setRequestDesktopSiteContentSettingsForUrl(
profile, currentTab.getUrl(), usingDesktopUserAgent);
currentTab.reload();
// Use TabUtils.switchUserAgent() instead of Tab.reload(). Because we need to reload
// with ReloadType::ORIGINAL_REQUEST_URL. See http://crbug/1418587 for details.
TabUtils.switchUserAgent(currentTab, usingDesktopUserAgent,
/* forcedByUser */ false,
UseDesktopUserAgentCaller.ON_MENU_OR_KEYBOARD_ACTION);
RequestDesktopUtils.maybeShowUserEducationPromptForAppMenuSelection(
profile, this, getModalDialogManager());
TrackerFactory.getTrackerForProfile(profile).notifyEvent(
Expand Down

0 comments on commit 769f4d9

Please sign in to comment.