Revert "Reland "Reland "[XR] Use desktop user agent client hints by default for XR devices"""

This reverts commit 762df81b695eb7c8a54fe11079435ece2fdd8913.

Reason for revert: The changes cause test failures on Android Automotive CI bots: https://ci.chromium.org/ui/p/chrome/builders/ci/android-automotive-12l-x64-rel-tests/b8706843049912372097/test-results?q=ID%3AUserAgentUtilsTest.UserAgentMetadataForXrDevice

Rather than just disabling this single test I'm reverting the CL so that the XR form factor checks are implementing in a way that makes it less likely Automotive tests (which aren't run in CQ) will fail in this way.

Bug: 381541583
Original change's description:
> Reland "Reland "[XR] Use desktop user agent client hints by default for XR devices""
>
> This is a reland of commit f007ff92a06f2fc270aafb011d22ccbfcc5a5197
>
> This reland resolves issues from the original version, specifically addressing
> performance test failures and post-submit linker errors. The tests now fetch
> device properties using device_info, ensuring successful execution.
> Key modifications include:
>
> 1. XR Device Determination: Switched from using the `device::features::IsXrDevice()` feature flag to `base::android::device_info::is_xr()` for identifying XR devices.
> 2. New Form Factor: Introduced `ui::DEVICE_FORM_FACTOR_XR` as a new enum type for form factors. It is similar to the approach used by devices of desktop form factor.
> 3. Testing: Added `for-testing` methods to the `DeviceInfo` class to enable XR device simulation in unit tests. These methods can be utilized for browser tests once XR devices are integrated into automated testing.
> 4. Code Cleanup: Removed `device::features::kForceIsXrDeviceForTesting`, a public cpp feature previously used for testing, and cleaned up associated code.
>
> Original change's description:
> > Reland "[XR] Use desktop user agent client hints by default for XR devices"
> >
> > This is a reland of commit ba8733b34194c66425f780c3a09ea2051da5c7f1
> >
> > Original change's description:
> > > [XR] Use desktop user agent client hints by default for XR devices
> > >
> > > This change modifies the user agent client hints for XR devices to align
> > > with a desktop form factor.
> > >
> > > Previously, search requests from XR devices sent the default mobile user
> > > agent, causing some web services to incorrectly identify the XR device
> > > as a mobile phone. This resulted in a degraded user experience, such as
> > > 3D models links not appearing in initial search results.
> > >
> > > The user agent for XR devices now correctly reflects the user agent
> > > string, similar to for a desktop (crrev.com/c/6639016). This is achieved
> > > by setting the platform info mobile flag and specifying device-specific
> > > details like architecture, CPU, and bit count.
> > >
> > > This change also resolves the issue of Chrome not playing videos hosted
> > > on a drive on XR devices.
> > >
> > > Test: Verified on a Moohan device by searching for "Golden Eagle". The
> > > "View in 3D" option now appears in the initial search results. A screen
> > > recording of the successful test is available at
> > > https://drive.google.com/file/d/14BcygWXpdrA7E8Ewu3ADNIbYPOo2XZ66/view?usp=drive_link&resourcekey=0-Gi2OiD2fMlYe-2UAd-4Qtw
> > >
> > > Bug: 381541583
> > > Change-Id: I45c1e2205cc0058bbc0c0f787a16cfe3841a468c
> > > Fixed: 380746545
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6769955
> > > Reviewed-by: Victor Tan <victortan@chromium.org>
> > > Commit-Queue: Gurmeet Kalra <gurmeetk@google.com>
> > > Cr-Commit-Position: refs/heads/main@{#1491731}
> >
> > Bug: 381541583
> > Change-Id: Ie222b844db21262f26aade3d7d785bb8203cc131
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6787410
> > Reviewed-by: Victor Tan <victortan@chromium.org>
> > Commit-Queue: Gurmeet Kalra <gurmeetk@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1492297}
>
> Bug: 381541583
> Change-Id: Ia6028d2d204f607cc0d6acc2908db1ab89c5a379
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6807752
> Owners-Override: Andrew Grieve <agrieve@chromium.org>
> Commit-Queue: Gurmeet Kalra <gurmeetk@google.com>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Victor Tan <victortan@chromium.org>
> Reviewed-by: Alexander Cooper <alcooper@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1499390}

Bug: 381541583
Change-Id: I55683fee7faade10c506a9e8395283dda74fbeee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6830099
Owners-Override: James Lee <ljjlee@google.com>
Reviewed-by: Ivana Žužić <izuzic@google.com>
Commit-Queue: James Lee <ljjlee@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1499471}
14 files changed
tree: 4b91c165d1b9e60e6f26649bf05302c9afe47b51
  1. .gemini/
  2. .github/
  3. agents/
  4. android_webview/
  5. apps/
  6. ash/
  7. base/
  8. build/
  9. build_overrides/
  10. buildtools/
  11. cc/
  12. chrome/
  13. chromecast/
  14. chromeos/
  15. codelabs/
  16. components/
  17. content/
  18. crypto/
  19. dbus/
  20. device/
  21. docs/
  22. extensions/
  23. fuchsia_web/
  24. gin/
  25. google_apis/
  26. gpu/
  27. headless/
  28. infra/
  29. ios/
  30. ipc/
  31. media/
  32. mojo/
  33. net/
  34. pdf/
  35. printing/
  36. remoting/
  37. rlz/
  38. sandbox/
  39. services/
  40. skia/
  41. sql/
  42. storage/
  43. styleguide/
  44. testing/
  45. third_party/
  46. tools/
  47. ui/
  48. url/
  49. webkit/
  50. .clang-format
  51. .clang-tidy
  52. .clangd
  53. .cursorignore
  54. .geminiignore
  55. .git-blame-ignore-revs
  56. .gitallowed
  57. .gitattributes
  58. .gitignore
  59. .gitmodules
  60. .gn
  61. .mailmap
  62. .rustfmt.toml
  63. .vpython3
  64. .yapfignore
  65. ATL_OWNERS
  66. AUTHORS
  67. BUILD.gn
  68. CODE_OF_CONDUCT.md
  69. codereview.settings
  70. CPPLINT.cfg
  71. CRYPTO_OWNERS
  72. DEPS
  73. DIR_METADATA
  74. LICENSE
  75. LICENSE.chromium_os
  76. OWNERS
  77. PRESUBMIT.py
  78. PRESUBMIT_test.py
  79. PRESUBMIT_test_mocks.py
  80. README.md
  81. SECURITY_OWNERS
  82. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure.

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.