Commit 1b87f49d authored by Ryo Hashimoto's avatar Ryo Hashimoto Committed by Commit Bot

ash: Partially revert r665168 to fix ARC Custom Tabs

Partially revert r665168 (CL:1637649) which broke ARC Custom Tabs' UA override:
- chrome::SetAndroidOsForTabletSite() doesn't work because
there is no NavigationEntry yet.
- The removed TODO is still valid.

BUG=b:64863368
TEST=Open an ARC Custom Tab

Change-Id: Iabac4ad68b7b8452a44b9768a2637ce106b43d21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660390
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669584}
parent 15b26b81
......@@ -211,8 +211,17 @@ class CustomTabSessionImpl
std::unique_ptr<content::WebContents> web_contents =
content::WebContents::Create(create_params);
// Use the same version number as browser_commands.cc
// TODO(hashimoto): Get the actual Android version from the container.
constexpr char kOsOverrideForTabletSite[] =
"Linux; Android 9; Chrome tablet";
// Override the user agent to request mobile version web sites.
chrome::SetAndroidOsForTabletSite(web_contents.get());
const std::string product =
version_info::GetProductNameAndVersionForUserAgent();
const std::string user_agent = content::BuildUserAgentFromOSAndProduct(
kOsOverrideForTabletSite, product);
web_contents->SetUserAgentOverride(user_agent,
false /*override_in_new_tabs=*/);
content::NavigationController::LoadURLParams load_url_params(url);
load_url_params.source_site_instance = site_instance;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment