Commit a6b72474 authored by Luke Halliwell's avatar Luke Halliwell Committed by Commit Bot

[Chromecast] Add buildflag to enable mobile user agent string

Now that we display a wider range of web content, some sites are
serving desktop sites with images too large for our memory limits
and so on.

Longer-term, it may be possible to use this UA string for all products.

Bug: internal b/112465626
Change-Id: I5c30b1966f75143eb5d99efabfb9093bf6159e90
Reviewed-on: https://chromium-review.googlesource.com/1175087Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Commit-Queue: Luke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583070}
parent 937bf0eb
...@@ -583,6 +583,7 @@ buildflag_header("chromecast_buildflags") { ...@@ -583,6 +583,7 @@ buildflag_header("chromecast_buildflags") {
"ENABLE_CHROMECAST_EXTENSIONS=$enable_chromecast_extensions", "ENABLE_CHROMECAST_EXTENSIONS=$enable_chromecast_extensions",
"ENABLE_CAST_FRAGMENT=$enable_cast_fragment", "ENABLE_CAST_FRAGMENT=$enable_cast_fragment",
"IS_ANDROID_THINGS_NON_PUBLIC=$is_android_things_non_public", "IS_ANDROID_THINGS_NON_PUBLIC=$is_android_things_non_public",
"USE_ANDROID_USER_AGENT=$use_android_user_agent",
"USE_CHROMECAST_CDMS=$use_chromecast_cdms", "USE_CHROMECAST_CDMS=$use_chromecast_cdms",
] ]
} }
......
...@@ -83,6 +83,11 @@ declare_args() { ...@@ -83,6 +83,11 @@ declare_args() {
# unified flag to pick monotonic_clock OR monotonic_clock_raw # unified flag to pick monotonic_clock OR monotonic_clock_raw
media_clock_monotonic_raw = !is_android && !is_cast_desktop_build media_clock_monotonic_raw = !is_android && !is_cast_desktop_build
# Include 'Android' in user agent string to avoid being served desktop
# versions of websites.
# TODO(halliwell): consider making this default for all Cast hardware.
use_android_user_agent = false
} }
declare_args() { declare_args() {
......
...@@ -72,6 +72,8 @@ std::string GetUserAgent() { ...@@ -72,6 +72,8 @@ std::string GetUserAgent() {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
"Linux; ", "Linux; ",
BuildAndroidOsInfo().c_str() BuildAndroidOsInfo().c_str()
#elif BUILDFLAG(USE_ANDROID_USER_AGENT)
"Linux; ", "Android"
#else #else
"X11; ", "X11; ",
content::BuildOSCpuInfo(false /* include_android_build_number */).c_str() content::BuildOSCpuInfo(false /* include_android_build_number */).c_str()
......
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