diff --git a/DEPS b/DEPS
index b6334c3..16ebd02 100644
--- a/DEPS
+++ b/DEPS
@@ -200,11 +200,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '7bce89d89d4bb26068689a8ab48e5a5767be0a7c',
+  'skia_revision': '888c5d3e57eb197c4d9abcc35966d9bc97f38d1d',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': '0652fd726a951b9275547e541b83703cf77c35b0',
+  'v8_revision': 'c38503fc1652232c4e2f897daf4501b9d98db210',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
@@ -212,7 +212,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling ANGLE
   # and whatever else without interference from each other.
-  'angle_revision': '130597e10299d995f9d9eed6ec17e6d7d1f8f2be',
+  'angle_revision': 'bb4f496d2a32aa2c872f1d998c6d12e738e72a65',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling SwiftShader
   # and whatever else without interference from each other.
@@ -251,7 +251,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling freetype
   # and whatever else without interference from each other.
-  'freetype_revision': '5abd252a0a26a878c6b7830f10e0611f1d6c0425',
+  'freetype_revision': '3facafa44e2ac49ac15359bf6c83110614a6cbf7',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling freetype
   # and whatever else without interference from each other.
@@ -275,7 +275,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling devtools-frontend
   # and whatever else without interference from each other.
-  'devtools_frontend_revision': '4c3d711704c16cd8ae2a0668bc6fe004fc2bce29',
+  'devtools_frontend_revision': '16534e267df0a1783928b6658a0d128cfc8e3393',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libprotobuf-mutator
   # and whatever else without interference from each other.
@@ -327,7 +327,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'dawn_revision': '70102b71900bd6938eaa65c92da700aa549efc6e',
+  'dawn_revision': 'a66263753a9f31ae9fa05af4f5ef0b18924d0b8e',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -563,7 +563,7 @@
   },
 
   'src/ios/third_party/material_components_ios/src': {
-      'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '77c77dc0f8ac9da6d3a1e127df40049924cdb18b',
+      'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '732e39b160d73545a7c1aad6bfd43df1d5e88198',
       'condition': 'checkout_ios',
   },
 
@@ -914,12 +914,12 @@
 
   # For Linux and Chromium OS.
   'src/third_party/cros_system_api': {
-      'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'dfd19c1b9bbc15cf406bb524640182649be2733d',
+      'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'f6d74c196c6cf15e6b40ad80895dddfbebc5b374',
       'condition': 'checkout_linux',
   },
 
   'src/third_party/depot_tools':
-    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '8820ab859bea6cf5ed2751c9373098a688ad1a03',
+    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'a3762a907c027cebe689598d4eed2953dfba4614',
 
   'src/third_party/devtools-frontend/src':
     Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'),
@@ -1274,7 +1274,7 @@
     Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '3dd5b80bc4f172dd82925bb259cb7c82348409c5',
 
   'src/third_party/openscreen/src':
-    Var('chromium_git') + '/openscreen' + '@' + '759af7f402131028b48a107ca33d4b1ee2fdaeb6',
+    Var('chromium_git') + '/openscreen' + '@' + '9be11f7d2b44dff83dc88dff054b967a43f319cc',
 
   'src/third_party/openxr/src': {
     'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '97cfe495bb7a3853266b646d1c79e169387f9c7a',
@@ -1551,7 +1551,7 @@
   },
 
   'src/third_party/webrtc':
-    Var('webrtc_git') + '/src.git' + '@' + 'bafeede2b523627a2c36b4e5b508a8c0b41acea0',
+    Var('webrtc_git') + '/src.git' + '@' + '9db3ab201ec73d5bbc547ebe2701b4695d1e281f',
 
   'src/third_party/libgifcodec':
      Var('skia_git') + '/libgifcodec' + '@'+  Var('libgifcodec_revision'),
@@ -1589,7 +1589,7 @@
       'packages': [
         {
           'package': 'skia/tools/goldctl/linux-amd64',
-          'version': 'F1V3MxURYBy3ZkQCqWrW-_qo1aZFer1oyHdGOjT_CZoC',
+          'version': '842QUO-MpflGgchXvHN0-IEpA_FH3eL4HOaIeKB0sAMC',
         },
       ],
       'dep_type': 'cipd',
@@ -1599,7 +1599,7 @@
       'packages': [
         {
           'package': 'skia/tools/goldctl/windows-amd64',
-          'version': 'qZ2Cb5DPSSKjIrxhfYGgVzooq2ElNVLxNOVjsMKgfV0C',
+          'version': '9XBfTB1PaL2DnAog4fEW0HecdwaTtGmhegLuMd87NSgC',
         },
       ],
       'dep_type': 'cipd',
@@ -1609,7 +1609,7 @@
       'packages': [
         {
           'package': 'skia/tools/goldctl/mac-amd64',
-          'version': 'Z_FxtkL4vnfqaGkZhy2qkTcVwRXIfMzIP0gDJO5O6HkC',
+          'version': 'T2HJY_715FIKLpfyNtrKmYlYSVasNqMJxv6eqm41UBEC',
         },
       ],
       'dep_type': 'cipd',
@@ -1623,7 +1623,7 @@
     Var('chromium_git') + '/v8/v8.git' + '@' +  Var('v8_revision'),
 
   'src-internal': {
-    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@724b0bf4449d7f361cab700772453c2cd28153b9',
+    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@1bb4e5eef6d35a46aeb7b2ed24e60aafc912af1d',
     'condition': 'checkout_src_internal',
   },
 
@@ -2243,7 +2243,7 @@
       'packages': [
           {
               'package': 'chromium/third_party/android_deps/libs/androidx_recyclerview_recyclerview',
-              'version': 'version:1.1.0-cr0',
+              'version': 'version:1.2.0-alpha06-cr0',
           },
       ],
       'condition': 'checkout_android',
@@ -2485,7 +2485,7 @@
       'packages': [
           {
               'package': 'chromium/third_party/android_deps/libs/androidx_viewpager2_viewpager2',
-              'version': 'version:1.0.0-cr0',
+              'version': 'version:1.1.0-SNAPSHOT-cr0',
           },
       ],
       'condition': 'checkout_android',
@@ -2496,7 +2496,7 @@
       'packages': [
           {
               'package': 'chromium/third_party/android_deps/libs/androidx_viewpager_viewpager',
-              'version': 'version:1.0.0-cr0',
+              'version': 'version:1.1.0-SNAPSHOT-cr0',
           },
       ],
       'condition': 'checkout_android',
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index d0242739..95bbb145 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -289,16 +289,22 @@
   Shelf* shelf = Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow());
   // Tell the focus direction to the status area or the shelf so they can focus
   // the correct child view.
-  if (reverse || !shelf->shelf_widget()->login_shelf_view()->IsFocusable()) {
-    if (!Shell::GetPrimaryRootWindowController()->IsSystemTrayVisible())
-      return;
+  if (Shell::GetPrimaryRootWindowController()->IsSystemTrayVisible() &&
+      (reverse || !shelf->shelf_widget()->login_shelf_view()->IsFocusable())) {
+    // Focus goes to system tray (status area) if one of the following is true:
+    //  - system tray is visible and tab is in reverse order;
+    //  - system tray is visible and there is no visible shelf buttons before.
     shelf->GetStatusAreaWidget()
         ->status_area_widget_delegate()
         ->set_default_last_focusable_child(reverse);
     Shell::Get()->focus_cycler()->FocusWidget(shelf->GetStatusAreaWidget());
-  } else {
+  } else if (shelf->shelf_widget()->login_shelf_view()->IsFocusable()) {
+    // Otherwise focus goes to shelf buttons when there is any.
     shelf->shelf_widget()->set_default_last_focusable_child(reverse);
     Shell::Get()->focus_cycler()->FocusWidget(shelf->shelf_widget());
+  } else {
+    // No elements to focus on the shelf.
+    NOTREACHED();
   }
 }
 
diff --git a/ash/magnifier/docked_magnifier_controller_impl.cc b/ash/magnifier/docked_magnifier_controller_impl.cc
index 513a8fad..a03167e 100644
--- a/ash/magnifier/docked_magnifier_controller_impl.cc
+++ b/ash/magnifier/docked_magnifier_controller_impl.cc
@@ -235,8 +235,9 @@
   // 1- Scale the layer by |scale|.
   // 2- Translate the point of interest to the center point of the viewport
   //    widget.
-  const gfx::Point viewport_center_point =
-      GetViewportWidgetBoundsInRoot(current_source_root_window_).CenterPoint();
+  const gfx::Rect viewport_widget_bounds =
+      GetViewportWidgetBoundsInRoot(current_source_root_window_);
+  const gfx::Point viewport_center_point = viewport_widget_bounds.CenterPoint();
   gfx::Transform transform;
   transform.Translate(viewport_center_point.x() - point_in_pixels.x(),
                       viewport_center_point.y() - point_in_pixels.y());
@@ -252,6 +253,29 @@
   settings.SetTweenType(gfx::Tween::ZERO);
   settings.SetPreemptionStrategy(ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET);
   viewport_magnifier_layer_->SetTransform(transform);
+
+  // Also make sure |point_of_interest|'s y-coordinate doesn't go below
+  // the minimum height.
+  if (point_of_interest.y() < minimum_point_of_interest_height_)
+    point_of_interest.set_y(minimum_point_of_interest_height_);
+
+  // Send changed magnified region bounds to accessibility controller,
+  // triggering accessibility manager to dispatch an accessibility private
+  // OnMagnifierBoundsChanged event, which will be listened for by magnifier.js,
+  // which keeps track of the last magnified region bounds, to help when
+  // deciding where to next move the magnified region.
+  // |viewport_widget_bounds| represents the full-width docked magnifier panel
+  // at the top of the screen. Shrink this by the current magnifier |scale| to
+  // get the actual zoomed-in width and height of the magnified area.
+  const int width = viewport_widget_bounds.width() / scale;
+  const int height = viewport_widget_bounds.height() / scale;
+  const int x = point_of_interest.x() - width / 2;
+  const int y = point_of_interest.y() - height / 2;
+  gfx::Rect magnified_region_bounds(x, y, width, height);
+  ::wm::ConvertRectToScreen(root_window, &magnified_region_bounds);
+
+  Shell::Get()->accessibility_controller()->MagnifierBoundsChanged(
+      magnified_region_bounds);
 }
 
 int DockedMagnifierControllerImpl::GetMagnifierHeightForTesting() const {
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc
index 2fe056c..a8a796e 100644
--- a/ash/shelf/login_shelf_view.cc
+++ b/ash/shelf/login_shelf_view.cc
@@ -579,12 +579,16 @@
     // Focus should leave the system tray.
     Shell::Get()->system_tray_notifier()->NotifyFocusOut(reverse);
   } else {
-    // Focus goes to status area.
     StatusAreaWidget* status_area_widget =
         Shelf::ForWindow(GetWidget()->GetNativeWindow())->GetStatusAreaWidget();
-    status_area_widget->status_area_widget_delegate()
-        ->set_default_last_focusable_child(reverse);
-    Shell::Get()->focus_cycler()->FocusWidget(status_area_widget);
+    // Focus goes to status area if it is visible.
+    if (status_area_widget->IsVisible()) {
+      status_area_widget->status_area_widget_delegate()
+          ->set_default_last_focusable_child(reverse);
+      Shell::Get()->focus_cycler()->FocusWidget(status_area_widget);
+    } else {
+      Shell::Get()->system_tray_notifier()->NotifyFocusOut(reverse);
+    }
   }
 }
 
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index fe1aad4..c828403a 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -1151,7 +1151,7 @@
 
 void ShelfLayoutManager::OnCenterVisibilityChanged(
     message_center::Visibility visibility) {
-  // Uses base::CancelableClosure to handle two edge cases: (1)
+  // Uses base::CancelableOnceClosure to handle two edge cases: (1)
   // ShelfLayoutManager is destructed before the callback runs. (2) The previous
   // callback is still pending.
   visibility_update_for_tray_callback_.Reset(base::BindOnce(
diff --git a/ash/system/unified/managed_device_tray_item_view.cc b/ash/system/unified/managed_device_tray_item_view.cc
index feb0d33..73a38375 100644
--- a/ash/system/unified/managed_device_tray_item_view.cc
+++ b/ash/system/unified/managed_device_tray_item_view.cc
@@ -16,6 +16,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "chromeos/strings/grit/chromeos_strings.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/controls/image_view.h"
 
@@ -63,7 +64,7 @@
     SetVisible(true);
     if (!enterprise_domain_manager.empty()) {
       image_view()->SetTooltipText(l10n_util::GetStringFUTF16(
-          IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+          IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
           base::UTF8ToUTF16(enterprise_domain_manager)));
     } else {
       image_view()->SetTooltipText(base::string16());
diff --git a/ash/system/unified/unified_managed_device_view.cc b/ash/system/unified/unified_managed_device_view.cc
index 5fbcac8..e58cc13 100644
--- a/ash/system/unified/unified_managed_device_view.cc
+++ b/ash/system/unified/unified_managed_device_view.cc
@@ -19,6 +19,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "chromeos/strings/grit/chromeos_strings.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
@@ -96,9 +97,11 @@
 
     base::string16 managed_string =
         enterprise_domain_manager.empty()
-            ? l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED)
+            ? l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED,
+                                         ui::GetChromeOSDeviceName())
             : l10n_util::GetStringFUTF16(
                   IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+                  ui::GetChromeOSDeviceName(),
                   base::UTF8ToUTF16(enterprise_domain_manager));
     label_->SetText(managed_string);
     SetAccessibleName(managed_string);
diff --git a/ash/system/unified/unified_system_info_view.cc b/ash/system/unified/unified_system_info_view.cc
index fb760556..d3fd01fb 100644
--- a/ash/system/unified/unified_system_info_view.cc
+++ b/ash/system/unified/unified_system_info_view.cc
@@ -27,6 +27,7 @@
 #include "chromeos/strings/grit/chromeos_strings.h"
 #include "ui/accessibility/ax_enums.mojom.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/accessibility/view_accessibility.h"
 #include "ui/views/animation/ink_drop_highlight.h"
@@ -350,11 +351,11 @@
              !model->enterprise_domain_manager().empty());
 
   if (model->active_directory_managed()) {
-    SetTooltipText(
-        l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED));
+    SetTooltipText(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED,
+                                              ui::GetChromeOSDeviceName()));
   } else if (!model->enterprise_domain_manager().empty()) {
     SetTooltipText(l10n_util::GetStringFUTF16(
-        IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+        IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
         base::UTF8ToUTF16(model->enterprise_domain_manager())));
   }
 }
diff --git a/base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java b/base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java
index b0462a2..33091d22 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java
@@ -108,7 +108,7 @@
      * Native method used to add a zip archive or APK to the search path
      * for native libraries. Allows loading directly from it.
      *
-     * @param zipfilePath Path of the zip file containing the libraries.
+     * @param zipFilePath Path of the zip file containing the libraries.
      * @return true for success, false otherwise.
      */
     private static native boolean nativeAddZipArchivePath(String zipFilePath);
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java
index 798acb5..38565169 100644
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java
@@ -98,7 +98,7 @@
  *
  *  - The browser is in charge of deciding where in memory each library should
  *    be loaded. This address must be passed to each service process (see
- *    ChromiumLinkerParams.java in //content for a helper class to do so).
+ *    {@link org.chromium.content.app.ChromiumLinkerParams} for a helper class to do so).
  *
  *  - The browser will also generate shared RELRO for the loaded library.
  *
diff --git a/base/android/linker/modern_linker_jni.cc b/base/android/linker/modern_linker_jni.cc
index 119260e..33c0dde 100644
--- a/base/android/linker/modern_linker_jni.cc
+++ b/base/android/linker/modern_linker_jni.cc
@@ -439,7 +439,7 @@
   }
 
   if (!CallJniOnLoad(handle))
-    return false;
+    return -1;
 
   return relro_fd;
 }
diff --git a/base/power_monitor/power_monitor.cc b/base/power_monitor/power_monitor.cc
index c0825205..d6aa6956 100644
--- a/base/power_monitor/power_monitor.cc
+++ b/base/power_monitor/power_monitor.cc
@@ -53,11 +53,19 @@
   return g_is_process_suspended.load(std::memory_order_relaxed);
 }
 
+// static
 PowerObserver::DeviceThermalState PowerMonitor::GetCurrentThermalState() {
   DCHECK(IsInitialized());
   return GetInstance()->source_->GetCurrentThermalState();
 }
 
+// static
+void PowerMonitor::SetCurrentThermalState(
+    PowerObserver::DeviceThermalState state) {
+  DCHECK(IsInitialized());
+  GetInstance()->source_->SetCurrentThermalState(state);
+}
+
 #if defined(OS_ANDROID)
 int PowerMonitor::GetRemainingBatteryCapacity() {
   DCHECK(IsInitialized());
diff --git a/base/power_monitor/power_monitor.h b/base/power_monitor/power_monitor.h
index 08946d9d..5be1764a 100644
--- a/base/power_monitor/power_monitor.h
+++ b/base/power_monitor/power_monitor.h
@@ -61,6 +61,9 @@
   // May only be called if the PowerMonitor has been initialized.
   static PowerObserver::DeviceThermalState GetCurrentThermalState();
 
+  // Update the result of thermal state.
+  static void SetCurrentThermalState(PowerObserver::DeviceThermalState state);
+
 #if defined(OS_ANDROID)
   // Read and return the current remaining battery capacity (microampere-hours).
   // Only supported with a device power source (i.e. not in child processes in
diff --git a/base/power_monitor/power_monitor_device_source.h b/base/power_monitor/power_monitor_device_source.h
index 4bfc479..c09a6a4 100644
--- a/base/power_monitor/power_monitor_device_source.h
+++ b/base/power_monitor/power_monitor_device_source.h
@@ -49,6 +49,11 @@
   static void HandleSystemSuspending();
   static void HandleSystemResumed();
   static void ThermalEventReceived(PowerObserver::DeviceThermalState state);
+
+  // These two methods is used for handling thermal state update requests, such
+  // as asking for initial state when starting lisitening to thermal change.
+  PowerObserver::DeviceThermalState GetCurrentThermalState() override;
+  void SetCurrentThermalState(PowerObserver::DeviceThermalState state) override;
 #endif
 
  private:
@@ -125,6 +130,10 @@
   PowerMessageWindow power_message_window_;
 #endif
 
+#if defined(OS_CHROMEOS)
+  PowerObserver::DeviceThermalState current_thermal_state_ =
+      PowerObserver::DeviceThermalState::kUnknown;
+#endif
   DISALLOW_COPY_AND_ASSIGN(PowerMonitorDeviceSource);
 };
 
diff --git a/base/power_monitor/power_monitor_device_source_chromeos.cc b/base/power_monitor/power_monitor_device_source_chromeos.cc
index 58b3264..79533d5 100644
--- a/base/power_monitor/power_monitor_device_source_chromeos.cc
+++ b/base/power_monitor/power_monitor_device_source_chromeos.cc
@@ -40,7 +40,22 @@
 // static
 void PowerMonitorDeviceSource::ThermalEventReceived(
     PowerObserver::DeviceThermalState state) {
+  if (!PowerMonitor::IsInitialized()) {
+    PowerMonitor::Initialize(std::make_unique<PowerMonitorDeviceSource>());
+  }
+  PowerMonitor::SetCurrentThermalState(state);
+
   ProcessThermalEvent(state);
 }
 
+PowerObserver::DeviceThermalState
+PowerMonitorDeviceSource::GetCurrentThermalState() {
+  return current_thermal_state_;
+}
+
+void PowerMonitorDeviceSource::SetCurrentThermalState(
+    PowerObserver::DeviceThermalState state) {
+  current_thermal_state_ = state;
+}
+
 }  // namespace base
diff --git a/base/power_monitor/power_monitor_source.cc b/base/power_monitor/power_monitor_source.cc
index 46bad20..ff985812 100644
--- a/base/power_monitor/power_monitor_source.cc
+++ b/base/power_monitor/power_monitor_source.cc
@@ -21,6 +21,9 @@
   return PowerObserver::DeviceThermalState::kUnknown;
 }
 
+void PowerMonitorSource::SetCurrentThermalState(
+    PowerObserver::DeviceThermalState state) {}
+
 #if defined(OS_ANDROID)
 int PowerMonitorSource::GetRemainingBatteryCapacity() {
   return 0;
diff --git a/base/power_monitor/power_monitor_source.h b/base/power_monitor/power_monitor_source.h
index ec98304a..951c65b7 100644
--- a/base/power_monitor/power_monitor_source.h
+++ b/base/power_monitor/power_monitor_source.h
@@ -36,6 +36,9 @@
   // Otherwise, returns kUnknown.
   virtual PowerObserver::DeviceThermalState GetCurrentThermalState();
 
+  // Update the result of thermal state.
+  virtual void SetCurrentThermalState(PowerObserver::DeviceThermalState state);
+
 #if defined(OS_ANDROID)
   // Read and return the current remaining battery capacity (microampere-hours).
   virtual int GetRemainingBatteryCapacity();
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1
index ee5d2c3b..1d1adb8 100644
--- a/build/fuchsia/linux.sdk.sha1
+++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@
-0.20201124.4.1
+0.20201125.1.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1
index ee5d2c3b..1d1adb8 100644
--- a/build/fuchsia/mac.sdk.sha1
+++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@
-0.20201124.4.1
+0.20201125.1.1
diff --git a/chrome/android/expectations/lint-suppressions.xml b/chrome/android/expectations/lint-suppressions.xml
index 38615bc..3a66aab7 100644
--- a/chrome/android/expectations/lint-suppressions.xml
+++ b/chrome/android/expectations/lint-suppressions.xml
@@ -50,7 +50,9 @@
   <issue id="InsecureBaseConfiguration">
     <!-- See https://crbug.com/827265 and comment in the file for context. -->
     <ignore regexp="chrome/android/java/res_base/xml/network_security_config.xml"/>
-  </issue>
+  </issue> 
+  <!-- Androidx InvalidSetHasFixedSize lint check is buggy. crbug.com/1151562 -->
+  <issue id="InvalidSetHasFixedSize" severity="ignore"/>
   <issue id="InvalidVectorPath" severity="ignore"/>
   <issue id="LogConditional" severity="ignore"/>
   <issue id="LongLogTag" severity="ignore"/>
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerView.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerView.java
index 05450e73..08d3e67 100644
--- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerView.java
+++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerView.java
@@ -14,11 +14,15 @@
 import androidx.appcompat.widget.AppCompatImageView;
 import androidx.swiperefreshlayout.widget.CircularProgressDrawable;
 
+import org.chromium.base.FeatureList;
+import org.chromium.base.TraceEvent;
 import org.chromium.chrome.R;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
 
 /** View that shows a Material themed spinner. */
 public class MaterialSpinnerView extends AppCompatImageView {
     private final CircularProgressDrawable mSpinner;
+    private final boolean mAlwaysAnimate;
 
     public MaterialSpinnerView(Context context) {
         this(context, null);
@@ -33,6 +37,7 @@
     @SuppressWarnings({"nullness:argument.type.incompatible", "nullness:method.invocation.invalid"})
     public MaterialSpinnerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
+        TraceEvent.begin("MaterialSpinnerView");
         mSpinner = new CircularProgressDrawable(context);
         mSpinner.setStyle(CircularProgressDrawable.DEFAULT);
         setImageDrawable(mSpinner);
@@ -40,19 +45,45 @@
         Theme theme = context.getTheme();
         theme.resolveAttribute(R.attr.feedSpinnerColor, typedValue, true);
         mSpinner.setColorSchemeColors(typedValue.data);
-
-        if (getVisibility() == View.VISIBLE) {
-            mSpinner.start();
-        }
+        mAlwaysAnimate = FeatureList.isInitialized() ? ChromeFeatureList.isEnabled(
+                                 ChromeFeatureList.INTEREST_FEED_SPINNER_ALWAYS_ANIMATE)
+                                                     : false;
+        updateAnimationState(isAttachedToWindow());
+        TraceEvent.end("MaterialSpinnerView");
     }
 
     @Override
-    public void setVisibility(int visibility) {
-        super.setVisibility(visibility);
+    protected void onVisibilityChanged(View changedView, int visibility) {
+        super.onVisibilityChanged(changedView, visibility);
+        updateAnimationState(isAttachedToWindow());
+    }
 
-        if (mSpinner.isRunning() && getVisibility() != View.VISIBLE) {
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        updateAnimationState(/*isAttached=*/true);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        // isAttachedToWindow() doesn't turn false during onDetachedFromWindow(), so we pass the new
+        // attachment state into updateAnimationState() here explicitly.
+        updateAnimationState(/*isAttached=*/false);
+        super.onDetachedFromWindow();
+    }
+
+    private void updateAnimationState(boolean isAttached) {
+        // TODO(crbug.com/1151391): This feature is used for A:B testing to determine the impact of
+        // a bug fix. Remove after experiment is complete.
+        if (mAlwaysAnimate) {
+            if (!mSpinner.isRunning()) mSpinner.start();
+            return;
+        }
+
+        boolean visible = isShown() && isAttached;
+        if (mSpinner.isRunning() && !visible) {
             mSpinner.stop();
-        } else if (!mSpinner.isRunning() && getVisibility() == View.VISIBLE) {
+        } else if (!mSpinner.isRunning() && visible) {
             mSpinner.start();
         }
     }
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerViewTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerViewTest.java
index 22924a4..5996ca5 100644
--- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerViewTest.java
+++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/shared/ui/MaterialSpinnerViewTest.java
@@ -8,6 +8,7 @@
 
 import android.app.Activity;
 import android.view.View;
+import android.widget.FrameLayout;
 
 import androidx.swiperefreshlayout.widget.CircularProgressDrawable;
 
@@ -16,6 +17,7 @@
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
 import org.robolectric.annotation.Config;
+import org.robolectric.annotation.LooperMode;
 
 import org.chromium.chrome.R;
 import org.chromium.testing.local.LocalRobolectricTestRunner;
@@ -23,38 +25,52 @@
 /** Tests for {@link MaterialSpinnerView}. */
 @RunWith(LocalRobolectricTestRunner.class)
 @Config(manifest = Config.NONE)
+@LooperMode(LooperMode.Mode.PAUSED)
 public class MaterialSpinnerViewTest {
+    private FrameLayout mLayout;
     private MaterialSpinnerView mMaterialSpinnerView;
+    private CircularProgressDrawable mAnimationDrawable;
 
     @Before
     public void setUp() {
-        Activity context = Robolectric.buildActivity(Activity.class).get();
-        context.setTheme(R.style.Light);
-        mMaterialSpinnerView = new MaterialSpinnerView(context);
+        Activity activity = Robolectric.setupActivity(Activity.class);
+        activity.setTheme(R.style.Light);
+
+        // Attach the spinner inside a layout, so we can hide either the spinner
+        // or the parent view (ie. the layout) in the tests. Note that we
+        // require the looper to stay paused (LooperMode.Mode.PAUSED) for the
+        // duration of the tests. Otherwise, Robolectric will run through the
+        // animation and stop it before the tests get run. Because
+        // Robolectric.setupActivity() will run the looper until idle, we call
+        // setContentView() only after launching the activity above.
+        mMaterialSpinnerView = new MaterialSpinnerView(activity);
+        mAnimationDrawable = (CircularProgressDrawable) mMaterialSpinnerView.getDrawable();
+
+        mLayout = new FrameLayout(activity);
+        mLayout.addView(mMaterialSpinnerView);
+        activity.setContentView(mLayout);
     }
 
     @Test
     public void testInit_isVisible_spinnerStarted() {
         assertThat(mMaterialSpinnerView.getVisibility()).isEqualTo(View.VISIBLE);
+        assertThat(mMaterialSpinnerView.isShown()).isTrue();
 
-        assertThat(((CircularProgressDrawable) mMaterialSpinnerView.getDrawable()).isRunning())
-                .isTrue();
+        assertThat(mAnimationDrawable.isRunning()).isTrue();
     }
 
     @Test
     public void testSetVisibility_gone_stopsSpinner() {
         mMaterialSpinnerView.setVisibility(View.GONE);
 
-        assertThat(((CircularProgressDrawable) mMaterialSpinnerView.getDrawable()).isRunning())
-                .isFalse();
+        assertThat(mAnimationDrawable.isRunning()).isFalse();
     }
 
     @Test
     public void testSetVisibility_invisible_stopsSpinner() {
         mMaterialSpinnerView.setVisibility(View.INVISIBLE);
 
-        assertThat(((CircularProgressDrawable) mMaterialSpinnerView.getDrawable()).isRunning())
-                .isFalse();
+        assertThat(mAnimationDrawable.isRunning()).isFalse();
     }
 
     @Test
@@ -62,7 +78,43 @@
         mMaterialSpinnerView.setVisibility(View.GONE);
         mMaterialSpinnerView.setVisibility(View.VISIBLE);
 
-        assertThat(((CircularProgressDrawable) mMaterialSpinnerView.getDrawable()).isRunning())
-                .isTrue();
+        assertThat(mAnimationDrawable.isRunning()).isTrue();
+    }
+
+    @Test
+    public void testContainerSetVisibility_gone_stopsSpinner() {
+        mLayout.setVisibility(View.GONE);
+
+        assertThat(mAnimationDrawable.isRunning()).isFalse();
+    }
+
+    @Test
+    public void testContainerSetVisibility_invisible_stopsSpinner() {
+        mLayout.setVisibility(View.INVISIBLE);
+
+        assertThat(mAnimationDrawable.isRunning()).isFalse();
+    }
+
+    @Test
+    public void testContainerSetVisibility_toTrue_startsSpinner() {
+        mLayout.setVisibility(View.GONE);
+        mLayout.setVisibility(View.VISIBLE);
+
+        assertThat(mAnimationDrawable.isRunning()).isTrue();
+    }
+
+    @Test
+    public void testDetachFromWindow_stopsSpinner() {
+        mLayout.removeView(mMaterialSpinnerView);
+
+        assertThat(mAnimationDrawable.isRunning()).isFalse();
+    }
+
+    @Test
+    public void testAttachToWindow_startsSpinner() {
+        mLayout.removeView(mMaterialSpinnerView);
+        mLayout.addView(mMaterialSpinnerView);
+
+        assertThat(mAnimationDrawable.isRunning()).isTrue();
     }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentRequestService.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentRequestService.java
index 910c7b3..8d81d3b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentRequestService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentRequestService.java
@@ -237,11 +237,12 @@
         if (error != null) return error;
         // Calculate skip ui and build ui only after all payment apps are ready and
         // request.show() is called.
-        mShouldSkipShowingPaymentRequestUi = PaymentUiService.shouldSkipShowingPaymentRequestUi(
-                isUserGestureShow, mDelegate.skipUiForBasicCard(), mSpec.getPaymentOptions(),
-                mSpec.getMethodData().keySet(),
-                (PaymentApp) mPaymentUiService.getSelectedPaymentApp(),
-                mPaymentUiService.getPaymentAppsInPaymentAppList());
+        mShouldSkipShowingPaymentRequestUi =
+                PaymentRequestService.shouldSkipShowingPaymentRequestUi(isUserGestureShow,
+                        mDelegate.skipUiForBasicCard(), mSpec.getPaymentOptions(),
+                        mSpec.getMethodData().keySet(),
+                        (PaymentApp) mPaymentUiService.getSelectedPaymentApp(),
+                        mPaymentUiService.getPaymentAppsInPaymentAppList());
         if (!mShouldSkipShowingPaymentRequestUi && mSkipToGPayHelper == null) {
             mPaymentUiService.getPaymentRequestUI().show(isShowWaitingForUpdatedDetails);
         }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java
index bc53431..f3d994cd0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java
@@ -52,7 +52,6 @@
 import org.chromium.components.autofill.Completable;
 import org.chromium.components.autofill.EditableOption;
 import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerProvider;
-import org.chromium.components.embedder_support.util.UrlConstants;
 import org.chromium.components.payments.AbortReason;
 import org.chromium.components.payments.BasicCardUtils;
 import org.chromium.components.payments.CurrencyFormatter;
@@ -1426,35 +1425,6 @@
     }
 
     /**
-     * @param options The payment options specified in the payment request.
-     * @param allApps All available payment apps.
-     * @return true when there is exactly one available payment app which can provide all requested
-     * information including shipping address and payer's contact information whenever needed.
-     */
-    private static boolean onlySingleAppCanProvideAllRequiredInformation(
-            PaymentOptions options, List<PaymentApp> allApps) {
-        if (!PaymentOptionsUtils.requestAnyInformation(options)) {
-            return allApps.size() == 1 && !((PaymentApp) allApps.get(0)).isAutofillInstrument();
-        }
-
-        boolean anAppCanProvideAllInfo = false;
-        for (int i = 0; i < allApps.size(); i++) {
-            PaymentApp app = (PaymentApp) allApps.get(i);
-            if ((!options.requestShipping || app.handlesShippingAddress())
-                    && (!options.requestPayerName || app.handlesPayerName())
-                    && (!options.requestPayerPhone || app.handlesPayerPhone())
-                    && (!options.requestPayerEmail || app.handlesPayerEmail())) {
-                // There is more than one available app that can provide all merchant requested
-                // information information.
-                if (anAppCanProvideAllInfo) return false;
-
-                anAppCanProvideAllInfo = true;
-            }
-        }
-        return anAppCanProvideAllInfo;
-    }
-
-    /**
      * Update the details related fields on the PaymentRequest UI.
      * @param details The details whose information is used for the update.
      */
@@ -1479,54 +1449,6 @@
         updateAppModifiedTotals();
     }
 
-    /**
-     * @param methods The payment methods supported by the payment request.
-     * @return True when at least one url payment method identifier is specified in payment
-     *         request.
-     */
-    private static boolean isUrlPaymentMethodIdentifiersSupported(Set<String> methods) {
-        for (String methodName : methods) {
-            if (methodName.startsWith(UrlConstants.HTTPS_URL_PREFIX)
-                    || methodName.startsWith(UrlConstants.HTTP_URL_PREFIX)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param isUserGestureShow Whether the PaymentRequest.show() is triggered by user gesture.
-     * @param skipUiForNonUrlPaymentMethodIdentifiers True when skip UI is available for non-url
-     *         based payment method identifiers (e.g., basic-card).
-     * @param options The payment options specified in the payment request.
-     * @param paymentMethods The payment methods supported by this request.
-     * @param selectedApp The selected payment apps.
-     * @param allApps All available payment apps.
-     * @return Whether the browser payment sheet should be skipped directly into the payment app.
-     */
-    public static boolean shouldSkipShowingPaymentRequestUi(boolean isUserGestureShow,
-            boolean skipUiForNonUrlPaymentMethodIdentifiers, PaymentOptions options,
-            Set<String> paymentMethods, PaymentApp selectedApp, List<PaymentApp> allApps) {
-        boolean urlPaymentMethodIdentifiersSupported =
-                isUrlPaymentMethodIdentifiersSupported(paymentMethods);
-
-        // If there is only a single payment app which can provide all merchant requested
-        // information, we can safely go directly to the payment app instead of showing Payment
-        // Request UI.
-        return PaymentFeatureList.isEnabled(PaymentFeatureList.WEB_PAYMENTS_SINGLE_APP_UI_SKIP)
-                // Only allowing payment apps that own their own UIs.
-                // This excludes AutofillPaymentInstrument as its UI is rendered inline in
-                // the payment request UI, thus can't be skipped.
-                && (urlPaymentMethodIdentifiersSupported || skipUiForNonUrlPaymentMethodIdentifiers)
-                && allApps.size() >= 1
-                && onlySingleAppCanProvideAllRequiredInformation(options, allApps)
-                // Skip to payment app only if it can be pre-selected.
-                && selectedApp != null
-                // Skip to payment app only if user gesture is provided when it is required to
-                // skip-UI.
-                && (isUserGestureShow || !selectedApp.isUserGestureRequiredToSkipUi());
-    }
-
     /** Removes all of the observers that observe users leaving the tab. */
     public void removeLeavingTabObservers() {
         if (mObservedTabModelSelector != null) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountConsistencyPromoAction.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountConsistencyPromoAction.java
index 21ce1ae..ed51376 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountConsistencyPromoAction.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountConsistencyPromoAction.java
@@ -19,7 +19,7 @@
 @IntDef({
         AccountConsistencyPromoAction.SUPPRESSED_NO_ACCOUNTS,
         AccountConsistencyPromoAction.DISMISSED_BACK,
-        AccountConsistencyPromoAction.ADD_ACCOUNT,
+        AccountConsistencyPromoAction.ADD_ACCOUNT_STARTED,
         AccountConsistencyPromoAction.STARTED_INCOGNITO_SESSION,
         AccountConsistencyPromoAction.SIGNED_IN_WITH_DEFAULT_ACCOUNT,
         AccountConsistencyPromoAction.SIGNED_IN_WITH_NON_DEFAULT_ACCOUNT,
@@ -32,6 +32,7 @@
         AccountConsistencyPromoAction.AUTH_ERROR_SHOWN,
         AccountConsistencyPromoAction.GENERIC_ERROR_SHOWN,
         AccountConsistencyPromoAction.DISMISSED_BUTTON,
+        AccountConsistencyPromoAction.ADD_ACCOUNT_COMPLETED,
 })
 @Retention(RetentionPolicy.SOURCE)
 public @interface AccountConsistencyPromoAction {
@@ -48,7 +49,7 @@
     /**
      * User has tapped |Add account to device| from expanded account list.
      */
-    int ADD_ACCOUNT = 2;
+    int ADD_ACCOUNT_STARTED = 2;
 
     /**
      * User tapped the button from the expanded account list to open the incognito interstitial
@@ -115,5 +116,10 @@
      */
     int DISMISSED_BUTTON = 14;
 
-    int MAX = 15;
+    /**
+     * User has completed the account addition flow triggered from the bottom sheet.
+     */
+    int ADD_ACCOUNT_COMPLETED = 15;
+
+    int MAX = 16;
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerBottomSheetMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerBottomSheetMediator.java
index 48673df..3abd75a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerBottomSheetMediator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerBottomSheetMediator.java
@@ -89,9 +89,11 @@
     @Override
     public void addAccount() {
         AccountPickerDelegate.recordAccountConsistencyPromoAction(
-                AccountConsistencyPromoAction.ADD_ACCOUNT);
+                AccountConsistencyPromoAction.ADD_ACCOUNT_STARTED);
         mAccountPickerDelegate.addAccount(accountName -> {
             mAddedAccountName = accountName;
+            AccountPickerDelegate.recordAccountConsistencyPromoAction(
+                    AccountConsistencyPromoAction.ADD_ACCOUNT_COMPLETED);
             onAccountSelected(accountName, false);
         });
     }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java
index b9da3988..1d82711 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java
@@ -374,8 +374,9 @@
     @Test
     @MediumTest
     public void testSigninWithAddedAccount() {
-        MetricsUtils.HistogramDelta addAccountHistogram = new HistogramDelta(
-                "Signin.AccountConsistencyPromoAction", AccountConsistencyPromoAction.ADD_ACCOUNT);
+        MetricsUtils.HistogramDelta addAccountHistogram =
+                new HistogramDelta("Signin.AccountConsistencyPromoAction",
+                        AccountConsistencyPromoAction.ADD_ACCOUNT_STARTED);
         MetricsUtils.HistogramDelta signedInWithAddedAccountHistogram =
                 new HistogramDelta("Signin.AccountConsistencyPromoAction",
                         AccountConsistencyPromoAction.SIGNED_IN_WITH_ADDED_ACCOUNT);
@@ -513,8 +514,12 @@
     @Test
     @MediumTest
     public void testAddAccountOnExpandedSheet() {
-        MetricsUtils.HistogramDelta accountConsistencyHistogram = new HistogramDelta(
-                "Signin.AccountConsistencyPromoAction", AccountConsistencyPromoAction.ADD_ACCOUNT);
+        MetricsUtils.HistogramDelta addAccountStartedHistogram =
+                new HistogramDelta("Signin.AccountConsistencyPromoAction",
+                        AccountConsistencyPromoAction.ADD_ACCOUNT_STARTED);
+        MetricsUtils.HistogramDelta addAccountCompletedHistogram =
+                new HistogramDelta("Signin.AccountConsistencyPromoAction",
+                        AccountConsistencyPromoAction.ADD_ACCOUNT_COMPLETED);
         buildAndShowExpandedBottomSheet();
         onVisibleView(withText(R.string.signin_add_account_to_device)).perform(click());
         verify(mAccountPickerDelegateMock).addAccount(callbackArgumentCaptor.capture());
@@ -525,7 +530,8 @@
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> callback.onResult(profileDataAdded.getAccountEmail()));
         checkCollapsedAccountList(profileDataAdded);
-        Assert.assertEquals(1, accountConsistencyHistogram.getDelta());
+        Assert.assertEquals(1, addAccountStartedHistogram.getDelta());
+        Assert.assertEquals(1, addAccountCompletedHistogram.getDelta());
     }
 
     @Test
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 92772b1..b32b7287 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -9752,6 +9752,21 @@
       <message name="IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there are multiple monitors.">
         {SCREEN_INDEX, plural, =1{Screen #} other{Screen #}}
       </message>
+
+      <!-- Confirmation dialog for getCurrentBrowsingContextMedia API -->
+      <message name="IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE" desc="Title for the confirmation dialog shown when getCurrentBrowsingContextMedia is requested by an app.">
+        Share this tab
+      </message>
+      <message name="IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TEXT_REQUESTED_BY_APP" desc="Text for the confirmation dialog shown when getCurrentBrowsingContextMedia is requested by an app.">
+        <ph name="TARGET_NAME">$1<ex>https://google.com</ex></ph> is asking for permission to capture the contents of this tab.
+      </message>
+      <message name="IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_AUDIO_SHARE" desc="Text for the checkbox on the confirmation dialog for getCurrentBrowsingContextMedia API, when checked, audio will be shared, otherwise just video sharing">
+        Share audio
+      </message>
+      <message name="IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_SHARE_BUTTON" desc="Used for Share on buttons">
+        Share
+      </message>
+
       <!-- Local Device Discovery display strings -->
       <if expr="enable_service_discovery">
         <message name="IDS_LOCAL_DISCOVERY_NOTIFICATION_TITLE_PRINTER" desc="Title of notification for one or more new printer showing up on your network. [ICU Syntax]">
@@ -10020,6 +10035,9 @@
       <message name="IDS_DEVICE_LOG_TYPE_SERIAL" desc="Checkbox to enable showing events related to serial devices">
         Serial
       </message>
+      <message name="IDS_DEVICE_LOG_TYPE_CAMERA" desc="Checkbox to enable showing events of type Camera">
+        Camera
+      </message>
       <message name="IDS_DEVICE_LOG_FILEINFO" desc="File info checkbox in device event log">
         File Info
       </message>
diff --git a/chrome/app/generated_resources_grd/IDS_DEVICE_LOG_TYPE_CAMERA.png.sha1 b/chrome/app/generated_resources_grd/IDS_DEVICE_LOG_TYPE_CAMERA.png.sha1
new file mode 100644
index 0000000..95936e8
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_DEVICE_LOG_TYPE_CAMERA.png.sha1
@@ -0,0 +1 @@
+4ea28d176af17a37e870a8aca31cea3df106d488
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_AUDIO_SHARE.png.sha1 b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_AUDIO_SHARE.png.sha1
new file mode 100644
index 0000000..dbb7865
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_AUDIO_SHARE.png.sha1
@@ -0,0 +1 @@
+282e4397adbf6cbc51adad6fca84783715c4681a
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_SHARE_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_SHARE_BUTTON.png.sha1
new file mode 100644
index 0000000..dbb7865
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_SHARE_BUTTON.png.sha1
@@ -0,0 +1 @@
+282e4397adbf6cbc51adad6fca84783715c4681a
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TEXT_REQUESTED_BY_APP.png.sha1 b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TEXT_REQUESTED_BY_APP.png.sha1
new file mode 100644
index 0000000..bd215cf
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TEXT_REQUESTED_BY_APP.png.sha1
@@ -0,0 +1 @@
+0836b3016785247f5f95badc7df41abdbf791747
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE.png.sha1
new file mode 100644
index 0000000..dbb7865
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE.png.sha1
@@ -0,0 +1 @@
+282e4397adbf6cbc51adad6fca84783715c4681a
\ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index b053344..3b8931f 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright 2014 The Chromium Authors.All rights reserved.
+# Copyright 2014 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD - style license that can be
 # found in the LICENSE file.
 
@@ -1151,6 +1151,8 @@
     "permissions/last_tab_standing_tracker_observer.h",
     "permissions/last_tab_standing_tracker_tab_helper.cc",
     "permissions/last_tab_standing_tracker_tab_helper.h",
+    "permissions/permission_auditing_service_factory.cc",
+    "permissions/permission_auditing_service_factory.h",
     "permissions/permission_decision_auto_blocker_factory.cc",
     "permissions/permission_decision_auto_blocker_factory.h",
     "permissions/permission_manager_factory.cc",
@@ -2378,6 +2380,7 @@
       "//chromeos/components/help_app_ui",
       "//chromeos/components/help_app_ui:mojo_bindings",
       "//chromeos/components/local_search_service",
+      "//chromeos/components/local_search_service/public/cpp:cpp",
       "//chromeos/components/local_search_service/public/mojom",
       "//chromeos/components/media_app_ui",
       "//chromeos/components/media_app_ui:mojo_bindings",
@@ -4572,6 +4575,7 @@
       "//chromeos/crosapi/mojom",
       "//chromeos/lacros",
       "//chromeos/ui/frame",
+      "//components/account_manager_core",
     ]
   }
 
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 7335cb0..a27273a 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -6832,6 +6832,17 @@
      flag_descriptions::kSwipeToMoveCursorDescription, kOsAndroid,
      FEATURE_VALUE_TYPE(features::kSwipeToMoveCursor)},
 #endif  // defined(OS_ANDROID)
+    {"change-password-affiliation",
+     flag_descriptions::kChangePasswordAffiliationInfoName,
+     flag_descriptions::kChangePasswordAffiliationInfoDescription, kOsAll,
+     FEATURE_VALUE_TYPE(
+         password_manager::features::kUseOfHashAffiliationFetcher)},
+
+    {"use-of-hash-affiliation-fetcher",
+     flag_descriptions::kUseOfHashAffiliationFetcherName,
+     flag_descriptions::kUseOfHashAffiliationFetcherDescription, kOsAll,
+     FEATURE_VALUE_TYPE(
+         password_manager::features::kUseOfHashAffiliationFetcher)},
 
     // NOTE: Adding a new flag requires adding a corresponding entry to enum
     // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
diff --git a/chrome/browser/android/vr/autocomplete_controller.cc b/chrome/browser/android/vr/autocomplete_controller.cc
index 25340084..b8afda7 100644
--- a/chrome/browser/android/vr/autocomplete_controller.cc
+++ b/chrome/browser/android/vr/autocomplete_controller.cc
@@ -96,7 +96,7 @@
   suggestions_timeout_.Cancel();
 
   if (suggestions.size() < kMaxNumberOfSuggestions) {
-    suggestions_timeout_.Reset(base::BindRepeating(
+    suggestions_timeout_.Reset(base::BindOnce(
         suggestion_callback_, base::Passed(std::move(suggestions))));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, suggestions_timeout_.callback(),
diff --git a/chrome/browser/android/vr/autocomplete_controller.h b/chrome/browser/android/vr/autocomplete_controller.h
index d2a79dc..3a98147 100644
--- a/chrome/browser/android/vr/autocomplete_controller.h
+++ b/chrome/browser/android/vr/autocomplete_controller.h
@@ -56,7 +56,7 @@
   // will wait for a period of time after the receipt of each suggestion and
   // batch incoming suggestions that arrive before that period of time has been
   // exceeded.
-  base::CancelableCallback<void()> suggestions_timeout_;
+  base::CancelableOnceClosure suggestions_timeout_;
 
   DISALLOW_COPY_AND_ASSIGN(AutocompleteController);
 };
diff --git a/chrome/browser/android/vr/vr_shell.cc b/chrome/browser/android/vr/vr_shell.cc
index 5ea1d1c..0aadf69 100644
--- a/chrome/browser/android/vr/vr_shell.cc
+++ b/chrome/browser/android/vr/vr_shell.cc
@@ -863,8 +863,8 @@
 }
 
 void VrShell::PollCapturingState() {
-  poll_capturing_state_task_.Reset(base::BindRepeating(
-      &VrShell::PollCapturingState, base::Unretained(this)));
+  poll_capturing_state_task_.Reset(
+      base::BindOnce(&VrShell::PollCapturingState, base::Unretained(this)));
   main_thread_task_runner_->PostDelayedTask(
       FROM_HERE, poll_capturing_state_task_.callback(),
       kPollCapturingStateInterval);
diff --git a/chrome/browser/android/vr/vr_shell.h b/chrome/browser/android/vr/vr_shell.h
index 6e020aff..b107310 100644
--- a/chrome/browser/android/vr/vr_shell.h
+++ b/chrome/browser/android/vr/vr_shell.h
@@ -346,7 +346,7 @@
 
   mojo::Remote<device::mojom::GeolocationConfig> geolocation_config_;
 
-  base::CancelableClosure poll_capturing_state_task_;
+  base::CancelableOnceClosure poll_capturing_state_task_;
   CapturingStateModel active_capturing_;
   CapturingStateModel background_capturing_;
   CapturingStateModel potential_capturing_;
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
index 0d9e110f..83366156 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -352,7 +352,7 @@
 
   // To detect tasks that are causing slow deletions, record running sub tasks
   // after a delay.
-  slow_pending_tasks_closure_.Reset(base::BindRepeating(
+  slow_pending_tasks_closure_.Reset(base::BindOnce(
       &ChromeBrowsingDataRemoverDelegate::RecordUnfinishedSubTasks,
       weak_ptr_factory_.GetWeakPtr()));
   content::GetUIThreadTaskRunner({})->PostDelayedTask(
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h
index ae0d556..a23314d2 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h
@@ -305,7 +305,7 @@
 
   // Fires after some time to track slow tasks. Cancelled when all tasks
   // are finished.
-  base::CancelableClosure slow_pending_tasks_closure_;
+  base::CancelableOnceClosure slow_pending_tasks_closure_;
 
   DomainReliabilityClearer domain_reliability_clearer_;
 
diff --git a/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc b/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc
index a21e73e..35d43c0 100644
--- a/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc
+++ b/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc
@@ -131,7 +131,7 @@
 
 // Tests that for the empty cache, the result is zero.
 // Flaky. See crbug.com/971650.
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
 #define MAYBE_Empty DISABLED_Empty
 #else
 #define MAYBE_Empty Empty
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index 7bb0ee1..3e4c78fe 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -648,6 +648,8 @@
     "arc/fileapi/arc_documents_provider_file_stream_reader.h",
     "arc/fileapi/arc_documents_provider_file_stream_writer.cc",
     "arc/fileapi/arc_documents_provider_file_stream_writer.h",
+    "arc/fileapi/arc_documents_provider_file_system_url_util.cc",
+    "arc/fileapi/arc_documents_provider_file_system_url_util.h",
     "arc/fileapi/arc_documents_provider_root.cc",
     "arc/fileapi/arc_documents_provider_root.h",
     "arc/fileapi/arc_documents_provider_root_map.cc",
@@ -3698,6 +3700,7 @@
     "policy/device_dock_mac_address_source_handler_unittest.cc",
     "policy/device_local_account_policy_service_unittest.cc",
     "policy/device_policy_decoder_chromeos_unittest.cc",
+    "policy/dlp/data_transfer_dlp_controller_unittest.cc",
     "policy/dlp/dlp_content_manager_unittest.cc",
     "policy/dlp/dlp_content_tab_helper_unittest.cc",
     "policy/dlp/dlp_rules_manager_test_utils.cc",
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_reader.cc b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_reader.cc
index 2cabfdb..ce56676 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_reader.cc
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_reader.cc
@@ -9,9 +9,7 @@
 #include "base/bind.h"
 #include "base/callback_helpers.h"
 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_file_stream_reader.h"
-#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h"
-#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_map.h"
-#include "content/public/browser/browser_task_traits.h"
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h"
 #include "content/public/browser/browser_thread.h"
 #include "net/base/io_buffer.h"
 #include "net/base/net_errors.h"
@@ -22,55 +20,16 @@
 
 namespace arc {
 
-namespace {
-
-void OnResolveToContentUrlOnUIThread(
-    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback,
-    const GURL& url) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  content::GetIOThreadTaskRunner({})->PostTask(
-      FROM_HERE, base::BindOnce(std::move(callback), url));
-}
-
-void ResolveToContentUrlOnUIThread(
-    const storage::FileSystemURL& url,
-    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
-  ArcDocumentsProviderRootMap* roots =
-      ArcDocumentsProviderRootMap::GetForArcBrowserContext();
-  if (!roots) {
-    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
-    return;
-  }
-
-  base::FilePath path;
-  ArcDocumentsProviderRoot* root = roots->ParseAndLookup(url, &path);
-  if (!root) {
-    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
-    return;
-  }
-
-  root->ResolveToContentUrl(
-      path,
-      base::BindOnce(&OnResolveToContentUrlOnUIThread, std::move(callback)));
-}
-
-}  // namespace
-
 ArcDocumentsProviderFileStreamReader::ArcDocumentsProviderFileStreamReader(
     const storage::FileSystemURL& url,
     int64_t offset)
     : offset_(offset), content_url_resolved_(false) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
-  content::GetUIThreadTaskRunner({})->PostTask(
-      FROM_HERE,
-      base::BindOnce(
-          &ResolveToContentUrlOnUIThread, url,
-          base::BindOnce(
-              &ArcDocumentsProviderFileStreamReader::OnResolveToContentUrl,
-              weak_ptr_factory_.GetWeakPtr())));
+  ResolveToContentUrlOnIOThread(
+      url, base::BindOnce(
+               &ArcDocumentsProviderFileStreamReader::OnResolveToContentUrl,
+               weak_ptr_factory_.GetWeakPtr()));
 }
 
 ArcDocumentsProviderFileStreamReader::~ArcDocumentsProviderFileStreamReader() {
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_writer.cc b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_writer.cc
index 654f710..166738ea 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_writer.cc
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream_writer.cc
@@ -9,9 +9,7 @@
 #include "base/bind.h"
 #include "base/callback_helpers.h"
 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_file_stream_writer.h"
-#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h"
-#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_map.h"
-#include "content/public/browser/browser_task_traits.h"
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h"
 #include "content/public/browser/browser_thread.h"
 #include "net/base/io_buffer.h"
 #include "net/base/net_errors.h"
@@ -21,42 +19,6 @@
 
 namespace arc {
 
-namespace {
-
-void OnResolveToContentUrlOnUIThread(
-    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback,
-    const GURL& url) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  content::GetIOThreadTaskRunner({})->PostTask(
-      FROM_HERE, base::BindOnce(std::move(callback), url));
-}
-
-void ResolveToContentUrlOnUIThread(
-    const storage::FileSystemURL& url,
-    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
-  ArcDocumentsProviderRootMap* roots =
-      ArcDocumentsProviderRootMap::GetForArcBrowserContext();
-  if (!roots) {
-    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
-    return;
-  }
-
-  base::FilePath path;
-  ArcDocumentsProviderRoot* root = roots->ParseAndLookup(url, &path);
-  if (!root) {
-    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
-    return;
-  }
-
-  root->ResolveToContentUrl(
-      path,
-      base::BindOnce(&OnResolveToContentUrlOnUIThread, std::move(callback)));
-}
-
-}  // namespace
-
 ArcDocumentsProviderFileStreamWriter::ArcDocumentsProviderFileStreamWriter(
     const storage::FileSystemURL& url,
     int64_t offset)
@@ -82,13 +44,11 @@
 
     // Resolve the |arc_url_| to a Content URL to instantiate the underlying
     // writer.
-    content::GetUIThreadTaskRunner({})->PostTask(
-        FROM_HERE,
+    ResolveToContentUrlOnIOThread(
+        arc_url_,
         base::BindOnce(
-            &ResolveToContentUrlOnUIThread, arc_url_,
-            base::BindOnce(
-                &ArcDocumentsProviderFileStreamWriter::OnResolveToContentUrl,
-                weak_ptr_factory_.GetWeakPtr())));
+            &ArcDocumentsProviderFileStreamWriter::OnResolveToContentUrl,
+            weak_ptr_factory_.GetWeakPtr()));
 
     return net::ERR_IO_PENDING;
   }
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.cc b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.cc
new file mode 100644
index 0000000..4f898ca
--- /dev/null
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.cc
@@ -0,0 +1,63 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h"
+
+#include "base/bind.h"
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_map.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+#include "url/gurl.h"
+
+using content::BrowserThread;
+
+namespace arc {
+
+namespace {
+
+void OnResolveToContentUrlOnUIThread(
+    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback,
+    const GURL& url) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  content::GetIOThreadTaskRunner({})->PostTask(
+      FROM_HERE, base::BindOnce(std::move(callback), url));
+}
+
+void ResolveToContentUrlOnUIThread(
+    const storage::FileSystemURL& url,
+    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+  ArcDocumentsProviderRootMap* roots =
+      ArcDocumentsProviderRootMap::GetForArcBrowserContext();
+  if (!roots) {
+    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
+    return;
+  }
+
+  base::FilePath path;
+  ArcDocumentsProviderRoot* root = roots->ParseAndLookup(url, &path);
+  if (!root) {
+    OnResolveToContentUrlOnUIThread(std::move(callback), GURL());
+    return;
+  }
+
+  root->ResolveToContentUrl(
+      path,
+      base::BindOnce(&OnResolveToContentUrlOnUIThread, std::move(callback)));
+}
+
+}  // namespace
+
+void ResolveToContentUrlOnIOThread(
+    const storage::FileSystemURL& url,
+    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  content::GetUIThreadTaskRunner({})->PostTask(
+      FROM_HERE,
+      base::BindOnce(&ResolveToContentUrlOnUIThread, url, std::move(callback)));
+}
+
+}  // namespace arc
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h
new file mode 100644
index 0000000..1575eb4d
--- /dev/null
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_system_url_util.h
@@ -0,0 +1,20 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_FILE_SYSTEM_URL_UTIL_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_FILE_SYSTEM_URL_UTIL_H_
+
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h"
+#include "storage/browser/file_system/file_system_url.h"
+
+namespace arc {
+
+// Converts a FilesystemURL to ARC content URL on the IO thread.
+void ResolveToContentUrlOnIOThread(
+    const storage::FileSystemURL& url,
+    ArcDocumentsProviderRoot::ResolveToContentUrlCallback callback);
+
+}  // namespace arc
+
+#endif  // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_FILE_SYSTEM_URL_UTIL_H_
diff --git a/chrome/browser/chromeos/input_method/input_method_configuration.cc b/chrome/browser/chromeos/input_method/input_method_configuration.cc
index 9d793c25..20a0a294 100644
--- a/chrome/browser/chromeos/input_method/input_method_configuration.cc
+++ b/chrome/browser/chromeos/input_method/input_method_configuration.cc
@@ -9,6 +9,7 @@
 #include "base/bind.h"
 #include "base/logging.h"
 #include "chrome/browser/chromeos/input_method/accessibility.h"
+#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_delegate_impl.h"
 #include "chrome/browser/chromeos/input_method/input_method_delegate_impl.h"
 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
 #include "chrome/browser/chromeos/input_method/input_method_persistence.h"
@@ -30,7 +31,8 @@
     ui::IMEBridge::Initialize();
 
     auto* impl = new InputMethodManagerImpl(
-        std::unique_ptr<InputMethodDelegate>(new InputMethodDelegateImpl),
+        std::make_unique<InputMethodDelegateImpl>(),
+        std::make_unique<ComponentExtensionIMEManagerDelegateImpl>(),
         !g_disable_extension_loading);
     InputMethodManager::Initialize(impl);
 
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 015e302..acca0d5 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -31,7 +31,6 @@
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/chromeos/input_method/assistive_window_controller.h"
 #include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
-#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_delegate_impl.h"
 #include "chrome/browser/chromeos/input_method/ui/assistive_delegate.h"
 #include "chrome/browser/chromeos/input_method/ui/input_method_menu_item.h"
 #include "chrome/browser/chromeos/input_method/ui/input_method_menu_manager.h"
@@ -956,6 +955,8 @@
 
 InputMethodManagerImpl::InputMethodManagerImpl(
     std::unique_ptr<InputMethodDelegate> delegate,
+    std::unique_ptr<ComponentExtensionIMEManagerDelegate>
+        component_extension_ime_manager_delegate,
     bool enable_extension_loading)
     : delegate_(std::move(delegate)),
       util_(delegate_.get()),
@@ -969,9 +970,8 @@
     keyboard_ = std::make_unique<FakeImeKeyboard>();
   }
   // Initializes the system IME list.
-  std::unique_ptr<ComponentExtensionIMEManagerDelegate> comp_delegate(
-      new ComponentExtensionIMEManagerDelegateImpl());
-  component_extension_ime_manager_->Initialize(std::move(comp_delegate));
+  component_extension_ime_manager_->Initialize(
+      std::move(component_extension_ime_manager_delegate));
   const InputMethodDescriptors& descriptors =
       component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor();
   util_.ResetInputMethods(descriptors);
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.h b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
index 51b1ebb..87255e73 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.h
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
@@ -191,6 +191,8 @@
   // calling |SetUISessionState| in response to relevant changes in browser
   // state.
   InputMethodManagerImpl(std::unique_ptr<InputMethodDelegate> delegate,
+                         std::unique_ptr<ComponentExtensionIMEManagerDelegate>
+                             component_extension_ime_manager_delegate,
                          bool enable_extension_loading);
   ~InputMethodManagerImpl() override;
 
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
index d10b1b1..0b7a9f0 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -17,6 +17,7 @@
 #include "base/macros.h"
 #include "base/run_loop.h"
 #include "base/test/task_environment.h"
+#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_delegate_impl.h"
 #include "chrome/browser/chromeos/input_method/mock_candidate_window_controller.h"
 #include "chrome/browser/chromeos/input_method/mock_input_method_engine.h"
 #include "chrome/browser/profiles/profile_manager.h"
@@ -139,7 +140,8 @@
     ui::InitializeInputMethodForTesting();
 
     manager_ = std::make_unique<InputMethodManagerImpl>(
-        std::make_unique<FakeInputMethodDelegate>(), false);
+        std::make_unique<FakeInputMethodDelegate>(),
+        std::make_unique<ComponentExtensionIMEManagerDelegateImpl>(), false);
     manager_->GetInputMethodUtil()->UpdateHardwareLayoutCache();
     candidate_window_controller_ = new MockCandidateWindowController;
     manager_->SetCandidateWindowControllerForTesting(
@@ -159,6 +161,8 @@
     // Needs ash::Shell keyboard to be created first.
     chrome_keyboard_controller_client_test_helper_ =
         ChromeKeyboardControllerClientTestHelper::InitializeForAsh();
+
+    InitComponentExtension();
   }
 
   void TearDown() override {
@@ -173,7 +177,7 @@
     manager_.reset();
   }
 
- protected:
+ private:
   // Helper function to initialize component extension stuff for testing.
   void InitComponentExtension() {
     // CreateNewState(nullptr) returns state with non-empty
@@ -201,7 +205,6 @@
     manager_->InitializeComponentExtensionForTesting(std::move(delegate));
   }
 
- private:
   void InitImeList() {
     ime_list_.clear();
 
@@ -387,7 +390,6 @@
   keyboard_layouts.emplace_back("xkb:us::eng");
 
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   menu_manager_->AddObserver(&observer);
   EXPECT_EQ(0, observer.input_method_changed_count_);
@@ -436,7 +438,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestGetSupportedInputMethods) {
-  InitComponentExtension();
   InputMethodDescriptors methods;
   methods = manager_->GetComponentExtensionIMEManager()
                 ->GetXkbIMEAsInputMethodDescriptor();
@@ -461,7 +462,6 @@
   // ibus_input_method.txt.
   std::vector<std::string> keyboard_layouts;
 
-  InitComponentExtension();
   manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
   EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
 
@@ -477,7 +477,6 @@
   std::vector<std::string> keyboard_layouts;
   keyboard_layouts.push_back(ImeIdFromEngineId("xkb:se::swe"));
 
-  InitComponentExtension();
   manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
   const std::string im_id =
       manager_->GetActiveIMEState()->GetCurrentInputMethod().id();
@@ -485,7 +484,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestEnableLayoutsNonUsHardwareKeyboard) {
-  InitComponentExtension();
   // The physical layout is French.
   manager_->GetInputMethodUtil()->SetHardwareKeyboardLayoutForTesting(
       "xkb:fr::fra");
@@ -515,7 +513,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestEnableMultipleHardwareKeyboardLayout) {
-  InitComponentExtension();
   // The physical layouts are French and Hungarian.
   manager_->GetInputMethodUtil()->SetHardwareKeyboardLayoutForTesting(
       "xkb:fr::fra,xkb:hu::hun");
@@ -528,7 +525,6 @@
 
 TEST_F(InputMethodManagerImplTest,
        TestEnableMultipleHardwareKeyboardLayout_NoLoginKeyboard) {
-  InitComponentExtension();
   // The physical layouts are English (US) and Russian.
   manager_->GetInputMethodUtil()->SetHardwareKeyboardLayoutForTesting(
       "xkb:us::eng,xkb:ru::rus");
@@ -539,7 +535,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestActiveInputMethods) {
-  InitComponentExtension();
   std::vector<std::string> keyboard_layouts;
   manager_->GetActiveIMEState()->EnableLoginLayouts(
       "ja", keyboard_layouts);  // Japanese
@@ -560,7 +555,6 @@
 TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) {
   // For http://crbug.com/19655#c11 - (8), step 6.
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -587,7 +581,6 @@
 TEST_F(InputMethodManagerImplTest, TestEnableThreeLayouts) {
   // For http://crbug.com/19655#c11 - (9).
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
@@ -619,7 +612,6 @@
 TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme) {
   // For http://crbug.com/19655#c11 - (10).
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -647,7 +639,6 @@
 TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme2) {
   // For http://crbug.com/19655#c11 - (11).
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -670,7 +661,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestEnableImes) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId(kExt2Engine1Id));
@@ -685,7 +675,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestEnableUnknownIds) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.emplace_back("xkb:tl::tlh");  // Klingon, which is not supported.
@@ -702,7 +691,6 @@
 TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
   // For http://crbug.com/19655#c11 - (14).
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
@@ -751,7 +739,6 @@
 TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
   // For http://crbug.com/19655#c11 - (15).
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -802,9 +789,7 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestXkbSetting) {
-  EXPECT_EQ(0, keyboard_->set_current_keyboard_layout_by_name_count_);
   // For http://crbug.com/19655#c11 - (8), step 7-11.
-  InitComponentExtension();
   EXPECT_EQ(1, keyboard_->set_current_keyboard_layout_by_name_count_);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -852,7 +837,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
-  InitComponentExtension();
   EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
 
   std::vector<std::string> ids;
@@ -879,7 +863,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {
-  InitComponentExtension();
   EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
 
   std::vector<std::string> ids;
@@ -917,7 +900,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestNextInputMethod) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> keyboard_layouts;
   keyboard_layouts.push_back(ImeIdFromEngineId("xkb:us::eng"));
@@ -973,7 +955,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestLastUsedInputMethod) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
 
   std::vector<std::string> keyboard_layouts;
@@ -1028,8 +1009,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, CycleInputMethodForOneActiveInputMethod) {
-  InitComponentExtension();
-
   // Simulate a single input method.
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
@@ -1049,7 +1028,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
@@ -1136,7 +1114,6 @@
 
 TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
   TestObserver observer;
-  InitComponentExtension();
   manager_->AddObserver(&observer);
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
@@ -1217,7 +1194,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, ChangeInputMethodComponentExtensionOneIME) {
-  InitComponentExtension();
   const std::string ext_id = extension_ime_util::GetComponentInputMethodID(
       ime_list_[1].id,
       ime_list_[1].engines[0].engine_id);
@@ -1230,7 +1206,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, ChangeInputMethodComponentExtensionTwoIME) {
-  InitComponentExtension();
   const std::string ext_id1 = extension_ime_util::GetComponentInputMethodID(
       ime_list_[1].id,
       ime_list_[1].engines[0].engine_id);
@@ -1271,8 +1246,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, OverrideKeyboardUrlRefWithKeyset) {
-  InitComponentExtension();
-
   // Create an input method with a input view URL for testing.
   const GURL inputview_url(
       "chrome-extension://"
@@ -1327,8 +1300,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, OverrideDefaultKeyboardUrlRef) {
-  InitComponentExtension();
-
   const GURL default_url("chrome://inputview.html");
 
   const auto ime_id =
@@ -1351,8 +1322,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, DoesNotResetInputViewUrlWhenOverridden) {
-  InitComponentExtension();
-
   // Create an input method with a input view URL for testing.
   const GURL inputview_url(
       "chrome-extension://"
@@ -1389,8 +1358,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, AllowedKeyboardLayoutsValid) {
-  InitComponentExtension();
-
   // First, setup xkb:fr::fra input method
   std::string original_input_method(ImeIdFromEngineId("xkb:fr::fra"));
   ASSERT_TRUE(
@@ -1413,8 +1380,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, AllowedKeyboardLayoutsInvalid) {
-  InitComponentExtension();
-
   // First, setup xkb:fr::fra input method
   std::string original_input_method(ImeIdFromEngineId("xkb:fr::fra"));
   ASSERT_TRUE(
@@ -1435,8 +1400,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, AllowedKeyboardLayoutsValidAndInvalid) {
-  InitComponentExtension();
-
   // First, enable xkb:fr::fra and xkb:de::ger
   std::string original_input_method_1(ImeIdFromEngineId("xkb:fr::fra"));
   std::string original_input_method_2(ImeIdFromEngineId("xkb:de::ger"));
@@ -1464,8 +1427,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, AllowedKeyboardLayoutsAndExtensions) {
-  InitComponentExtension();
-
   EXPECT_TRUE(manager_->GetActiveIMEState()->EnableInputMethod(
       ImeIdFromEngineId(kNaclMozcJpId)));
   EXPECT_TRUE(manager_->GetActiveIMEState()->EnableInputMethod(
@@ -1484,8 +1445,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, SetLoginDefaultWithAllowedKeyboardLayouts) {
-  InitComponentExtension();
-
   std::vector<std::string> allowed = {"xkb:us::eng", "xkb:de::ger",
                                       "xkb:fr::fra"};
   EXPECT_TRUE(
@@ -1505,7 +1464,6 @@
   ime_controller_client.Init();
 
   // Setup 3 IMEs.
-  InitComponentExtension();
   std::vector<std::string> ids;
   ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
   ids.push_back(ImeIdFromEngineId(kExt2Engine2Id));
@@ -1580,8 +1538,6 @@
 }
 
 TEST_F(InputMethodManagerImplTest, TestAddRemoveArcInputMethods) {
-  InitComponentExtension();
-
   // There is one default IME
   EXPECT_EQ(1u, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
 
diff --git a/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc b/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc
index facc98b..04fbe61 100644
--- a/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc
+++ b/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc
@@ -84,6 +84,25 @@
 constexpr char kPrivacyPolicyPath[] = "/policies/privacy/";
 constexpr char kPrivacyPolicyContent[] = "Arc Privarcy Policy for test.";
 
+constexpr char kArcTosID[] = "arc-tos";
+
+const test::UIPath kArcEnableBackupRestore = {kArcTosID,
+                                              "arcEnableBackupRestore"};
+const test::UIPath kArcEnableLocationService = {kArcTosID,
+                                                "arcEnableLocationService"};
+const test::UIPath kArcExtraContent = {kArcTosID, "arcExtraContent"};
+const test::UIPath kArcLocationService = {kArcTosID, "arcLocationService"};
+const test::UIPath kArcPolicyLink = {kArcTosID, "arcPolicyLink"};
+const test::UIPath kArcReviewSettingsCheckbox = {kArcTosID,
+                                                 "arcReviewSettingsCheckbox"};
+const test::UIPath kArcTosAcceptButton = {kArcTosID, "arcTosAcceptButton"};
+const test::UIPath kArcTosBackButton = {kArcTosID, "arcTosBackButton"};
+const test::UIPath kArcTosDialog = {kArcTosID, "arcTosDialog"};
+const test::UIPath kArcTosNextButton = {kArcTosID, "arcTosNextButton"};
+const test::UIPath kArcTosOverlayWebview = {kArcTosID, "arcTosOverlayWebview"};
+const test::UIPath kArcTosRetryButton = {kArcTosID, "arcTosRetryButton"};
+const test::UIPath kArcTosView = {kArcTosID, "arcTosView"};
+
 ArcPlayTermsOfServiceConsent BuildArcPlayTermsOfServiceConsent(bool accepted) {
   ArcPlayTermsOfServiceConsent play_consent;
   play_consent.set_status(accepted ? sync_pb::UserConsentTypes::GIVEN
@@ -243,8 +262,7 @@
   void WaitForTermsOfServiceWebViewToLoad() {
     OobeScreenWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait();
     test::OobeJS()
-        .CreateHasClassWaiter(true, "arc-tos-loaded",
-                              {"arc-tos-root", "arcTosDialog"})
+        .CreateHasClassWaiter(true, "arc-tos-loaded", kArcTosDialog)
         ->Wait();
   }
 
@@ -329,8 +347,7 @@
 IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, TermsOfServiceContent) {
   TriggerArcTosScreen();
   ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad());
-  EXPECT_EQ(kTosContent,
-            test::GetWebViewContents({"arc-tos-root", "arcTosView"}));
+  EXPECT_EQ(kTosContent, test::GetWebViewContents(kArcTosView));
 
   EXPECT_FALSE(screen_exit_result().has_value());
 }
@@ -341,15 +358,15 @@
   TriggerArcTosScreen();
   ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad());
   // By default, these paragraphs should be hidden.
-  test::OobeJS().ExpectHiddenPath({"arc-tos-root", "arcExtraContent"});
-  test::OobeJS().ExpectHiddenPath({"arc-tos-root", "arcTosAcceptButton"});
+  test::OobeJS().ExpectHiddenPath(kArcExtraContent);
+  test::OobeJS().ExpectHiddenPath(kArcTosAcceptButton);
 
   // Click on 'More' button.
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"});
+  test::OobeJS().ClickOnPath(kArcTosNextButton);
 
   // Paragraphs should now be visible.
-  test::OobeJS().ExpectHiddenPath({"arc-tos-root", "arcTosNextButton"});
-  test::OobeJS().ExpectVisiblePath({"arc-tos-root", "arcExtraContent"});
+  test::OobeJS().ExpectHiddenPath(kArcTosNextButton);
+  test::OobeJS().ExpectVisiblePath(kArcExtraContent);
 
   EXPECT_FALSE(screen_exit_result().has_value());
   EXPECT_THAT(histogram_tester_.GetAllSamples(
@@ -364,7 +381,7 @@
 IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, LearnMoreDialogs) {
   TriggerArcTosScreen();
   ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad());
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"});
+  test::OobeJS().ClickOnPath(kArcTosNextButton);
 
   // List of pairs of {html element ids, html pop up dialog id}.
   std::vector<std::pair<std::string, std::string>> learn_more_links{
@@ -378,14 +395,14 @@
     std::string popup_html_element_id;
     std::tie(html_element_id, popup_html_element_id) = pair;
     test::OobeJS().ExpectHasNoAttribute(
-        "open", {"arc-tos-root", popup_html_element_id, "helpDialog"});
-    test::OobeJS().ClickOnPath({"arc-tos-root", html_element_id});
+        "open", {kArcTosID, popup_html_element_id, "helpDialog"});
+    test::OobeJS().ClickOnPath({kArcTosID, html_element_id});
     test::OobeJS().ExpectHasAttribute(
-        "open", {"arc-tos-root", popup_html_element_id, "helpDialog"});
+        "open", {kArcTosID, popup_html_element_id, "helpDialog"});
     test::OobeJS().ClickOnPath(
-        {"arc-tos-root", popup_html_element_id, "closeButton"});
+        {kArcTosID, popup_html_element_id, "closeButton"});
     test::OobeJS().ExpectHasNoAttribute(
-        "open", {"arc-tos-root", popup_html_element_id, "helpDialog"});
+        "open", {kArcTosID, popup_html_element_id, "helpDialog"});
   }
   EXPECT_FALSE(screen_exit_result().has_value());
   EXPECT_THAT(
@@ -419,9 +436,9 @@
   EXPECT_FALSE(
       profile->GetPrefs()->GetBoolean(prefs::kShowArcSettingsOnSessionStart));
 
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"});
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcReviewSettingsCheckbox"});
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosAcceptButton"});
+  test::OobeJS().ClickOnPath(kArcTosNextButton);
+  test::OobeJS().ClickOnPath(kArcReviewSettingsCheckbox);
+  test::OobeJS().ClickOnPath(kArcTosAcceptButton);
 
   EXPECT_TRUE(
       profile->GetPrefs()->GetBoolean(prefs::kShowArcSettingsOnSessionStart));
@@ -457,11 +474,11 @@
   TriggerArcTosScreen();
   ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad());
 
-  WebViewLoadWaiter waiter({"arc-tos-root", "arcTosOverlayWebview"});
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"});
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcPolicyLink"});
+  WebViewLoadWaiter waiter(kArcTosOverlayWebview);
+  test::OobeJS().ClickOnPath(kArcTosNextButton);
+  test::OobeJS().ClickOnPath(kArcPolicyLink);
   waiter.Wait();
-  EXPECT_EQ(test::GetWebViewContents({"arc-tos-root", "arcTosOverlayWebview"}),
+  EXPECT_EQ(test::GetWebViewContents(kArcTosOverlayWebview),
             kPrivacyPolicyContent);
 
   EXPECT_THAT(
@@ -490,8 +507,8 @@
   TriggerArcTosScreen();
   WaitForTermsOfServiceWebViewToLoad();
 
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosRetryButton"});
-  test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosBackButton"});
+  test::OobeJS().ClickOnPath(kArcTosRetryButton);
+  test::OobeJS().ClickOnPath(kArcTosBackButton);
 
   WaitForScreenExitResult();
   EXPECT_EQ(screen_exit_result(), ArcTermsOfServiceScreen::Result::BACK);
@@ -544,12 +561,10 @@
       ArcGoogleLocationServiceConsent location_service_consent) {
     ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad());
 
-    test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"});
+    test::OobeJS().ClickOnPath(kArcTosNextButton);
 
     // Wait for checkboxes to become visible.
-    test::OobeJS()
-        .CreateVisibilityWaiter(true, {"arc-tos-root", "arcLocationService"})
-        ->Wait();
+    test::OobeJS().CreateVisibilityWaiter(true, kArcLocationService)->Wait();
 
     Profile* profile = ProfileManager::GetActiveUserProfile();
     FakeConsentAuditor* auditor = static_cast<FakeConsentAuditor*>(
@@ -557,10 +572,10 @@
             profile, base::BindRepeating(&BuildFakeConsentAuditor)));
 
     if (!accept_backup_restore_)
-      test::OobeJS().ClickOnPath({"arc-tos-root", "arcEnableBackupRestore"});
+      test::OobeJS().ClickOnPath(kArcEnableBackupRestore);
 
     if (!accept_location_service_) {
-      test::OobeJS().ClickOnPath({"arc-tos-root", "arcEnableLocationService"});
+      test::OobeJS().ClickOnPath(kArcEnableLocationService);
     }
 
     EXPECT_CALL(*auditor, RecordArcPlayConsent(
@@ -577,7 +592,7 @@
                             location_service_consent)));
 
     if (accept)
-      test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosAcceptButton"});
+      test::OobeJS().ClickOnPath(kArcTosAcceptButton);
   }
 
  protected:
diff --git a/chrome/browser/chromeos/login/demo_mode/demo_setup_browsertest.cc b/chrome/browser/chromeos/login/demo_mode/demo_setup_browsertest.cc
index d9f17a1..3bc485a 100644
--- a/chrome/browser/chromeos/login/demo_mode/demo_setup_browsertest.cc
+++ b/chrome/browser/chromeos/login/demo_mode/demo_setup_browsertest.cc
@@ -67,10 +67,6 @@
 
 namespace {
 
-constexpr char kIsConfirmationDialogHiddenQuery[] =
-    "!document.querySelector('.cr-dialog-container') || "
-    "!!document.querySelector('.cr-dialog-container').hidden";
-
 constexpr char kDefaultNetworkServicePath[] = "/service/eth1";
 constexpr char kDefaultNetworkName[] = "eth1";
 
@@ -127,7 +123,7 @@
   if (screen == EulaView::kScreenId)
     return "$('oobe-eula-md')";
   if (screen == ArcTermsOfServiceScreenView::kScreenId)
-    return "$('arc-tos-root')";
+    return "$('arc-tos')";
   if (screen == DemoSetupScreenView::kScreenId)
     return "$('demo-setup')";
   NOTREACHED() << "This OOBE screen is not a part of Demo Mode setup flow";
@@ -164,8 +160,14 @@
     return test::OobeJS().GetBool(query);
   }
 
-  bool IsConfirmationDialogShown() {
-    return !test::OobeJS().GetBool(kIsConfirmationDialogHiddenQuery);
+  void IsConfirmationDialogShown() {
+    test::OobeJS().ExpectHasAttribute(
+      "open", {"connect", "demoModeConfirmationDialog", "helpDialog"});
+  }
+
+  void IsConfirmationDialogHidden() {
+    test::OobeJS().ExpectHasNoAttribute(
+      "open", {"connect", "demoModeConfirmationDialog", "helpDialog"});
   }
 
   // TODO(michaelpg): Replace this with IsScreenDialogElementVisible, which is
@@ -258,11 +260,11 @@
   }
 
   void ClickOkOnConfirmationDialog() {
-    test::ExecuteOobeJS("document.querySelector('.cr-dialog-ok').click();");
+    test::OobeJS().TapOnPath({"connect", "okButton"});
   }
 
   void ClickCancelOnConfirmationDialog() {
-    test::ExecuteOobeJS("document.querySelector('.cr-dialog-cancel').click();");
+    test::OobeJS().TapOnPath({"connect", "cancelButton"});
   }
 
   // Simulates `button` click on a specified OOBE `screen`. Can be used for
@@ -482,14 +484,13 @@
 
 IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
                        ShowConfirmationDialogAndProceed) {
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   InvokeDemoModeWithAccelerator();
-  EXPECT_TRUE(IsConfirmationDialogShown());
+  IsConfirmationDialogShown();
 
   ClickOkOnConfirmationDialog();
 
-  WaitForJsCondition(kIsConfirmationDialogHiddenQuery);
   EXPECT_TRUE(IsScreenShown(DemoPreferencesScreenView::kScreenId));
 }
 
@@ -502,14 +503,14 @@
 #endif
 IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
                        MAYBE_ShowConfirmationDialogAndCancel) {
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   InvokeDemoModeWithAccelerator();
-  EXPECT_TRUE(IsConfirmationDialogShown());
+  IsConfirmationDialogShown();
 
   ClickCancelOnConfirmationDialog();
+  IsConfirmationDialogHidden();
 
-  WaitForJsCondition(kIsConfirmationDialogHiddenQuery);
   EXPECT_FALSE(IsScreenShown(DemoPreferencesScreenView::kScreenId));
 }
 
@@ -522,10 +523,10 @@
 IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, MAYBE_InvokeWithTaps) {
   // Use fake time to avoid flakiness.
   SetFakeTimeForMultiTapDetector(base::Time::UnixEpoch());
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   MultiTapOobeContainer(10);
-  EXPECT_TRUE(IsConfirmationDialogShown());
+  IsConfirmationDialogShown();
 }
 
 // TODO(crbug.com/1150349): Flaky on ChromeOS ASAN.
@@ -541,10 +542,10 @@
   // Use fake time to avoid flakiness.
   const base::Time kFakeTime = base::Time::UnixEpoch();
   SetFakeTimeForMultiTapDetector(kFakeTime);
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   MultiTapOobeContainer(5);
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   // Advance time to make interval in between taps longer than expected by
   // multi-tap gesture detector.
@@ -552,7 +553,7 @@
                                  base::TimeDelta::FromMilliseconds(500));
 
   MultiTapOobeContainer(5);
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 }
 
 // TODO(crbug.com/1150349): Flaky on ChromeOS ASAN.
@@ -1341,19 +1342,19 @@
 };
 
 IN_PROC_BROWSER_TEST_F(DemoSetupArcUnsupportedTest, DoNotStartWithAccelerator) {
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   InvokeDemoModeWithAccelerator();
 
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 }
 
 IN_PROC_BROWSER_TEST_F(DemoSetupArcUnsupportedTest, DoNotInvokeWithTaps) {
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 
   InvokeDemoModeWithTaps();
 
-  EXPECT_FALSE(IsConfirmationDialogShown());
+  IsConfirmationDialogHidden();
 }
 
 // Demo setup tests related to Force Re-Enrollment.
diff --git a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
index 9d3a9d8..a32353f 100644
--- a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc
@@ -41,6 +41,7 @@
 #include "ui/base/ime/chromeos/input_method_manager.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/chromeos/devicetype_utils.h"
 
 namespace em = enterprise_management;
 
@@ -239,7 +240,8 @@
 
   // Text on EnterpriseManagedView tooltip in current locale.
   base::string16 expected_text = l10n_util::GetStringFUTF16(
-      IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, base::UTF8ToUTF16(kDomain));
+      IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
+      base::UTF8ToUTF16(kDomain));
 
   EXPECT_EQ(expected_text, actual_text);
 }
diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc
index 9bf3771..659df4e 100644
--- a/chrome/browser/chromeos/login/login_utils_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc
@@ -66,6 +66,7 @@
   {
     base::RunLoop loop;
     WizardController::SkipPostLoginScreensForTesting();
+    EXPECT_FALSE(UserSessionInitializer::Get()->get_inited_for_testing());
     UserSessionInitializer::Get()->set_init_rlz_impl_closure_for_testing(
         loop.QuitClosure());
 
diff --git a/chrome/browser/chromeos/login/oobe_interactive_ui_test.cc b/chrome/browser/chromeos/login/oobe_interactive_ui_test.cc
index bed6a4c..a95560e 100644
--- a/chrome/browser/chromeos/login/oobe_interactive_ui_test.cc
+++ b/chrome/browser/chromeos/login/oobe_interactive_ui_test.cc
@@ -154,7 +154,7 @@
   if (arc_available) {
     test::OobeJS()
         .CreateHasClassWaiter(true, "arc-tos-loaded",
-                              {"arc-tos-root", "arcTosDialog"})
+                              {"arc-tos", "arcTosDialog"})
         ->Wait();
   }
 
@@ -225,17 +225,17 @@
   EXPECT_FALSE(ash::LoginScreenTestApi::IsAddUserButtonShown());
 
   test::OobeJS()
-      .CreateEnabledWaiter(true, {"arc-tos-root", "arcTosNextButton"})
+      .CreateEnabledWaiter(true, {"arc-tos", "arcTosNextButton"})
       ->Wait();
-  test::OobeJS().TapOnPath({"arc-tos-root", "arcTosNextButton"});
+  test::OobeJS().TapOnPath({"arc-tos", "arcTosNextButton"});
   test::OobeJS()
-      .CreateVisibilityWaiter(true, {"arc-tos-root", "arcLocationService"})
+      .CreateVisibilityWaiter(true, {"arc-tos", "arcLocationService"})
       ->Wait();
   test::OobeJS()
-      .CreateVisibilityWaiter(true, {"arc-tos-root", "arcTosAcceptButton"})
+      .CreateVisibilityWaiter(true, {"arc-tos", "arcTosAcceptButton"})
       ->Wait();
 
-  test::OobeJS().TapOnPath({"arc-tos-root", "arcTosAcceptButton"});
+  test::OobeJS().TapOnPath({"arc-tos", "arcTosAcceptButton"});
 
   OobeScreenExitWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait();
   LOG(INFO) << "OobeInteractiveUITest: 'arc-tos' screen done.";
diff --git a/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.cc b/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.cc
index 64da4680..de56dcc2 100644
--- a/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.cc
+++ b/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.cc
@@ -24,10 +24,12 @@
 }
 
 GaiaPasswordChangedScreen::GaiaPasswordChangedScreen(
+    const ScreenExitCallback& exit_callback,
     GaiaPasswordChangedView* view)
     : BaseScreen(GaiaPasswordChangedView::kScreenId,
                  OobeScreenPriority::DEFAULT),
-      view_(view) {
+      exit_callback_(exit_callback) {
+  view_ = view;
   if (view_)
     view_->Bind(this);
 }
@@ -64,14 +66,13 @@
 
 void GaiaPasswordChangedScreen::OnUserAction(const std::string& action_id) {
   if (action_id == kUserActionCancelLogin) {
-    CancelPasswordChangedFlow();
     RecordEulaScreenAction(UserAction::kCancel);
+    CancelPasswordChangedFlow();
   } else if (action_id == kUserActionResyncData) {
     RecordEulaScreenAction(UserAction::kResyncUserData);
     // LDH will pass control to ExistingUserController to proceed with clearing
     // cryptohome.
-    if (LoginDisplayHost::default_host())
-      LoginDisplayHost::default_host()->ResyncUserData();
+    exit_callback_.Run(Result::RESYNC);
   }
 }
 
@@ -95,7 +96,7 @@
 }
 
 void GaiaPasswordChangedScreen::OnCookiesCleared() {
-  LoginDisplayHost::default_host()->StartSignInScreen();
+  exit_callback_.Run(Result::CANCEL);
 }
 
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.h b/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.h
index e99496d..2f965070 100644
--- a/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.h
+++ b/chrome/browser/chromeos/login/screens/gaia_password_changed_screen.h
@@ -20,7 +20,16 @@
  public:
   using TView = GaiaPasswordChangedView;
 
-  explicit GaiaPasswordChangedScreen(GaiaPasswordChangedView* view);
+  enum class Result {
+    CANCEL,
+    RESYNC,
+    MIGRATE,
+  };
+
+  using ScreenExitCallback = base::RepeatingCallback<void(Result result)>;
+
+  explicit GaiaPasswordChangedScreen(const ScreenExitCallback& exit_callback,
+                                     GaiaPasswordChangedView* view);
   GaiaPasswordChangedScreen(const GaiaPasswordChangedScreen&) = delete;
   GaiaPasswordChangedScreen& operator=(const GaiaPasswordChangedScreen&) =
       delete;
@@ -59,6 +68,7 @@
   bool show_error_ = false;
 
   GaiaPasswordChangedView* view_ = nullptr;
+  ScreenExitCallback exit_callback_;
 
   base::WeakPtrFactory<GaiaPasswordChangedScreen> weak_factory_{this};
 };
diff --git a/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc b/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc
index 1241e55..e7a9478 100644
--- a/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc
@@ -278,12 +278,14 @@
   DISALLOW_COPY_AND_ASSIGN(GuestSessionRlzTest);
 };
 
-// TODO(crbug.com/1151851) flaky test
-IN_PROC_BROWSER_TEST_P(GuestSessionRlzTest, DISABLED_DeviceIsLocked) {
-  base::RunLoop loop;
-  UserSessionInitializer::Get()->set_init_rlz_impl_closure_for_testing(
-      loop.QuitClosure());
-  loop.Run();
+IN_PROC_BROWSER_TEST_P(GuestSessionRlzTest, DeviceIsLocked) {
+  if (!UserSessionInitializer::Get()->get_inited_for_testing()) {
+    // Wait for initialization.
+    base::RunLoop loop;
+    UserSessionInitializer::Get()->set_init_rlz_impl_closure_for_testing(
+        loop.QuitClosure());
+    loop.Run();
+  }
   const char* const expected_brand =
       stub_install_attributes()->IsDeviceLocked() ? "TEST" : "";
   EXPECT_EQ(expected_brand, google_brand::chromeos::GetBrand());
diff --git a/chrome/browser/chromeos/login/session/user_session_initializer.cc b/chrome/browser/chromeos/login/session/user_session_initializer.cc
index 1a93b56..3545413 100644
--- a/chrome/browser/chromeos/login/session/user_session_initializer.cc
+++ b/chrome/browser/chromeos/login/session/user_session_initializer.cc
@@ -266,6 +266,7 @@
 #endif
   if (init_rlz_impl_closure_for_testing_)
     std::move(init_rlz_impl_closure_for_testing_).Run();
+  inited_for_testing_ = true;
 }
 
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/login/session/user_session_initializer.h b/chrome/browser/chromeos/login/session/user_session_initializer.h
index 6bcab56..7e40f87 100644
--- a/chrome/browser/chromeos/login/session/user_session_initializer.h
+++ b/chrome/browser/chromeos/login/session/user_session_initializer.h
@@ -52,6 +52,8 @@
     init_rlz_impl_closure_for_testing_ = std::move(closure);
   }
 
+  bool get_inited_for_testing() { return inited_for_testing_; }
+
  private:
   // Initialize RLZ.
   void InitRlz(Profile* profile);
@@ -76,6 +78,7 @@
 
   Profile* primary_profile_ = nullptr;
 
+  bool inited_for_testing_ = false;
   base::OnceClosure init_rlz_impl_closure_for_testing_;
 
   // Clipboard html image generator for the primary user.
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_common.cc b/chrome/browser/chromeos/login/ui/login_display_host_common.cc
index 75e6d464..77220e45 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_common.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_common.cc
@@ -348,7 +348,9 @@
     ShutdownDisplayHost();
 }
 
-void LoginDisplayHostCommon::OnCancelPasswordChangedFlow() {}
+void LoginDisplayHostCommon::OnCancelPasswordChangedFlow() {
+  LoginDisplayHost::default_host()->StartSignInScreen();
+}
 
 void LoginDisplayHostCommon::OnAuthPrewarmDone() {
   auth_prewarmer_.reset();
diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc
index c19d3de..97f4f4b 100644
--- a/chrome/browser/chromeos/login/version_info_updater.cc
+++ b/chrome/browser/chromeos/login/version_info_updater.cc
@@ -30,6 +30,7 @@
 #include "device/bluetooth/bluetooth_adapter.h"
 #include "device/bluetooth/bluetooth_adapter_factory.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 
 namespace chromeos {
 
@@ -154,9 +155,9 @@
   // Update the notification about device status reporting.
   if (delegate_ && !enterprise_display_domain.empty()) {
     std::string enterprise_info;
-    enterprise_info =
-        l10n_util::GetStringFUTF8(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
-                                  base::UTF8ToUTF16(enterprise_display_domain));
+    enterprise_info = l10n_util::GetStringFUTF8(
+        IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
+        base::UTF8ToUTF16(enterprise_display_domain));
     delegate_->OnEnterpriseInfoUpdated(enterprise_info, asset_id);
   }
 }
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 4efd3e0..75b4c77 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -649,8 +649,12 @@
   append(std::make_unique<TpmErrorScreen>(
       oobe_ui->GetView<TpmErrorScreenHandler>()));
 
-  append(std::make_unique<GaiaPasswordChangedScreen>(
-      oobe_ui->GetView<GaiaPasswordChangedScreenHandler>()));
+  auto gaia_password_change_screen =
+      std::make_unique<GaiaPasswordChangedScreen>(
+          base::BindRepeating(&WizardController::OnPasswordChangeScreenExit,
+                              weak_factory_.GetWeakPtr()),
+          oobe_ui->GetView<GaiaPasswordChangedScreenHandler>());
+  append(std::move(gaia_password_change_screen));
 
   append(std::make_unique<ActiveDirectoryPasswordChangeScreen>(
       oobe_ui->GetView<ActiveDirectoryPasswordChangeScreenHandler>(),
@@ -941,6 +945,22 @@
   }
 }
 
+void WizardController::OnPasswordChangeScreenExit(
+    GaiaPasswordChangedScreen::Result result) {
+  if (!LoginDisplayHost::default_host())
+    return;
+  switch (result) {
+    case GaiaPasswordChangedScreen::Result::CANCEL:
+      LoginDisplayHost::default_host()->CancelPasswordChangedFlow();
+      break;
+    case GaiaPasswordChangedScreen::Result::RESYNC:
+      LoginDisplayHost::default_host()->ResyncUserData();
+      break;
+    case GaiaPasswordChangedScreen::Result::MIGRATE:
+      NOTREACHED();
+  }
+}
+
 void WizardController::OnActiveDirectoryLoginScreenExit() {
   OnScreenExit(ActiveDirectoryLoginView::kScreenId, kDefaultExitReason);
   LoginDisplayHost::default_host()->HideOobeDialog();
diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h
index 1cb51769..389ede6 100644
--- a/chrome/browser/chromeos/login/wizard_controller.h
+++ b/chrome/browser/chromeos/login/wizard_controller.h
@@ -33,6 +33,7 @@
 #include "chrome/browser/chromeos/login/screens/eula_screen.h"
 #include "chrome/browser/chromeos/login/screens/family_link_notice_screen.h"
 #include "chrome/browser/chromeos/login/screens/fingerprint_setup_screen.h"
+#include "chrome/browser/chromeos/login/screens/gaia_password_changed_screen.h"
 #include "chrome/browser/chromeos/login/screens/gaia_screen.h"
 #include "chrome/browser/chromeos/login/screens/gesture_navigation_screen.h"
 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h"
@@ -320,6 +321,7 @@
   void OnFamilyLinkNoticeScreenExit(FamilyLinkNoticeScreen::Result result);
   void OnUserCreationScreenExit(UserCreationScreen::Result result);
   void OnGaiaScreenExit(GaiaScreen::Result result);
+  void OnPasswordChangeScreenExit(GaiaPasswordChangedScreen::Result result);
   void OnActiveDirectoryLoginScreenExit();
   void OnSignInFatalErrorScreenExit();
   void OnEduCoexistenceLoginScreenExit(
diff --git a/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.cc b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.cc
index e545384d..bc5d523 100644
--- a/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.cc
+++ b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.cc
@@ -9,12 +9,42 @@
 #include "base/notreached.h"
 #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h"
 #include "chrome/browser/profiles/profile_manager.h"
+#include "extensions/common/constants.h"
 #include "ui/base/clipboard/clipboard.h"
 #include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
 #include "url/gurl.h"
 
 namespace policy {
 
+namespace {
+
+bool IsFilesApp(const GURL& url) {
+  return url.has_scheme() && url.SchemeIs(extensions::kExtensionScheme) &&
+         url.has_host() && url.host() == extension_misc::kFilesManagerAppId;
+}
+
+DlpRulesManager::Level IsDstRestricted(const GURL& src, const GURL& dst) {
+  return DlpRulesManager::Get()->IsRestrictedDestination(
+      src, dst, DlpRulesManager::Restriction::kClipboard);
+}
+
+DlpRulesManager::Level IsGuestOsRestricted(const GURL& src) {
+  return DlpRulesManager::Get()->IsRestrictedAnyOfComponents(
+      src,
+      std::vector<DlpRulesManager::Component>{
+          DlpRulesManager::Component::kPluginVm,
+          DlpRulesManager::Component::kCrostini},
+      DlpRulesManager::Restriction::kClipboard);
+}
+
+DlpRulesManager::Level IsArcRestricted(const GURL& src) {
+  return DlpRulesManager::Get()->IsRestrictedComponent(
+      src, DlpRulesManager::Component::kArc,
+      DlpRulesManager::Restriction::kClipboard);
+}
+
+}  // namespace
+
 // static
 void DataTransferDlpController::Init() {
   if (!HasInstance())
@@ -24,41 +54,54 @@
 bool DataTransferDlpController::IsDataReadAllowed(
     const ui::DataTransferEndpoint* const data_src,
     const ui::DataTransferEndpoint* const data_dst) {
-  if (!data_src || data_src->type() == ui::EndpointType::kClipboardHistory) {
+  if (!data_src || !data_src->IsUrlType()) {  // Currently we only handle URLs.
     return true;
   }
 
+  const GURL src_url = data_src->origin()->GetURL();
   DlpRulesManager::Level level = DlpRulesManager::Level::kAllow;
+  bool notify_on_paste = !data_dst || data_dst->notify_if_restricted();
+  ui::EndpointType dst_type =
+      data_dst ? data_dst->type() : ui::EndpointType::kDefault;
 
-  if (!data_dst || data_dst->type() == ui::EndpointType::kDefault) {
-    // Passing empty URL will return restricted if there's a rule restricting
-    // the src against any dst (*), otherwise it will return ALLOW.
-    level = DlpRulesManager::Get()->IsRestrictedDestination(
-        data_src->origin()->GetURL(), GURL(),
-        DlpRulesManager::Restriction::kClipboard);
-  } else if (data_dst->IsUrlType()) {
-    level = DlpRulesManager::Get()->IsRestrictedDestination(
-        data_src->origin()->GetURL(), data_dst->origin()->GetURL(),
-        DlpRulesManager::Restriction::kClipboard);
-  } else if (data_dst->type() == ui::EndpointType::kGuestOs) {
-    level = DlpRulesManager::Get()->IsRestrictedAnyOfComponents(
-        data_src->origin()->GetURL(),
-        std::vector<DlpRulesManager::Component>{
-            DlpRulesManager::Component::kPluginVm,
-            DlpRulesManager::Component::kCrostini},
-        DlpRulesManager::Restriction::kClipboard);
-  } else if (data_dst->type() == ui::EndpointType::kArc) {
-    level = DlpRulesManager::Get()->IsRestrictedComponent(
-        data_src->origin()->GetURL(), DlpRulesManager::Component::kArc,
-        DlpRulesManager::Restriction::kClipboard);
-  } else {
-    NOTREACHED();
+  switch (dst_type) {
+    case ui::EndpointType::kDefault:
+      // Passing empty URL will return restricted if there's a rule restricting
+      // the src against any dst (*), otherwise it will return ALLOW.
+      level = IsDstRestricted(src_url, GURL());
+      break;
+
+    case ui::EndpointType::kUrl: {
+      GURL dst_url = data_dst->origin()->GetURL();
+      level = IsDstRestricted(src_url, dst_url);
+      // Files Apps continously reads the clipboard data which triggers a lot of
+      // notifications while the user isn't actually initiating any copy/paste.
+      // TODO(crbug.com/1152475): Find a better way to handle File app.
+      if (IsFilesApp(dst_url))
+        notify_on_paste = false;
+      break;
+    }
+
+    case ui::EndpointType::kGuestOs:
+      level = IsGuestOsRestricted(src_url);
+      break;
+
+    case ui::EndpointType::kArc:
+      level = IsArcRestricted(src_url);
+      break;
+
+    case ui::EndpointType::kClipboardHistory:
+      // When ClipboardHistory tries to read the clipboard we should allow it
+      // silently.
+      notify_on_paste = false;
+      break;
+
+    default:
+      NOTREACHED();
   }
 
-  bool notify_on_paste = !data_dst || data_dst->notify_if_restricted();
-
   if (level == DlpRulesManager::Level::kBlock && notify_on_paste) {
-    helper_.NotifyBlockedPaste(data_src, data_dst);
+    DoNotifyBlockedPaste(data_src, data_dst);
   }
 
   return level == DlpRulesManager::Level::kAllow;
@@ -68,4 +111,10 @@
 
 DataTransferDlpController::~DataTransferDlpController() = default;
 
+void DataTransferDlpController::DoNotifyBlockedPaste(
+    const ui::DataTransferEndpoint* const data_src,
+    const ui::DataTransferEndpoint* const data_dst) {
+  helper_.NotifyBlockedPaste(data_src, data_dst);
+}
+
 }  // namespace policy
diff --git a/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.h b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.h
index fc741ce..d5df190 100644
--- a/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.h
+++ b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.h
@@ -34,10 +34,15 @@
       const ui::DataTransferEndpoint* const data_src,
       const ui::DataTransferEndpoint* const data_dst) override;
 
- private:
+ protected:
   DataTransferDlpController();
   ~DataTransferDlpController() override;
 
+ private:
+  virtual void DoNotifyBlockedPaste(
+      const ui::DataTransferEndpoint* const data_src,
+      const ui::DataTransferEndpoint* const data_dst);
+
   DlpClipboardNotificationHelper helper_;
 };
 
diff --git a/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller_unittest.cc b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller_unittest.cc
new file mode 100644
index 0000000..0a27b0b
--- /dev/null
+++ b/chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller_unittest.cc
@@ -0,0 +1,133 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/policy/dlp/data_transfer_dlp_controller.h"
+
+#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h"
+#include "testing/gmock/include/gmock/gmock-matchers.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
+#include "url/origin.h"
+
+namespace policy {
+
+namespace {
+
+constexpr char kGoogleUrl[] = "https://www.google.com";
+constexpr char kYoutubeUrl[] = "https://www.youtube.com";
+
+class MockDlpRulesManager : public DlpRulesManager {
+ public:
+  MockDlpRulesManager() = default;
+  ~MockDlpRulesManager() override = default;
+
+  MOCK_CONST_METHOD3(IsRestrictedDestination,
+                     Level(const GURL& source,
+                           const GURL& destination,
+                           Restriction restriction));
+
+  MOCK_CONST_METHOD3(IsRestrictedComponent,
+                     Level(const GURL& source,
+                           const Component& destination,
+                           Restriction restriction));
+
+  MOCK_CONST_METHOD3(IsRestrictedAnyOfComponents,
+                     Level(const GURL& source,
+                           const std::vector<Component>& destinations,
+                           Restriction restriction));
+};
+
+class MockDlpController : public DataTransferDlpController {
+ public:
+  MOCK_METHOD2(DoNotifyBlockedPaste,
+               void(const ui::DataTransferEndpoint* const data_src,
+                    const ui::DataTransferEndpoint* const data_dst));
+};
+
+}  // namespace
+
+class DataTransferDlpControllerTest : public testing::Test {
+ protected:
+  DataTransferDlpControllerTest() = default;
+
+  ~DataTransferDlpControllerTest() override = default;
+
+  ::testing::StrictMock<MockDlpController> dlp_controller_;
+  ::testing::StrictMock<MockDlpRulesManager> rules_manager_;
+};
+
+TEST_F(DataTransferDlpControllerTest, NullSrc) {
+  EXPECT_EQ(true, dlp_controller_.IsDataReadAllowed(nullptr, nullptr));
+}
+
+TEST_F(DataTransferDlpControllerTest, NullDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  EXPECT_CALL(rules_manager_, IsRestrictedDestination)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_CALL(dlp_controller_, DoNotifyBlockedPaste);
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, nullptr));
+}
+
+TEST_F(DataTransferDlpControllerTest, DefaultDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  ui::DataTransferEndpoint data_dst_1(ui::EndpointType::kDefault);
+  EXPECT_CALL(rules_manager_, IsRestrictedDestination)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_CALL(dlp_controller_, DoNotifyBlockedPaste);
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst_1));
+  testing::Mock::VerifyAndClearExpectations(&rules_manager_);
+  testing::Mock::VerifyAndClearExpectations(&dlp_controller_);
+
+  // Turn off notifications
+  ui::DataTransferEndpoint data_dst_2(ui::EndpointType::kDefault,
+                                      /*notify_if_restricted=*/false);
+  EXPECT_CALL(rules_manager_, IsRestrictedDestination)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst_2));
+}
+
+TEST_F(DataTransferDlpControllerTest, ClipboardHistoryDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  ui::DataTransferEndpoint data_dst(ui::EndpointType::kClipboardHistory);
+  EXPECT_EQ(true, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst));
+}
+
+TEST_F(DataTransferDlpControllerTest, UrlSrcDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  ui::DataTransferEndpoint data_dst_1(url::Origin::Create(GURL(kYoutubeUrl)));
+  EXPECT_CALL(rules_manager_, IsRestrictedDestination)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_CALL(dlp_controller_, DoNotifyBlockedPaste);
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst_1));
+  testing::Mock::VerifyAndClearExpectations(&rules_manager_);
+  testing::Mock::VerifyAndClearExpectations(&dlp_controller_);
+
+  // Turn off notifications
+  ui::DataTransferEndpoint data_dst_2(url::Origin::Create(GURL(kYoutubeUrl)),
+                                      /*notify_if_restricted=*/false);
+  EXPECT_CALL(rules_manager_, IsRestrictedDestination)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst_2));
+}
+
+TEST_F(DataTransferDlpControllerTest, ArcDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  ui::DataTransferEndpoint data_dst(ui::EndpointType::kArc);
+  EXPECT_CALL(rules_manager_, IsRestrictedComponent)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_CALL(dlp_controller_, DoNotifyBlockedPaste);
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst));
+}
+
+TEST_F(DataTransferDlpControllerTest, GuestOsDst) {
+  ui::DataTransferEndpoint data_src(url::Origin::Create(GURL(kGoogleUrl)));
+  ui::DataTransferEndpoint data_dst(ui::EndpointType::kGuestOs);
+  EXPECT_CALL(rules_manager_, IsRestrictedAnyOfComponents)
+      .WillOnce(testing::Return(DlpRulesManager::Level::kBlock));
+  EXPECT_CALL(dlp_controller_, DoNotifyBlockedPaste);
+  EXPECT_EQ(false, dlp_controller_.IsDataReadAllowed(&data_src, &data_dst));
+}
+
+}  // namespace policy
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.cc b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.cc
index 741a83e..7984c64 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.cc
+++ b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.cc
@@ -145,8 +145,8 @@
 
 // static
 void DlpRulesManager::Init() {
-  if (!g_dlp_rules_manager)
-    g_dlp_rules_manager = new DlpRulesManager();
+  if (!IsInitialized())
+    new DlpRulesManager();
 }
 
 // static
@@ -243,7 +243,13 @@
 }
 
 DlpRulesManager::DlpRulesManager() {
-  pref_change_registrar_.Init(g_browser_process->local_state());
+  g_dlp_rules_manager = this;
+
+  auto* local_state = g_browser_process->local_state();
+  if (!local_state)  // Sometimes it's not available in tests.
+    return;
+
+  pref_change_registrar_.Init(local_state);
   pref_change_registrar_.Add(
       policy_prefs::kDlpRulesList,
       base::BindRepeating(&DlpRulesManager::OnPolicyUpdate,
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h
index b3bfcca..da3a66504 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h
+++ b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h
@@ -98,36 +98,38 @@
   // from `source`. ALLOW is returned if no restrictions should be applied.
   // Requires `restriction` to be one of the following: screenshot, printing,
   // privacy screen, screenshare.
-  Level IsRestricted(const GURL& source, Restriction restriction) const;
+  virtual Level IsRestricted(const GURL& source, Restriction restriction) const;
 
   // Returns the enforcement level for `restriction` given that data comes
   // from `source` and requested to be shared to `destination`. ALLOW is
   // returned if no restrictions should be applied. Requires `restriction` to be
   // clipboard.
-  Level IsRestrictedDestination(const GURL& source,
-                                const GURL& destination,
-                                Restriction restriction) const;
+  virtual Level IsRestrictedDestination(const GURL& source,
+                                        const GURL& destination,
+                                        Restriction restriction) const;
 
   // Returns the enforcement level for `restriction` given that data comes
   // from `source` and requested to be shared to `destination`. ALLOW is
   // returned if no restrictions should be applied. Requires `restriction` to be
   // clipboard.
-  Level IsRestrictedComponent(const GURL& source,
-                              const Component& destination,
-                              Restriction restriction) const;
+  virtual Level IsRestrictedComponent(const GURL& source,
+                                      const Component& destination,
+                                      Restriction restriction) const;
 
   // Returns the enforcement level for `restriction` given that data comes
   // from `source` and requested to be shared to `destinations`. ALLOW is
   // returned if there is not any restriction should be applied on any of the
   // `destinations`. Requires `restriction` to be clipboard.
-  Level IsRestrictedAnyOfComponents(const GURL& source,
-                                    const std::vector<Component>& destinations,
-                                    Restriction restriction) const;
+  virtual Level IsRestrictedAnyOfComponents(
+      const GURL& source,
+      const std::vector<Component>& destinations,
+      Restriction restriction) const;
+
+ protected:
+  DlpRulesManager();
+  virtual ~DlpRulesManager();
 
  private:
-  DlpRulesManager();
-  ~DlpRulesManager();
-
   void OnPolicyUpdate();
 
   // Returns the maximum level of the rules of given `restriction` joined with
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
index f2f37f23c..e09c4da5 100644
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -934,10 +934,10 @@
     deps += [ "//components/autofill_assistant/browser" ]
   }
 
-  if (chromeos_is_browser_only || is_chromeos) {
+  if (is_chromeos_lacros || is_chromeos_ash) {
     sources += [ "api/enterprise_platform_keys/enterprise_platform_keys_api.h" ]
     deps += [ "//chromeos/crosapi/mojom" ]
-    if (chromeos_is_browser_only) {
+    if (is_chromeos_lacros) {
       sources += [
         "api/enterprise_platform_keys/enterprise_platform_keys_api_lacros.cc",
         "api/enterprise_platform_keys/enterprise_platform_keys_api_lacros.h",
@@ -946,7 +946,7 @@
     }
   }
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     sources += [
       "api/certificate_provider/certificate_provider_api.cc",
       "api/certificate_provider/certificate_provider_api.h",
@@ -1087,7 +1087,7 @@
       ]
     }
   } else {
-    assert(!is_chromeos)
+    assert(!is_chromeos_ash)
     sources += [
       "api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc",
       "api/enterprise_reporting_private/chrome_desktop_report_request_helper.h",
@@ -1181,7 +1181,7 @@
     deps += [ "//components/wifi" ]
   }
 
-  if (is_win || is_mac || is_chromeos) {
+  if (is_win || is_mac || is_chromeos_ash) {
     sources += [
       "api/networking_private/networking_private_crypto.cc",
       "api/networking_private/networking_private_crypto.h",
@@ -1212,7 +1212,7 @@
       "setupapi.lib",
       "propsys.lib",
     ]
-  } else if (use_aura && !is_chromeos) {
+  } else if (use_aura && !is_chromeos_ash) {
     sources += [
       "system_display/display_info_provider_aura.cc",
       "system_display/display_info_provider_aura.h",
@@ -1226,7 +1226,7 @@
     ]
   }
 
-  if (enable_print_preview && !is_chromeos) {
+  if (enable_print_preview && !is_chromeos_ash) {
     sources += [
       "api/cloud_print_private/cloud_print_private_api.cc",
       "api/cloud_print_private/cloud_print_private_api.h",
diff --git a/chrome/browser/extensions/active_tab_apitest.cc b/chrome/browser/extensions/active_tab_apitest.cc
index bbb906e..9cb35544 100644
--- a/chrome/browser/extensions/active_tab_apitest.cc
+++ b/chrome/browser/extensions/active_tab_apitest.cc
@@ -8,6 +8,7 @@
 #include "base/macros.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_action_runner.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -30,7 +31,7 @@
 #include "net/dns/mock_host_resolver.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.h"
 #include "chromeos/login/login_state/scoped_test_public_session_login_state.h"
 #endif
@@ -96,7 +97,7 @@
     EXPECT_TRUE(catcher.GetNextResult()) << message_;
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // For the third pass grant the activeTab permission and do it in a public
   // session. URL should be scrubbed down to origin.
   {
diff --git a/chrome/browser/extensions/active_tab_unittest.cc b/chrome/browser/extensions/active_tab_unittest.cc
index fa33ec3..5c9f647 100644
--- a/chrome/browser/extensions/active_tab_unittest.cc
+++ b/chrome/browser/extensions/active_tab_unittest.cc
@@ -11,6 +11,7 @@
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/active_tab_permission_granter.h"
 #include "chrome/browser/extensions/chrome_test_extension_loader.h"
@@ -46,7 +47,7 @@
 #include "extensions/common/value_builder.h"
 #include "extensions/test/test_extension_dir.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/run_loop.h"
 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
 #include "chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h"
@@ -150,7 +151,7 @@
   }
 
   void TearDown() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     chromeos::KioskAppManager::Shutdown();
 #endif
     ChromeRenderViewHostTestHarness::TearDown();
@@ -518,7 +519,7 @@
   EXPECT_EQ(0, test_delegate_->should_grant_call_count());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 class ActiveTabManagedSessionTest : public ActiveTabTest {
  protected:
   ActiveTabManagedSessionTest() {}
@@ -647,7 +648,7 @@
   ActiveTabPermissionGranterDelegateChromeOS::
       SetRequestResolvedCallbackForTesting(nullptr);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // An active tab test that includes an ExtensionService.
 class ActiveTabWithServiceTest : public ExtensionServiceTestBase {
diff --git a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc
index 2dbfc2a..0789777f 100644
--- a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc
+++ b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc
@@ -25,6 +25,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/activity_log/activity_log.h"
 #include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -38,7 +39,7 @@
 #include "sql/statement.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -49,7 +50,7 @@
  public:
   CountingPolicyTest()
       : task_environment_(content::BrowserTaskEnvironment::IO_MAINLOOP) {
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset(new chromeos::ScopedTestUserManager());
 #endif
     profile_.reset(new TestingProfile());
@@ -63,7 +64,7 @@
   }
 
   ~CountingPolicyTest() override {
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset();
 #endif
     base::RunLoop().RunUntilIdle();
@@ -386,7 +387,7 @@
   std::unique_ptr<TestingProfile> profile_;
   content::BrowserTaskEnvironment task_environment_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   std::unique_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
index bca9291df..f0d71306 100644
--- a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
+++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
@@ -23,6 +23,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/activity_log/activity_log.h"
 #include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -35,7 +36,7 @@
 #include "extensions/common/extension_builder.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -46,7 +47,7 @@
  public:
   FullStreamUIPolicyTest()
       : task_environment_(content::BrowserTaskEnvironment::IO_MAINLOOP) {
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset(new chromeos::ScopedTestUserManager());
 #endif
     base::CommandLine no_program_command_line(base::CommandLine::NO_PROGRAM);
@@ -64,7 +65,7 @@
   }
 
   ~FullStreamUIPolicyTest() override {
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset();
 #endif
     base::RunLoop().RunUntilIdle();
@@ -331,7 +332,7 @@
   std::unique_ptr<TestingProfile> profile_;
   content::BrowserTaskEnvironment task_environment_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   std::unique_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/api/automation/automation_apitest.cc b/chrome/browser/extensions/api/automation/automation_apitest.cc
index 9fe9826..be2418e 100644
--- a/chrome/browser/extensions/api/automation/automation_apitest.cc
+++ b/chrome/browser/extensions/api/automation/automation_apitest.cc
@@ -13,6 +13,7 @@
 #include "base/test/trace_event_analyzer.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_paths.h"
@@ -42,7 +43,7 @@
 #include "ui/base/accelerators/accelerator.h"
 #include "ui/display/display_switches.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/public/cpp/accelerators.h"
 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h"
 #endif
@@ -242,7 +243,7 @@
       << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // TODO(https://crbug.com/754870): Flaky on CrOS sanitizers.
 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DISABLED_DesktopInitialFocus) {
   ASSERT_TRUE(
@@ -291,7 +292,7 @@
       << message_;
 }
 
-#if defined(OS_CHROMEOS) && defined(MEMORY_SANITIZER)
+#if BUILDFLAG(IS_CHROMEOS_ASH) && defined(MEMORY_SANITIZER)
 // TODO(http://crbug.com/1113853): flaky on ChromeOS.
 #define MAYBE_LocationInWebView DISABLED_LocationInWebView
 #else
@@ -308,7 +309,7 @@
                                   "desktop_not_requested.html")) << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // TODO(https://crbug.com/894016): flaky.
 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DISABLED_DesktopActions) {
   AutomationManagerAura::GetInstance()->Enable();
@@ -330,7 +331,7 @@
   ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "load_tabs.html"))
       << message_;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 #else  // !defined(USE_AURA)
 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopNotSupported) {
   ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop",
@@ -448,7 +449,7 @@
       << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 class AutomationApiTestWithDeviceScaleFactor : public AutomationApiTest {
  protected:
@@ -550,6 +551,6 @@
   ASSERT_LT(automation_total_dur, renderer_total_dur * 2);
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.cc b/chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.cc
index 0a50f70..56ba781 100644
--- a/chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.cc
+++ b/chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
 #include "chrome/browser/extensions/chrome_extension_function_details.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
@@ -24,7 +25,7 @@
 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h"
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge.h"
 #endif
 
@@ -80,7 +81,7 @@
 
 bool ChromeAutomationInternalApiDelegate::EnableTree(
     const ui::AXTreeID& tree_id) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   arc::ArcAccessibilityHelperBridge* bridge =
       arc::ArcAccessibilityHelperBridge::GetForBrowserContext(
           GetActiveUserContext());
diff --git a/chrome/browser/extensions/api/braille_display_private/braille_display_private_api.cc b/chrome/browser/extensions/api/braille_display_private/braille_display_private_api.cc
index f77120a..6ebfda56 100644
--- a/chrome/browser/extensions/api/braille_display_private/braille_display_private_api.cc
+++ b/chrome/browser/extensions/api/braille_display_private/braille_display_private_api.cc
@@ -8,11 +8,12 @@
 
 #include "base/lazy_instance.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/braille_display_private/braille_controller.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
@@ -85,12 +86,12 @@
 }
 
 bool BrailleDisplayPrivateAPI::IsProfileActive() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Since we are creating one instance per profile / user, we should be fine
   // comparing against the active user. That said - if we ever change that,
   // this code will need to be changed.
   return profile_->IsSameOrParent(ProfileManager::GetActiveUserProfile());
-#else  // !defined(OS_CHROMEOS)
+#else  // !BUILDFLAG(IS_CHROMEOS_ASH)
   return true;
 #endif
 }
@@ -180,7 +181,7 @@
 
 ExtensionFunction::ResponseAction
 BrailleDisplayPrivateUpdateBluetoothBrailleDisplayAddressFunction::Run() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   NOTREACHED();
   return RespondNow(Error("Unsupported on this platform."));
 #else
diff --git a/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc b/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc
index 5f1ffb8..c95a5e4d 100644
--- a/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc
+++ b/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc
@@ -14,6 +14,7 @@
 #include "base/stl_util.h"
 #include "base/system/sys_info.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 
 namespace extensions {
 namespace api {
@@ -26,7 +27,7 @@
 // TODO(plundblad): Find a way to detect the controlling terminal of the
 // X server.
 static const int kDefaultTtyLinux = 7;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // The GUI is always running on vt1 in Chrome OS.
 static const int kDefaultTtyChromeOS = 1;
 #endif
@@ -79,7 +80,7 @@
   }
   int path[2] = {0, 0};
   int pathElements = 0;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (base::SysInfo::IsRunningOnChromeOS())
     path[pathElements++] = kDefaultTtyChromeOS;
 #endif
diff --git a/chrome/browser/extensions/api/chrome_extensions_api_client.cc b/chrome/browser/extensions/api/chrome_extensions_api_client.cc
index e903e8e..75067171 100644
--- a/chrome/browser/extensions/api/chrome_extensions_api_client.cc
+++ b/chrome/browser/extensions/api/chrome_extensions_api_client.cc
@@ -13,6 +13,7 @@
 #include "base/strings/string_util.h"
 #include "base/task/post_task.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.h"
 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h"
 #include "chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h"
@@ -66,7 +67,7 @@
 #include "services/network/public/mojom/fetch_api.mojom-shared.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/api/file_handlers/non_native_file_system_delegate_chromeos.h"
 #include "chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.h"
 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.h"
@@ -323,7 +324,7 @@
 std::unique_ptr<VirtualKeyboardDelegate>
 ChromeExtensionsAPIClient::CreateVirtualKeyboardDelegate(
     content::BrowserContext* browser_context) const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return std::make_unique<ChromeVirtualKeyboardDelegate>(browser_context);
 #else
   return nullptr;
@@ -357,7 +358,7 @@
 
 NetworkingCastPrivateDelegate*
 ChromeExtensionsAPIClient::GetNetworkingCastPrivateDelegate() {
-#if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_MAC)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN) || defined(OS_MAC)
   if (!networking_cast_private_delegate_)
     networking_cast_private_delegate_ =
         ChromeNetworkingCastPrivateDelegate::Create();
@@ -386,7 +387,7 @@
   return feedback_private_delegate_.get();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 MediaPerceptionAPIDelegate*
 ChromeExtensionsAPIClient::GetMediaPerceptionAPIDelegate() {
   if (!media_perception_api_delegate_) {
diff --git a/chrome/browser/extensions/api/chrome_extensions_api_client.h b/chrome/browser/extensions/api/chrome_extensions_api_client.h
index 15fa53b..dd7459b8 100644
--- a/chrome/browser/extensions/api/chrome_extensions_api_client.h
+++ b/chrome/browser/extensions/api/chrome_extensions_api_client.h
@@ -7,6 +7,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/browser/api/extensions_api_client.h"
 
 namespace extensions {
@@ -78,7 +79,7 @@
   MessagingDelegate* GetMessagingDelegate() override;
   FeedbackPrivateDelegate* GetFeedbackPrivateDelegate() override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   MediaPerceptionAPIDelegate* GetMediaPerceptionAPIDelegate() override;
   NonNativeFileSystemDelegate* GetNonNativeFileSystemDelegate() override;
 
@@ -101,7 +102,7 @@
   std::unique_ptr<MessagingDelegate> messaging_delegate_;
   std::unique_ptr<FeedbackPrivateDelegate> feedback_private_delegate_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::unique_ptr<MediaPerceptionAPIDelegate> media_perception_api_delegate_;
   std::unique_ptr<NonNativeFileSystemDelegate> non_native_file_system_delegate_;
   std::unique_ptr<ClipboardExtensionHelper> clipboard_extension_helper_;
diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h
index 35900ac..1caf2a6 100644
--- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h
+++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h
@@ -9,10 +9,11 @@
 #include <vector>
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/browser/extension_function.h"
 #include "printing/buildflags/buildflags.h"
 
-#if !BUILDFLAG(ENABLE_PRINT_PREVIEW) || defined(OS_CHROMEOS)
+#if !BUILDFLAG(ENABLE_PRINT_PREVIEW) || BUILDFLAG(IS_CHROMEOS_ASH)
 #error "Print Preview must be enabled / Not supported on ChromeOS"
 #endif
 
diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc
index cdf1f5d..de13ab3 100644
--- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc
+++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc
@@ -6,6 +6,7 @@
 
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
@@ -56,7 +57,7 @@
   }
 };
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 
 using extensions::api::cloud_print_private::UserSettings;
 
@@ -122,4 +123,4 @@
   ASSERT_TRUE(RunPageTest(page_url.spec(), kFlagNone, kFlagUseIncognito));
 }
 
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/api/commands/command_service_browsertest.cc b/chrome/browser/extensions/api/commands/command_service_browsertest.cc
index 7cd22dd..b34b2b468 100644
--- a/chrome/browser/extensions/api/commands/command_service_browsertest.cc
+++ b/chrome/browser/extensions/api/commands/command_service_browsertest.cc
@@ -8,6 +8,7 @@
 #include "base/threading/thread_restrictions.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/commands/command_service.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/common/pref_names.h"
@@ -31,9 +32,9 @@
   return extensions::manifest_values::kKeybindingPlatformMac;
 #elif defined(OS_MAC)
   return extensions::manifest_values::kKeybindingPlatformChromeOs;
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
   return extensions::manifest_values::kKeybindingPlatformLinux;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   return extensions::manifest_values::kKeybindingPlatformWin;
 #else
   return "";
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api_constants.cc b/chrome/browser/extensions/api/content_settings/content_settings_api_constants.cc
index 3c29d98..6176c1f6 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_api_constants.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_api_constants.cc
@@ -23,9 +23,6 @@
     "You cannot read incognito content settings when no incognito window "
     "is open.";
 const char kInvalidUrlError[] = "The URL \"*\" is invalid.";
-const char kWildcardPatternsForPluginsDisallowed[] =
-    "Host wildcards ('*') and \"<all_urls>\" are no longer "
-    "supported in `primaryPattern` for `plugins`.";
 const char kSettingPluginContentSettingsIsDisallowed[] =
     "`chrome.contentSettings.plugins.set()` API is no longer supported.";
 const char kSettingPluginContentSettingsResourceIdentifierIsDisallowed[] =
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api_constants.h b/chrome/browser/extensions/api/content_settings/content_settings_api_constants.h
index 2dab6f50..adb68a18 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_api_constants.h
+++ b/chrome/browser/extensions/api/content_settings/content_settings_api_constants.h
@@ -23,7 +23,6 @@
 extern const char kIncognitoContextError[];
 extern const char kIncognitoSessionOnlyError[];
 extern const char kInvalidUrlError[];
-extern const char kWildcardPatternsForPluginsDisallowed[];
 extern const char kSettingPluginContentSettingsIsDisallowed[];
 extern const char kSettingPluginContentSettingsResourceIdentifierIsDisallowed[];
 extern const char kSettingPluginContentSettingsGetIsDisallowed[];
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
index a737a7e..a6c40ef5 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
@@ -9,6 +9,7 @@
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h"
@@ -75,7 +76,7 @@
 // Flaky on Windows: http://crbug.com/301887
 // Fails on Chrome OS: http://crbug.com/718512
 // Flaky on macOS: http://crbug.com/804897
-#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC)
 #define MAYBE_ChooseDesktopMedia DISABLED_ChooseDesktopMedia
 #else
 #define MAYBE_ChooseDesktopMedia ChooseDesktopMedia
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
index 8578f65..2189008 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -18,6 +18,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/developer_private/inspectable_views_finder.h"
 #include "chrome/browser/extensions/chrome_test_extension_loader.h"
 #include "chrome/browser/extensions/error_console/error_console.h"
@@ -404,7 +405,7 @@
             "behllobkkfkfnphdnhnkndlbkcpglgmj.json"));
   }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Test Extension2
   extension_path = data_dir().AppendASCII("good")
                              .AppendASCII("Extensions")
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
index 4dbec06..58c9543 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -1201,7 +1201,7 @@
       .WaitForEvent();
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
                        DownloadsShowFunction) {
   platform_util::internal::DisableShellOperationsForTesting();
@@ -4455,6 +4455,7 @@
   EXPECT_EQ(                                                                   \
       InterruptReasonExtensionToComponent(downloads::INTERRUPT_REASON_##name), \
       download::DOWNLOAD_INTERRUPT_REASON_##name);
+#include "build/chromeos_buildflags.h"
 #include "components/download/public/common/download_interrupt_reason_values.h"
 #undef INTERRUPT_REASON
 }
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
index c898d664..7a9c0e3 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
+++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h
@@ -11,7 +11,7 @@
 
 #include "build/chromeos_buildflags.h"
 
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_lacros.h"
 #else
 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_ash.h"
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
index 335042b..9f913b7 100644
--- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
+++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
@@ -7,6 +7,7 @@
 #include "base/run_loop.h"
 #include "base/test/test_timeouts.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/download/download_prefs.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/ui/browser.h"
@@ -985,7 +986,7 @@
   // The test verification below is applicable only to scenarios where the
   // download shelf is supported - on ChromeOS, instead of the download shelf,
   // there is a download notification in the right-bottom corner of the screen.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
 #endif
 }
@@ -1020,7 +1021,7 @@
   // The test verification below is applicable only to scenarios where the
   // download shelf is supported - on ChromeOS, instead of the download shelf,
   // there is a download notification in the right-bottom corner of the screen.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
 #endif
 }
diff --git a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
index 33d620d..9eda2e9 100644
--- a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
+++ b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
@@ -9,6 +9,7 @@
 
 #include "base/bind.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/feedback/feedback_uploader_chrome.h"
 #include "chrome/browser/feedback/feedback_uploader_factory_chrome.h"
@@ -25,7 +26,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/webui/web_ui_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/strings/string_split.h"
 #include "base/system/sys_info.h"
 #include "chrome/browser/chromeos/arc/arc_util.h"
@@ -39,14 +40,14 @@
 #include "extensions/browser/extension_system.h"
 #include "extensions/common/constants.h"
 #include "google_apis/gaia/gaia_auth_util.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
 namespace {
 
 int GetSysInfoCheckboxStringId(content::BrowserContext* browser_context) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (arc::IsArcPlayStoreEnabledForProfile(
           Profile::FromBrowserContext(browser_context))) {
     return IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX_ARC;
@@ -123,7 +124,7 @@
   return system_logs::BuildChromeSystemLogsFetcher(/*scrub_data=*/true);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 std::unique_ptr<system_logs::SystemLogsSource>
 ChromeFeedbackPrivateDelegate::CreateSingleLogSource(
     api::feedback_private::LogSource source_type) const {
@@ -248,7 +249,7 @@
     std::move(callback).Run(std::string());
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 std::string ChromeFeedbackPrivateDelegate::GetSignedInUserEmail(
     content::BrowserContext* context) const {
diff --git a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.h b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.h
index 826fede8..d09335a 100644
--- a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.h
+++ b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.h
@@ -9,6 +9,7 @@
 #include "extensions/browser/api/feedback_private/feedback_private_delegate.h"
 
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 
 namespace extensions {
 
@@ -23,7 +24,7 @@
       bool from_crash) const override;
   system_logs::SystemLogsFetcher* CreateSystemLogsFetcher(
       content::BrowserContext* context) const override;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::unique_ptr<system_logs::SystemLogsSource> CreateSingleLogSource(
       api::feedback_private::LogSource source_type) const override;
   void FetchExtraLogs(scoped_refptr<feedback::FeedbackData> feedback_data,
@@ -32,7 +33,7 @@
   api::feedback_private::LandingPageType GetLandingPageType(
       const feedback::FeedbackData& feedback_data) const override;
   void GetLacrosHistograms(GetHistogramsCallback callback) override;
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   std::string GetSignedInUserEmail(
       content::BrowserContext* context) const override;
   void NotifyFeedbackDelayed() const override;
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc
index b93c0800..7426953 100644
--- a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc
+++ b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc
@@ -4,6 +4,7 @@
 
 #include "base/bind.h"
 #include "base/run_loop.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/devtools/devtools_window_testing.h"
@@ -232,7 +233,7 @@
   EXPECT_TRUE(bool_result);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Ensures that when triggered from a Google account and a Bluetooth related
 // string is entered into the description, that we provide the option for
 // uploading Bluetooth logs as well.
diff --git a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
index 4b3763f..303e330 100644
--- a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
+++ b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
@@ -14,6 +14,7 @@
 #include "base/files/file_path.h"
 #include "base/path_service.h"
 #include "base/strings/string16.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/file_system/file_entry_picker.h"
 #include "chrome/browser/extensions/chrome_extension_function_details.h"
 #include "chrome/browser/profiles/profile.h"
@@ -47,7 +48,7 @@
 #include "base/mac/foundation_util.h"
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
 #include "chrome/browser/extensions/api/file_system/consent_provider.h"
 #include "extensions/browser/event_router.h"
@@ -62,7 +63,7 @@
 
 namespace file_system = api::file_system;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 using file_system_api::ConsentProvider;
 using file_system_api::ConsentProviderDelegate;
 
@@ -240,7 +241,7 @@
 }
 
 }  // namespace file_system_api
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 ChromeFileSystemDelegate::ChromeFileSystemDelegate() {}
 
@@ -316,7 +317,7 @@
   return 0;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 FileSystemDelegate::GrantVolumesMode
 ChromeFileSystemDelegate::GetGrantVolumesMode(
     content::BrowserContext* browser_context,
@@ -412,7 +413,7 @@
   std::move(success_callback).Run(result_volume_list);
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 SavedFilesServiceInterface* ChromeFileSystemDelegate::GetSavedFilesService(
     content::BrowserContext* browser_context) {
diff --git a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h
index 51010e4..5aaf22f 100644
--- a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h
+++ b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h
@@ -11,10 +11,11 @@
 
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 
 namespace extensions {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 namespace file_system_api {
 
 // Dispatches an event about a mounted or unmounted volume in the system to
@@ -22,7 +23,7 @@
 void DispatchVolumeListChangeEvent(content::BrowserContext* browser_context);
 
 }  // namespace file_system_api
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 class ChromeFileSystemDelegate : public FileSystemDelegate {
  public:
@@ -44,7 +45,7 @@
                                        base::OnceClosure on_accept,
                                        base::OnceClosure on_cancel) override;
   int GetDescriptionIdForAcceptType(const std::string& accept_type) override;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   FileSystemDelegate::GrantVolumesMode GetGrantVolumesMode(
       content::BrowserContext* browser_context,
       content::RenderFrameHost* render_frame_host,
@@ -60,7 +61,7 @@
                      const Extension& extension,
                      VolumeListCallback success_callback,
                      ErrorCallback error_callback) override;
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   SavedFilesServiceInterface* GetSavedFilesService(
       content::BrowserContext* browser_context) override;
 
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
index 5720eaec..9f8aa2cf 100644
--- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
@@ -10,6 +10,7 @@
 #include "base/scoped_observer.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/chrome_paths.h"
@@ -666,7 +667,7 @@
       << message_;
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, RequestFileSystem_NotChromeOS) {
   ASSERT_TRUE(RunPlatformAppTestWithFlags(
       "api_test/file_system/request_file_system_not_chromeos",
diff --git a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc
index f8a1477..07172935 100644
--- a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc
+++ b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/strings/stringprintf.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/identity/identity_api.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/signin/identity_manager_factory.h"
@@ -162,7 +163,7 @@
 // this partition's cookie jar. An extra update triggered from here might change
 // cookies order in the middle of the flow. This may lead to a bug like
 // https://crbug.com/1112343.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   SetAccountsInCookie();
 #endif
 }
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index 77b1d22..c960691 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -21,6 +21,7 @@
 #include "base/values.h"
 #include "build/build_config.h"
 #include "build/buildflag.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/api/identity/gaia_remote_consent_flow.h"
 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h"
@@ -77,7 +78,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/mock_user_manager.h"
 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
@@ -107,7 +108,7 @@
 const char kGetAuthTokenResultAfterConsentApprovedHistogramName[] =
     "Signin.Extensions.GetAuthTokenResult.RemoteConsentApproved";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void InitNetwork() {
   const chromeos::NetworkState* default_network =
       chromeos::NetworkHandler::Get()
@@ -426,7 +427,7 @@
     }
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void StartDeviceAccessTokenRequest() override {
     // In these tests requests for the device account just funnel through to
     // requests for the token key account.
@@ -590,7 +591,7 @@
   void SetUpOnMainThread() override {
     AsyncExtensionBrowserTest::SetUpOnMainThread();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Fake the network online state so that Gaia requests can come through.
     InitNetwork();
 #endif
@@ -1130,7 +1131,7 @@
 }
 
 // The signin flow is simply not used on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
                        InteractiveNotSignedInShowSigninOnlyOnce) {
   scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
@@ -1281,7 +1282,7 @@
 }
 
 // The signin flow is simply not used on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
                        InteractiveMintServiceErrorShowSigninOnlyOnce) {
   scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
@@ -1357,7 +1358,7 @@
   EXPECT_EQ(std::string(errors::kUserNotSignedIn), error);
 // ChromeOS does not support the interactive login flow, so the login UI will
 // never be shown on that platform.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_TRUE(func->login_ui_shown());
 #endif
   EXPECT_FALSE(func->scope_ui_shown());
@@ -1388,7 +1389,7 @@
 // The interactive login flow is always short-circuited out with failure on
 // ChromeOS, so the tests of the interactive login flow being successful are not
 // relevant on that platform.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
                        InteractiveLoginSuccessMintFailure) {
   scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
@@ -1593,7 +1594,7 @@
 }
 
 // The signin flow is simply not used on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
                        InteractiveApprovalServiceErrorShowSigninUIOnlyOnce) {
   scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
@@ -2022,7 +2023,7 @@
 
 // The interactive login UI is never shown on ChromeOS, so tests of the
 // interactive login flow being successful are not relevant on that platform.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest, LoginInvalidatesTokenCache) {
   scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
   scoped_refptr<const Extension> extension(CreateExtension(CLIENT_ID | SCOPES));
@@ -2705,7 +2706,7 @@
 }
 
 // The signin flow is simply not used on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
                        MultiSecondaryInteractiveInvalidToken) {
   // Setup a secondary account with no valid refresh token, and try to get a
@@ -2920,7 +2921,7 @@
       1);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 class GetAuthTokenFunctionPublicSessionTest : public GetAuthTokenFunctionTest {
  public:
   GetAuthTokenFunctionPublicSessionTest()
@@ -3317,7 +3318,7 @@
 }
 
 // The signin flow is not used on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Tests that Chrome does not have any selected user id value if the account
 // specified by the extension is not available.
 IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionSelectedUserIdTest,
@@ -3767,7 +3768,7 @@
   EXPECT_FALSE(HasExpectedEvent());
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Test that an event is fired when the primary account signs out. Only
 // applicable in non-DICE mode, as when DICE is enabled clearing the primary
 // account does not result in its refresh token being removed and hence does
@@ -3789,7 +3790,7 @@
 
   EXPECT_FALSE(HasExpectedEvent());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Test that an event is fired when the primary account has a refresh token
 // invalidated.
diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
index 0b89f814..bf93a80 100644
--- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
+++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
@@ -15,6 +15,7 @@
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_process_platform_part.h"
 #include "chrome/browser/extensions/api/identity/identity_api.h"
@@ -41,7 +42,7 @@
 #include "google_apis/gaia/gaia_auth_util.h"
 #include "google_apis/gaia/gaia_urls.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/app_mode/app_mode_utils.h"
 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
@@ -55,7 +56,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // The list of apps that are allowed to use the Identity API to retrieve the
 // token from the device robot account in a public session.
 const char* const kPublicSessionAllowedOrigins[] = {
@@ -104,7 +105,7 @@
 }  // namespace
 
 IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction()
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     : OAuth2AccessTokenManager::Consumer(
           kExtensionsIdentityAPIOAuthConsumerName)
 #endif
@@ -253,7 +254,7 @@
     const CoreAccountInfo* account_info) {
   token_key_.account_info = account_info ? *account_info : CoreAccountInfo();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   policy::BrowserPolicyConnectorChromeOS* connector =
       g_browser_process->platform_part()->browser_policy_connector_chromeos();
   bool is_kiosk = user_manager::UserManager::Get()->IsLoggedInAsKioskApp();
@@ -386,7 +387,7 @@
   // If the signin flow fails, don't display the login prompt again.
   should_prompt_for_signin_ = false;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // In normal mode (i.e. non-kiosk mode), the user has to log out to
   // re-establish credentials. Let the global error popup handle everything.
   // In kiosk mode, interactive sign-in is not supported.
@@ -424,7 +425,7 @@
 
 void IdentityGetAuthTokenFunction::StartMintTokenFlow(
     IdentityMintRequestQueue::MintType type) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // ChromeOS in kiosk mode may start the mint token flow without account.
   DCHECK(!token_key_.account_info.IsEmpty());
   DCHECK(IdentityManagerFactory::GetForProfile(GetProfile())
@@ -488,7 +489,7 @@
   if (type == IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE) {
     switch (cache_status) {
       case IdentityTokenCacheValue::CACHE_STATUS_NOTFOUND:
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
         // Always force minting token for ChromeOS kiosk app and public session.
         if (user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() &&
             !IsOriginAllowlistedInPublicSession()) {
@@ -893,7 +894,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void IdentityGetAuthTokenFunction::OnGetTokenSuccess(
     const OAuth2AccessTokenManager::Request* request,
     const OAuth2AccessTokenConsumer::TokenResponse& token_response) {
@@ -938,7 +939,7 @@
       IdentityGetAuthTokenError(IdentityGetAuthTokenError::State::kCanceled));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Even though the DeviceOAuth2TokenService may be available on non-ChromeOS
 // platforms, its robot account is not made available because it should only be
 // used for very specific policy-related things. In fact, the device account on
@@ -970,7 +971,7 @@
   TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("identity", "GetAccessToken", this);
 
   auto* identity_manager = IdentityManagerFactory::GetForProfile(GetProfile());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chrome::IsRunningInForcedAppMode()) {
     std::string app_client_id;
     std::string app_client_secret;
diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
index bc6cf0a1..17be47f 100644
--- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
+++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
@@ -13,6 +13,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
 #include "base/scoped_observer.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/identity/gaia_remote_consent_flow.h"
 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h"
 #include "chrome/browser/extensions/api/identity/identity_mint_queue.h"
@@ -53,7 +54,7 @@
                                      public GaiaRemoteConsentFlow::Delegate,
                                      public IdentityMintRequestQueue::Request,
                                      public signin::IdentityManager::Observer,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
                                      public OAuth2AccessTokenManager::Consumer,
 #endif
                                      public OAuth2MintTokenFlow::Delegate {
@@ -91,7 +92,7 @@
 // TODO(blundell): Investigate feasibility of moving the ChromeOS use case
 // to use the Identity Service instead of being an
 // OAuth2AccessTokenManager::Consumer.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void OnGetTokenSuccess(
       const OAuth2AccessTokenManager::Request* request,
       const OAuth2AccessTokenConsumer::TokenResponse& token_response) override;
@@ -202,7 +203,7 @@
   void OnRemoteConsentSuccess(
       const RemoteConsentResolutionData& resolution_data) override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Starts a login access token request for device robot account. This method
   // will be called only in Chrome OS for:
   // 1. Enterprise kiosk mode.
diff --git a/chrome/browser/extensions/api/idle/idle_get_auto_lock_delay_apitest.cc b/chrome/browser/extensions/api/idle/idle_get_auto_lock_delay_apitest.cc
index ed3bfd3..b1940df 100644
--- a/chrome/browser/extensions/api/idle/idle_get_auto_lock_delay_apitest.cc
+++ b/chrome/browser/extensions/api/idle/idle_get_auto_lock_delay_apitest.cc
@@ -2,12 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "content/public/test/browser_test.h"
 
 namespace extensions {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IdleGetAutoLockDelay) {
   ASSERT_TRUE(RunExtensionTest("idle/get_auto_lock_delay")) << message_;
 }
diff --git a/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc
index 35ca237..14f3f5ff 100644
--- a/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc
@@ -6,6 +6,7 @@
 #include "base/bind.h"
 #include "base/run_loop.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
 #include "chrome/test/base/testing_profile.h"
@@ -25,7 +26,7 @@
   TestingProfile profile;
   MockOperationManager manager(&profile);
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   auto set_up_utility_client_progress_simulation =
       [](FakeImageWriterClient* client) {
         std::vector<int> progress_list{0, 50, 100};
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
index 8237a84..a15a3eb 100644
--- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
@@ -8,6 +8,7 @@
 
 #include "base/bind.h"
 #include "base/task/post_task.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
 #include "chrome/browser/profiles/profile.h"
@@ -41,7 +42,7 @@
 
 ExtensionFunction::ResponseAction
 ImageWriterPrivateWriteFromUrlFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(browser_context());
   if (profile->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled) ||
       profile->GetPrefs()->GetBoolean(prefs::kExternalStorageReadOnly)) {
@@ -79,7 +80,7 @@
 
 ExtensionFunction::ResponseAction
 ImageWriterPrivateWriteFromFileFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(browser_context());
   if (profile->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled) ||
       profile->GetPrefs()->GetBoolean(prefs::kExternalStorageReadOnly)) {
@@ -137,7 +138,7 @@
 
 ExtensionFunction::ResponseAction
 ImageWriterPrivateDestroyPartitionsFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(browser_context());
   if (profile->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled) ||
       profile->GetPrefs()->GetBoolean(prefs::kExternalStorageReadOnly)) {
@@ -167,7 +168,7 @@
 
 ExtensionFunction::ResponseAction
 ImageWriterPrivateListRemovableStorageDevicesFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(browser_context());
   if (profile->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled)) {
     // Return an empty device list.
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api_unittest.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api_unittest.cc
index c248936..4ac863f 100644
--- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api_unittest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api_unittest.cc
@@ -5,6 +5,7 @@
 #include "base/bind.h"
 #include "base/strings/pattern.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
@@ -17,7 +18,7 @@
 #include "extensions/browser/api_unittest.h"
 
 namespace extensions {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 using api::image_writer_private::RemovableStorageDevice;
 class ImageWriterPrivateApiUnittest : public ExtensionApiUnittest {
  public:
@@ -65,6 +66,6 @@
                          image_writer::error::kDeviceWriteError));
 }
 
-#endif  // if defined(OS_CHROMEOS)
+#endif  // if BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace extensions
\ No newline at end of file
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
index 33606429..367e6f16 100644
--- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_apitest.cc
@@ -5,6 +5,7 @@
 #include "base/bind.h"
 #include "base/strings/pattern.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
@@ -91,7 +92,7 @@
   FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
       &selected_image);
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   auto set_up_utility_client_callbacks = [](FakeImageWriterClient* client) {
     std::vector<int> progress_list{0, 50, 100};
     client->SimulateProgressOnWrite(progress_list, true);
diff --git a/chrome/browser/extensions/api/image_writer_private/operation.cc b/chrome/browser/extensions/api/image_writer_private/operation.cc
index 582b050..374eae9 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation.cc
@@ -10,6 +10,7 @@
 #include "base/files/file_util.h"
 #include "base/task/thread_pool.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
 #include "chrome/browser/extensions/api/image_writer_private/unzip_helper.h"
@@ -78,7 +79,7 @@
 
 void Operation::Start() {
   DCHECK(IsRunningInCorrectSequence());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (download_folder_.empty() ||
       !temp_dir_->CreateUniqueTempDirUnderPath(download_folder_)) {
 #else
@@ -191,7 +192,7 @@
   PostTask(continuation);
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void Operation::StartUtilityClient() {
   DCHECK(IsRunningInCorrectSequence());
   if (!image_writer_client_.get()) {
diff --git a/chrome/browser/extensions/api/image_writer_private/operation.h b/chrome/browser/extensions/api/image_writer_private/operation.h
index 575d2c3..df43382d 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation.h
+++ b/chrome/browser/extensions/api/image_writer_private/operation.h
@@ -18,11 +18,12 @@
 #include "base/sequenced_task_runner.h"
 #include "base/task/task_traits.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h"
 #include "chrome/common/extensions/api/image_writer_private.h"
 #include "extensions/common/extension_id.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/disks/disk_mount_manager.h"
 #endif
 
@@ -162,7 +163,7 @@
   friend class ImageWriterUtilityClientTest;
   friend class WriteFromUrlOperationForTest;
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Ensures the client is started.  This may be called many times but will only
   // instantiate one client which should exist for the lifetime of the
   // Operation.
@@ -178,7 +179,7 @@
   scoped_refptr<ImageWriterUtilityClient> image_writer_client_;
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Unmounts all volumes on |device_path_|.
   void UnmountVolumes(const base::Closure& continuation);
   // Starts the write after unmounting.
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
index efdbee4..bc9cced 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
@@ -9,6 +9,7 @@
 #include "base/lazy_instance.h"
 #include "base/memory/scoped_refptr.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
@@ -26,7 +27,7 @@
 #include "extensions/browser/notification_types.h"
 #include "mojo/public/cpp/bindings/pending_remote.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/file_manager/path_util.h"
 #endif
 
@@ -68,7 +69,7 @@
     const std::string& hash,
     const std::string& device_path,
     Operation::StartWriteCallback callback) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Chrome OS can only support a single operation at a time.
   if (operations_.size() > 0) {
 #else
@@ -102,7 +103,7 @@
     const base::FilePath& path,
     const std::string& device_path,
     Operation::StartWriteCallback callback) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Chrome OS can only support a single operation at a time.
   if (operations_.size() > 0) {
 #else
@@ -214,7 +215,7 @@
 }
 
 base::FilePath OperationManager::GetAssociatedDownloadFolder() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(browser_context_);
   return file_manager::util::GetDownloadsFolderForProfile(profile);
 #endif
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc
index adbdb0d..bda5a10 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/run_loop.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
@@ -31,7 +32,7 @@
 using testing::Gt;
 using testing::Lt;
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 
 void SetUpUtilityClientProgressOnVerifyWrite(
     const std::vector<int>& progress_list,
@@ -40,7 +41,7 @@
   client->SimulateProgressOnVerifyWrite(progress_list, will_succeed);
 }
 
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -168,7 +169,7 @@
 
 #if defined(OS_LINUX) || defined(OS_CHROMEOS)
 TEST_F(ImageWriterOperationTest, WriteImageToDevice) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   auto set_up_utility_client_progress =
       [](const std::vector<int>& progress_list, bool will_succeed,
          FakeImageWriterClient* client) {
@@ -197,7 +198,7 @@
 }
 #endif  // defined(OS_LINUX) || defined(OS_CHROMEOS)
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Chrome OS doesn't support verification in the ImageBurner, so these two tests
 // are skipped.
 
@@ -259,7 +260,7 @@
   operation_->VerifyWrite(base::DoNothing());
   content::RunAllTasksUntilIdle();
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Tests that on creation the operation_ has the expected state.
 TEST_F(ImageWriterOperationTest, Creation) {
diff --git a/chrome/browser/extensions/api/image_writer_private/test_utils.cc b/chrome/browser/extensions/api/image_writer_private/test_utils.cc
index fc78d48..67d63f9 100644
--- a/chrome/browser/extensions/api/image_writer_private/test_utils.cc
+++ b/chrome/browser/extensions/api/image_writer_private/test_utils.cc
@@ -14,9 +14,10 @@
 #include "base/task/thread_pool.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/fake_image_burner_client.h"
 #include "chromeos/disks/disk.h"
@@ -25,7 +26,7 @@
 namespace extensions {
 namespace image_writer {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 namespace {
 
 class ImageWriterFakeImageBurnerClient
@@ -69,7 +70,7 @@
     : OperationManager(context) {}
 MockOperationManager::~MockOperationManager() {}
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 FakeDiskMountManager::FakeDiskMountManager() {}
 FakeDiskMountManager::~FakeDiskMountManager() {}
 
@@ -185,17 +186,17 @@
     cancel_callback_.Run();
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 scoped_refptr<ImageWriterUtilityClient> CreateFakeImageWriterUtilityClient(
     ImageWriterTestUtils* utils) {
   auto* client = new FakeImageWriterClient();
   utils->OnUtilityClientCreated(client);
   return base::WrapRefCounted(client);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 ImageWriterTestUtils::ImageWriterTestUtils()
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
     : utility_client_factory_(
           base::Bind(&CreateFakeImageWriterUtilityClient, this))
 #endif
@@ -204,7 +205,7 @@
 ImageWriterTestUtils::~ImageWriterTestUtils() {
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void ImageWriterTestUtils::OnUtilityClientCreated(
     FakeImageWriterClient* client) {
   DCHECK(!client_.get())
@@ -215,7 +216,7 @@
 }
 #endif
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void ImageWriterTestUtils::RunOnUtilityClientCreation(
     base::OnceCallback<void(FakeImageWriterClient*)> closure) {
   client_creation_callback_ = std::move(closure);
@@ -236,7 +237,7 @@
   ASSERT_TRUE(FillFile(test_image_path_, kImagePattern, kTestFileSize));
   ASSERT_TRUE(FillFile(test_device_path_, kDevicePattern, kTestFileSize));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!chromeos::DBusThreadManager::IsInitialized()) {
     std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter =
         chromeos::DBusThreadManager::GetSetterForTesting();
@@ -263,7 +264,7 @@
 }
 
 void ImageWriterTestUtils::TearDown() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::DBusThreadManager::IsInitialized()) {
     chromeos::DBusThreadManager::Shutdown();
   }
diff --git a/chrome/browser/extensions/api/image_writer_private/test_utils.h b/chrome/browser/extensions/api/image_writer_private/test_utils.h
index f2e1b3c..1e4ddae 100644
--- a/chrome/browser/extensions/api/image_writer_private/test_utils.h
+++ b/chrome/browser/extensions/api/image_writer_private/test_utils.h
@@ -14,6 +14,7 @@
 #include "base/run_loop.h"
 #include "base/test/task_environment.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h"
 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
 #include "content/public/test/browser_task_environment.h"
@@ -21,7 +22,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/disks/disk_mount_manager.h"
 #include "chromeos/disks/mock_disk_mount_manager.h"
 #endif
@@ -60,7 +61,7 @@
                              const std::string& error_message));
 };
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // A fake for the DiskMountManager that will successfully call the unmount
 // callback.
 class FakeDiskMountManager : public chromeos::disks::MockDiskMountManager {
@@ -144,7 +145,7 @@
   ImageWriterTestUtils();
   virtual ~ImageWriterTestUtils();
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   using UtilityClientCreationCallback =
       base::OnceCallback<void(FakeImageWriterClient*)>;
   void RunOnUtilityClientCreation(UtilityClientCreationCallback callback);
@@ -185,7 +186,7 @@
   base::FilePath test_image_path_;
   base::FilePath test_device_path_;
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   scoped_refptr<FakeImageWriterClient> client_;
   ImageWriterUtilityClient::ImageWriterUtilityClientFactory
       utility_client_factory_;
diff --git a/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc b/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc
index fe3d9928..de83d56 100644
--- a/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc
+++ b/chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
 #include "chrome/test/base/testing_profile.h"
@@ -20,7 +21,7 @@
 
 namespace {
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void SetUpImageWriteClientProgressSimulation(FakeImageWriterClient* client) {
   std::vector<int> progress_list{0, 50, 100};
   bool will_succeed = true;
@@ -61,7 +62,7 @@
 
 // Runs the entire WriteFromFile operation.
 TEST_F(ImageWriterFromFileTest, WriteFromFileEndToEnd) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Sets up simulating Operation::Progress() and Operation::Success().
   test_utils_.RunOnUtilityClientCreation(
       base::BindOnce(&SetUpImageWriteClientProgressSimulation));
@@ -81,7 +82,7 @@
               OnProgress(kDummyExtensionId, image_writer_api::STAGE_WRITE, 100))
       .Times(AtLeast(1));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Chrome OS doesn't verify.
   EXPECT_CALL(
       manager_,
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h
index 6443264e..ef8a7cd9 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -14,6 +14,7 @@
 #include "base/scoped_observer.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chromeos/input_method/input_method_engine_base.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/extensions/api/input_ime.h"
@@ -29,9 +30,9 @@
 #include "ui/base/ime/chromeos/ime_engine_handler_interface.h"
 #include "ui/base/ime/text_input_flags.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 class Profile;
 
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc b/chrome/browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc
index 7220e99..dcf7055 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/common/chrome_switches.h"
 #include "content/public/test/browser_test.h"
@@ -11,7 +12,7 @@
 
 namespace extensions {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, InputImeApiBasic) {
   ASSERT_TRUE(RunExtensionTest("input_ime")) << message_;
 }
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
index 1645484..f4ffd0e1 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
@@ -20,6 +20,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h"
 #include "chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h"
@@ -45,7 +46,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/l10n/l10n_util_collator.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/grit/generated_resources.h"
 #include "chromeos/constants/chromeos_features.h"
 #include "ui/base/ime/chromeos/component_extension_ime_manager.h"
@@ -58,7 +59,7 @@
 
 namespace language_settings_private = api::language_settings_private;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 using chromeos::input_method::InputMethodDescriptor;
 using chromeos::input_method::InputMethodDescriptors;
 using chromeos::input_method::InputMethodManager;
@@ -202,7 +203,7 @@
 }
 
 }  // namespace
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 LanguageSettingsPrivateGetLanguageListFunction::
     LanguageSettingsPrivateGetLanguageListFunction()
@@ -232,10 +233,10 @@
 
   // Build the language list.
   language_list_->Clear();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const std::unordered_set<std::string> allowed_ui_locales(
       GetAllowedLanguages(chrome_details_.GetProfile()->GetPrefs()));
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   for (const auto& entry : languages) {
     language_settings_private::Language language;
 
@@ -255,17 +256,17 @@
     if (language::ConvertToActualUILocale(&temp_locale)) {
       language.supports_ui.reset(new bool(true));
     }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     if (!allowed_ui_locales.empty() &&
         allowed_ui_locales.count(language.code) == 0) {
       language.is_prohibited_language.reset(new bool(true));
     }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
     language_list_->Append(language.ToValue());
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Send the display name of the fake language for ARC IMEs to the JS side.
   // |native_display_name| does't have to be set because the language selection
   // drop-down menu doesn't list the fake language.
@@ -276,7 +277,7 @@
         l10n_util::GetStringUTF8(IDS_SETTINGS_LANGUAGES_KEYBOARD_APPS);
     language_list_->Append(language.ToValue());
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if defined(OS_WIN)
   if (spellcheck::UseBrowserSpellChecker()) {
@@ -613,7 +614,7 @@
       profile->GetPrefs(), language_model))));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Populates the vector of input methods using information in the list of
 // descriptors. Used for languageSettingsPrivate.getInputMethodLists().
 void PopulateInputMethodListFromDescriptors(
@@ -677,7 +678,7 @@
 
 ExtensionFunction::ResponseAction
 LanguageSettingsPrivateGetInputMethodListsFunction::Run() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXTENSION_FUNCTION_VALIDATE(false);
   return RespondNow(NoArguments());
 #else
@@ -713,7 +714,7 @@
 
 ExtensionFunction::ResponseAction
 LanguageSettingsPrivateAddInputMethodFunction::Run() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXTENSION_FUNCTION_VALIDATE(false);
 #else
   const auto params =
@@ -768,7 +769,7 @@
 
 ExtensionFunction::ResponseAction
 LanguageSettingsPrivateRemoveInputMethodFunction::Run() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXTENSION_FUNCTION_VALIDATE(false);
 #else
   const auto params =
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
index f19746aa..07eeaa4 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
@@ -12,6 +12,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/scoped_feature_list.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h"
 #include "chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h"
 #include "chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h"
@@ -28,7 +29,7 @@
 #include "extensions/browser/event_router_factory.h"
 #include "extensions/browser/extension_prefs.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ui/base/ime/chromeos/component_extension_ime_manager.h"
 #include "ui/base/ime/chromeos/extension_ime_util.h"
 #include "ui/base/ime/chromeos/fake_input_method_delegate.h"
@@ -302,7 +303,7 @@
   EXPECT_EQ(languages_to_test.size(), languages_to_test_found_count);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 namespace {
 
 namespace input_method = chromeos::input_method;
@@ -555,7 +556,7 @@
   TestInputMethodManager::Shutdown();
 }
 
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if defined(OS_WIN)
 class LanguageSettingsPrivateApiTestDelayInit
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
index ffc0cdd..c883de7 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
@@ -12,6 +12,7 @@
 #include "base/bind.h"
 #include "base/callback_helpers.h"
 #include "base/strings/utf_string_conversions.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/profiles/profile.h"
@@ -61,9 +62,9 @@
       GetPrefs());
 
   StartOrStopListeningForSpellcheckChanges();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   StartOrStopListeningForInputMethodChanges();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 LanguageSettingsPrivateDelegate::~LanguageSettingsPrivateDelegate() {
@@ -111,7 +112,7 @@
     listening_spellcheck_ = false;
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (listening_input_method_) {
     auto* input_method_manager =
         chromeos::input_method::InputMethodManager::Get();
@@ -119,7 +120,7 @@
       input_method_manager->RemoveObserver(this);
     listening_input_method_ = false;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void LanguageSettingsPrivateDelegate::OnListenerAdded(
@@ -132,7 +133,7 @@
     StartOrStopListeningForSpellcheckChanges();
     return;
   }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (details.event_name ==
           language_settings_private::OnInputMethodAdded::kEventName ||
       details.event_name ==
@@ -140,16 +141,16 @@
     StartOrStopListeningForInputMethodChanges();
     return;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void LanguageSettingsPrivateDelegate::OnListenerRemoved(
     const EventListenerInfo& details) {
   // Stop listening to events if there are no more listeners.
   StartOrStopListeningForSpellcheckChanges();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   StartOrStopListeningForInputMethodChanges();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void LanguageSettingsPrivateDelegate::Observe(
@@ -160,7 +161,7 @@
   StartOrStopListeningForSpellcheckChanges();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void LanguageSettingsPrivateDelegate::InputMethodChanged(
     chromeos::input_method::InputMethodManager* manager,
     Profile* profile,
@@ -189,7 +190,7 @@
       std::move(args)));
   EventRouter::Get(context_)->BroadcastEvent(std::move(extension_event));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 void LanguageSettingsPrivateDelegate::OnHunspellDictionaryInitialized(
     const std::string& language) {
@@ -292,7 +293,7 @@
   listening_spellcheck_ = should_listen;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void LanguageSettingsPrivateDelegate::
     StartOrStopListeningForInputMethodChanges() {
   EventRouter* event_router = EventRouter::Get(context_);
@@ -313,7 +314,7 @@
 
   listening_input_method_ = should_listen;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 void LanguageSettingsPrivateDelegate::RetryDownloadHunspellDictionary(
     const std::string& language) {
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
index 17098f4..81ae4fad3 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
@@ -10,6 +10,7 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h"
 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
 #include "chrome/common/extensions/api/language_settings_private.h"
@@ -19,7 +20,7 @@
 #include "content/public/browser/notification_registrar.h"
 #include "extensions/browser/event_router.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ui/base/ime/chromeos/input_method_manager.h"
 #endif
 
@@ -35,9 +36,9 @@
     : public KeyedService,
       public EventRouter::Observer,
       public content::NotificationObserver,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       public chromeos::input_method::InputMethodManager::Observer,
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
       public SpellcheckHunspellDictionary::Observer,
       public SpellcheckCustomDictionary::Observer {
  public:
@@ -68,14 +69,14 @@
   void OnListenerAdded(const EventListenerInfo& details) override;
   void OnListenerRemoved(const EventListenerInfo& details) override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // chromeos::input_method::InputMethodManager::Observer implementation.
   void InputMethodChanged(chromeos::input_method::InputMethodManager* manager,
                           Profile* profile,
                           bool show_message) override;
   void OnInputMethodExtensionAdded(const std::string& extension_id) override;
   void OnInputMethodExtensionRemoved(const std::string& extension_id) override;
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // SpellcheckHunspellDictionary::Observer implementation.
   void OnHunspellDictionaryInitialized(const std::string& language) override;
@@ -105,12 +106,12 @@
   // any observers.
   void StartOrStopListeningForSpellcheckChanges();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // If there are any JavaScript listeners registered for input method events,
   // ensures we are registered for change notifications. Otherwise, unregisters
   // any observers.
   void StartOrStopListeningForInputMethodChanges();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Handles the preference for which languages should be used for spellcheck
   // by resetting the dictionaries and broadcasting an event.
diff --git a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
index 216878ce..ab37bc0 100644
--- a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
+++ b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
@@ -12,6 +12,7 @@
 #include "base/strings/strcat.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/task/post_task.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/app_service/app_launch_params.h"
 #include "chrome/browser/apps/app_service/app_service_proxy.h"
 #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -57,7 +58,7 @@
 #include "services/data_decoder/public/cpp/data_decoder.h"
 #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/arc/arc_util.h"
 #include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
@@ -65,7 +66,7 @@
 #include "components/arc/arc_util.h"
 #include "components/arc/mojom/intent_helper.mojom.h"
 #include "components/arc/session/arc_bridge_service.h"
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
 // TODO(https://crbug.com/1060801): Here and elsewhere, possibly switch build
@@ -76,11 +77,11 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 const char kPlayIntentPrefix[] =
     "https://play.google.com/store/apps/details?id=";
 const char kChromeWebStoreReferrer[] = "&referrer=chrome_web_store";
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 using InstallAndroidAppCallback =
     extensions::ManagementAPIDelegate::InstallAndroidAppCallback;
@@ -92,7 +93,7 @@
     extensions::ManagementAPIDelegate::InstallOrLaunchWebAppResult;
 using InstallableCheckResult = web_app::InstallManager::InstallableCheckResult;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void OnDidCheckForIntentToPlayStore(const std::string& intent,
                                     InstallAndroidAppCallback callback,
                                     bool installable) {
@@ -117,7 +118,7 @@
   instance->HandleUrl(intent, arc::kPlayStorePackage);
   std::move(callback).Run(true);
 }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 class ManagementSetEnabledFunctionInstallPromptDelegate
     : public extensions::InstallPromptDelegate {
@@ -405,7 +406,7 @@
           WindowOpenDisposition::NEW_FOREGROUND_TAB,
           apps::mojom::AppLaunchSource::kSourceManagementApi));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::DemoSession::RecordAppLaunchSourceIfInDemoMode(
       chromeos::DemoSession::AppLaunchSource::kExtensionApi);
 #endif
@@ -532,17 +533,17 @@
 
 bool ChromeManagementAPIDelegate::CanContextInstallAndroidApps(
     content::BrowserContext* context) const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return arc::IsArcAllowedForProfile(Profile::FromBrowserContext(context));
 #else
   return false;
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void ChromeManagementAPIDelegate::CheckAndroidAppInstallStatus(
     const std::string& package_name,
     AndroidAppInstallStatusCallback callback) const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   auto* arc_service_manager = arc::ArcServiceManager::Get();
   if (!arc_service_manager) {
     std::move(callback).Run(false);
@@ -559,13 +560,13 @@
   instance->IsInstallable(package_name, std::move(callback));
 #else
   std::move(callback).Run(false);
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void ChromeManagementAPIDelegate::InstallReplacementAndroidApp(
     const std::string& package_name,
     InstallAndroidAppCallback callback) const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::string intent =
       base::StrCat({kPlayIntentPrefix, package_name, kChromeWebStoreReferrer});
 
@@ -587,7 +588,7 @@
                                    std::move(callback)));
 #else
   std::move(callback).Run(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void ChromeManagementAPIDelegate::EnableExtension(
diff --git a/chrome/browser/extensions/api/management/management_api_browsertest.cc b/chrome/browser/extensions/api/management/management_api_browsertest.cc
index a4abd2f..cfaeb2f2 100644
--- a/chrome/browser/extensions/api/management/management_api_browsertest.cc
+++ b/chrome/browser/extensions/api/management/management_api_browsertest.cc
@@ -10,6 +10,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/extension_function_test_utils.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -33,7 +34,7 @@
 #include "extensions/common/scoped_worker_based_extensions_channel.h"
 #include "extensions/test/extension_test_message_listener.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
 #endif
 
@@ -120,7 +121,7 @@
   ASSERT_TRUE(listener2.WaitUntilSatisfied());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 IN_PROC_BROWSER_TEST_P(ExtensionManagementApiTestWithBackgroundType,
                        NoDemoModeAppLaunchSourceReported) {
diff --git a/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc b/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc
index b9409e8..8ffcaad 100644
--- a/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc
+++ b/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc
@@ -9,6 +9,7 @@
 #include "base/strings/string_util.h"
 #include "base/test/scoped_feature_list.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/background/background_mode_manager.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.h"
@@ -90,7 +91,7 @@
   ASSERT_TRUE(RunLazyTest("native_messaging_lazy")) << message_;
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 
 class TestProcessManagerObserver : public ProcessManagerObserver {
  public:
@@ -444,7 +445,7 @@
   ASSERT_NO_FATAL_FAILURE(TestKeepAliveStateObserver().WaitForNoKeepAlive());
 }
 
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
index 7afd3172..27398be 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
@@ -14,6 +14,7 @@
 #include "base/posix/eintr_wrapper.h"
 #include "base/process/launch.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/chrome_paths.h"
 
 namespace extensions {
@@ -79,7 +80,9 @@
 
   options.current_directory = command_line.GetProgram().DirName();
 
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   // Don't use no_new_privs mode, e.g. in case the host needs to use sudo.
   options.allow_new_privs = true;
 #endif
diff --git a/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc
index 0012c16..c839f67 100644
--- a/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc
+++ b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc
@@ -12,6 +12,7 @@
 #include "base/macros.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h"
 #include "chrome/browser/extensions/extension_apitest.h"
@@ -19,7 +20,7 @@
 #include "extensions/browser/api/networking_private/networking_cast_private_delegate.h"
 #include "extensions/common/switches.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/shill/shill_device_client.h"
 #include "chromeos/dbus/shill/shill_service_client.h"
@@ -95,7 +96,7 @@
   void SetUpOnMainThread() override {
     ExtensionApiTest::SetUpOnMainThread();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     chromeos::DBusThreadManager* dbus_manager =
         chromeos::DBusThreadManager::Get();
     chromeos::ShillDeviceClient::TestInterface* device_test =
@@ -110,7 +111,7 @@
     service_test->AddService("stub_wifi", "stub_wifi_guid", "wifi",
                              shill::kTypeWifi, shill::kStateOnline,
                              true /* add_to_visible */);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   }
 
   void TearDown() override {
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_factory_impl.cc b/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_factory_impl.cc
index f4ec25dd..c32321a 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_factory_impl.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_factory_impl.cc
@@ -7,8 +7,9 @@
 #include <memory>
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.h"
 #endif
 
@@ -22,7 +23,7 @@
 
 std::unique_ptr<NetworkingPrivateDelegate::UIDelegate>
 NetworkingPrivateUIDelegateFactoryImpl::CreateDelegate() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return std::make_unique<
       chromeos::extensions::NetworkingPrivateUIDelegateChromeOS>();
 #else
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index 53a9e63..812097d 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -18,6 +18,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/notifications/extension_notification_display_helper.h"
 #include "chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h"
@@ -81,7 +82,7 @@
 const char kNotificationIdTooLong[] =
     "The notification's ID should be %d characters or less";
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 const char kLowPriorityDeprecatedOnPlatform[] =
     "Low-priority notifications are deprecated on this platform.";
 #endif
@@ -236,7 +237,7 @@
     return false;
   }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   if (options->priority &&
       *options->priority < message_center::DEFAULT_PRIORITY) {
     *error = kLowPriorityDeprecatedOnPlatform;
@@ -390,7 +391,7 @@
     api::notifications::NotificationOptions* options,
     message_center::Notification* notification,
     std::string* error) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   if (options->priority &&
       *options->priority < message_center::DEFAULT_PRIORITY) {
     *error = kLowPriorityDeprecatedOnPlatform;
diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc
index fdaf3c7..1cd8018 100644
--- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc
+++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc
@@ -12,6 +12,7 @@
 #include "base/callback_helpers.h"
 #include "base/files/file_util.h"
 #include "base/task/thread_pool.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
 #include "chrome/browser/extensions/extension_util.h"
@@ -29,7 +30,7 @@
 #include "extensions/common/extension_messages.h"
 #include "extensions/common/permissions/permissions_data.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/extensions/public_session_permission_helper.h"
 #include "extensions/common/permissions/api_permission_set.h"
 #endif
@@ -50,7 +51,7 @@
 const char kTabClosedError[] = "Cannot find the tab for this request.";
 const char kPageCaptureNotAllowed[] =
     "Don't have permissions required to capture this page.";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 const char kUserDenied[] = "User denied request.";
 #endif
 constexpr base::TaskTraits kCreateTemporaryFileTaskTraits = {
@@ -101,7 +102,7 @@
   if (is_from_service_worker())
     AddWorkerResponseTarget();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // In Public Sessions, extensions (and apps) are force-installed by admin
   // policy so the user does not get a chance to review the permissions for
   // these extensions. This is not acceptable from a security/privacy
@@ -195,7 +196,7 @@
   Release();  // Balanced in Run()
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void PageCaptureSaveAsMHTMLFunction::ResolvePermissionRequest(
     const PermissionIDSet& allowed_permissions) {
   if (allowed_permissions.ContainsID(APIPermission::kPageCapture)) {
diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.h b/chrome/browser/extensions/api/page_capture/page_capture_api.h
index d2a3b34..eab8a47 100644
--- a/chrome/browser/extensions/api/page_capture/page_capture_api.h
+++ b/chrome/browser/extensions/api/page_capture/page_capture_api.h
@@ -10,6 +10,7 @@
 #include <string>
 
 #include "base/memory/ref_counted.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/extensions/api/page_capture.h"
 #include "extensions/browser/extension_function.h"
 #include "storage/browser/blob/shareable_file_reference.h"
@@ -24,7 +25,7 @@
 
 namespace extensions {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 class PermissionIDSet;
 #endif
 
@@ -50,7 +51,7 @@
   ResponseAction Run() override;
   bool OnMessageReceived(const IPC::Message& message) override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Resolves the API permission request in Public Sessions.
   void ResolvePermissionRequest(const PermissionIDSet& allowed_permissions);
 #endif
diff --git a/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc b/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc
index 448504d1..67e19a18 100644
--- a/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc
+++ b/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc
@@ -8,6 +8,7 @@
 #include "base/command_line.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/active_tab_permission_granter.h"
 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h"
 #include "chrome/browser/extensions/extension_action_runner.h"
@@ -30,9 +31,9 @@
 #include "extensions/test/result_catcher.h"
 #include "net/dns/mock_host_resolver.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/login/login_state/login_state.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -151,7 +152,7 @@
   WaitForFileCleanup(&delegate);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_P(ExtensionPageCaptureApiTest,
                        PublicSessionRequestAllowed) {
   ASSERT_TRUE(StartEmbeddedTestServer());
@@ -173,6 +174,6 @@
   ASSERT_TRUE(RunTestWithArg("page_capture", "REQUEST_DENIED")) << message_;
   EXPECT_EQ(0, delegate.temp_file_count());
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
index 79da8951..79f48059 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
@@ -13,6 +13,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h"
 #include "chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h"
 #include "chrome/browser/password_manager/account_password_store_factory.h"
@@ -42,7 +43,7 @@
 #include "chrome/browser/password_manager/password_manager_util_win.h"
 #elif defined(OS_MAC)
 #include "chrome/browser/password_manager/password_manager_util_mac.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/quick_unlock/auth_token.h"
 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h"
 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h"
@@ -59,7 +60,7 @@
 // The error message returned to the UI when the user fails to reauthenticate.
 const char kReauthenticationFailed[] = "reauth-failed";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 constexpr base::TimeDelta kShowPasswordAuthTokenLifetime =
     password_manager::PasswordAccessAuthenticator::kAuthValidityPeriod;
 constexpr base::TimeDelta kExportPasswordsAuthTokenLifetime =
@@ -331,7 +332,7 @@
       web_contents_->GetTopLevelNativeWindow(), purpose);
 #elif defined(OS_MAC)
   return password_manager_util_mac::AuthenticateUser(purpose);
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
   const bool user_cannot_manually_enter_password =
       !chromeos::password_visibility::AccountHasUserFacingPassword(
           chromeos::ProfileHelper::Get()
diff --git a/chrome/browser/extensions/api/permissions/permissions_apitest.cc b/chrome/browser/extensions/api/permissions/permissions_apitest.cc
index 847cf18..1655c6e7 100644
--- a/chrome/browser/extensions/api/permissions/permissions_apitest.cc
+++ b/chrome/browser/extensions/api/permissions/permissions_apitest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/test/metrics/histogram_tester.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/extensions/extension_management_test_util.h"
@@ -117,7 +118,7 @@
 // Test functions and APIs that are always allowed (even if you ask for no
 // permissions).
 // Flaky on MacOS and Linux (see crbug/1064929, crbug/1101043).
-#if (defined(OS_MAC) || defined(OS_CHROMEOS))
+#if (defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH))
 #define MAYBE_AlwaysAllowed DISABLED_AlwaysAllowed
 #else
 #define MAYBE_AlwaysAllowed AlwaysAllowed
diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc
index b0738d2..c7133735d3 100644
--- a/chrome/browser/extensions/api/preference/preference_api.cc
+++ b/chrome/browser/extensions/api/preference/preference_api.cc
@@ -17,6 +17,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/content_settings/content_settings_service.h"
 #include "chrome/browser/extensions/api/preference/preference_api_constants.h"
 #include "chrome/browser/extensions/api/preference/preference_helpers.h"
@@ -49,7 +50,7 @@
 #include "extensions/common/permissions/permissions_data.h"
 #include "media/media_buildflags.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/public/cpp/ash_pref_names.h"  // nogncheck
 #endif
 
@@ -139,7 +140,7 @@
     {"animationPolicy", prefs::kAnimationPolicy,
      APIPermission::kAccessibilityFeaturesRead,
      APIPermission::kAccessibilityFeaturesModify},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     {"autoclick", ash::prefs::kAccessibilityAutoclickEnabled,
      APIPermission::kAccessibilityFeaturesRead,
      APIPermission::kAccessibilityFeaturesModify},
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
index 35719ac..1e36e2cd 100644
--- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
+++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
@@ -18,6 +18,7 @@
 #include "base/time/tick_clock.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
 #include "chrome/browser/extensions/updater/extension_updater.h"
@@ -37,7 +38,7 @@
 #include "extensions/common/manifest.h"
 #include "net/base/backoff_entry.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/power/power_manager_client.h"
 #include "components/user_manager/user_manager.h"
@@ -332,7 +333,7 @@
 }
 
 bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) {
     chromeos::PowerManagerClient::Get()->RequestRestart(
         power_manager::REQUEST_RESTART_OTHER, "chrome.runtime API");
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
index a714adcf..7a86ff4 100644
--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
+++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
@@ -16,6 +16,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
 #include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_content_browser_client.h"
 #include "chrome/browser/enterprise/connectors/common.h"
@@ -46,7 +47,7 @@
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/browser_process_platform_part_chromeos.h"
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
@@ -61,7 +62,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 const char kActiveDirectoryPolicyClientDescription[] = "an Active Directory";
 const char kPolicyClientDescription[] = "any";
 const char kUserPolicyClientDescription[] = "a user";
@@ -812,7 +813,7 @@
   policy::CloudPolicyClient* client = nullptr;
   std::string policy_client_desc;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   policy_client_desc = kPolicyClientDescription;
   auto* user = GetChromeOSUser();
   if (user) {
@@ -973,7 +974,7 @@
   return safe_browsing::GetProfileEmail(identity_manager_);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // static
 const user_manager::User* SafeBrowsingPrivateEventRouter::GetChromeOSUser() {
   return user_manager::UserManager::IsInitialized()
@@ -984,7 +985,7 @@
 #endif
 
 bool SafeBrowsingPrivateEventRouter::IsRealtimeReportingAvailable() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // The device must be managed.
   if (!g_browser_process->platform_part()
            ->browser_policy_connector_chromeos()
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h
index c9016ac6..cc5844ea 100644
--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h
+++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h
@@ -13,6 +13,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "components/policy/core/common/cloud/cloud_policy_client.h"
@@ -41,7 +42,7 @@
 enum class DeepScanAccessPoint;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace user_manager {
 class User;
@@ -246,7 +247,7 @@
   void OnCloudPolicyClientAvailable(const std::string& policy_client_desc,
                                     policy::CloudPolicyClient* client);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Return the Chrome OS user who is subject to reporting, or nullptr if
   // the user cannot be deterined.
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc
index e1de54a..d1c8aa7 100644
--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc
+++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc
@@ -15,6 +15,7 @@
 #include "base/values.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/enterprise/connectors/common.h"
 #include "chrome/browser/enterprise/connectors/connectors_manager.h"
 #include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h"
@@ -37,7 +38,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
@@ -254,9 +255,9 @@
   extensions::TestEventRouter* event_router_ = nullptr;
 
  private:
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   policy::FakeBrowserDMTokenStorage dm_token_storage_;
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPrivateEventRouterTest);
 };
@@ -958,7 +959,7 @@
     }
 
     // In chrome branded desktop builds, the browser is always manageable.
-#if !BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(OS_CHROMEOS)
+#if !BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS_ASH)
     if (is_manageable_) {
       base::CommandLine::ForCurrentProcess()->AppendSwitch(
           switches::kEnableChromeBrowserCloudManagement);
@@ -972,7 +973,7 @@
           kConnectorsPrefValue);
     }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     auto user_manager = std::make_unique<chromeos::FakeChromeUserManager>();
     const AccountId account_id(
         AccountId::FromUserEmail(profile_->GetProfileUserName()));
@@ -1001,7 +1002,7 @@
   }
 
   bool should_init() {
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS_ASH)
     return is_feature_flag_enabled_;
 #else
     return is_feature_flag_enabled_ && is_manageable_;
@@ -1035,7 +1036,7 @@
   const bool is_policy_enabled_;
   const bool is_authorized_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
  private:
   std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_;
 #endif
@@ -1057,7 +1058,7 @@
       api::safe_browsing_private::OnPolicySpecifiedPasswordChanged::kEventName);
   event_router_->AddEventObserver(&event_observer);
 
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS_ASH)
   bool should_report =
       is_feature_flag_enabled_ && is_policy_enabled_ && is_authorized_;
 #else
diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
index db10d6a..ba59386 100644
--- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
@@ -17,6 +17,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/test/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/sessions/sessions_api.h"
 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
 #include "chrome/browser/extensions/extension_apitest.h"
@@ -39,7 +40,7 @@
 #include "extensions/browser/api_test_utils.h"
 #include "extensions/common/extension_builder.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_switches.h"
 #endif
 
@@ -174,7 +175,7 @@
 };
 
 void ExtensionSessionsTest::SetUpCommandLine(base::CommandLine* command_line) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   command_line->AppendSwitch(
       chromeos::switches::kIgnoreUserProfileMappingForTests);
 #endif
diff --git a/chrome/browser/extensions/api/settings_private/generated_prefs.cc b/chrome/browser/extensions/api/settings_private/generated_prefs.cc
index 4ff9d4cc..f9704d6 100644
--- a/chrome/browser/extensions/api/settings_private/generated_prefs.cc
+++ b/chrome/browser/extensions/api/settings_private/generated_prefs.cc
@@ -6,6 +6,7 @@
 
 #include "base/callback.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/content_settings/generated_cookie_prefs.h"
 #include "chrome/browser/content_settings/generated_notification_pref.h"
 #include "chrome/browser/extensions/api/settings_private/generated_pref.h"
@@ -15,7 +16,7 @@
 #include "chrome/common/extensions/api/settings_private.h"
 #include "components/content_settings/core/common/pref_names.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.h"
 #include "chrome/browser/extensions/api/settings_private/chromeos_resolve_time_zone_by_geolocation_on_off.h"
 #endif
@@ -84,7 +85,7 @@
 }
 
 void GeneratedPrefs::CreatePrefs() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   prefs_[kResolveTimezoneByGeolocationOnOff] =
       CreateGeneratedResolveTimezoneByGeolocationOnOff(profile_);
   prefs_[kResolveTimezoneByGeolocationMethodShort] =
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc
index 1657a769..74d0b33 100644
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -7,6 +7,7 @@
 #include "base/feature_list.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_process_platform_part.h"
 #include "chrome/browser/content_settings/generated_cookie_prefs.h"
@@ -49,7 +50,7 @@
 #include "extensions/browser/management_policy.h"
 #include "extensions/common/extension.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/public/cpp/ambient/ambient_prefs.h"
 #include "ash/public/cpp/ash_pref_names.h"  // nogncheck
 #include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
@@ -75,7 +76,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool IsPrivilegedCrosSetting(const std::string& pref_name) {
   if (!chromeos::CrosSettings::IsCrosSettings(pref_name))
     return false;
@@ -118,7 +119,7 @@
   // for policy indicators, but should not be changed directly.
   if (pref_name == prefs::kDownloadDefaultDirectory)
     return true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // System timezone is never directly changeable by the user.
   if (pref_name == chromeos::kSystemTimezone)
     return chromeos::system::PerUserTimezoneEnabled();
@@ -147,7 +148,7 @@
 
 PrefsUtil::~PrefsUtil() {}
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 using CrosSettings = chromeos::CrosSettings;
 #endif
 
@@ -171,7 +172,9 @@
   (*s_allowlist)[bookmarks::prefs::kShowBookmarkBar] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   (*s_allowlist)[::prefs::kUseCustomChromeFrame] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 #endif
@@ -181,7 +184,9 @@
   // Appearance settings.
   (*s_allowlist)[::prefs::kCurrentThemeID] =
       settings_api::PrefType::PREF_TYPE_STRING;
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   (*s_allowlist)[::prefs::kUsesSystemTheme] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 #endif
@@ -226,7 +231,7 @@
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
   (*s_allowlist)[drive::prefs::kDisableDrive] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   (*s_allowlist)[::prefs::kNetworkFileSharesAllowed] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
   (*s_allowlist)[::prefs::kMostRecentlyUsedNetworkFileShareURL] =
@@ -297,7 +302,7 @@
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
   (*s_allowlist)[language::prefs::kFluentLanguages] =
       settings_api::PrefType::PREF_TYPE_LIST;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   (*s_allowlist)[::prefs::kLanguageImeMenuActivated] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
   (*s_allowlist)[chromeos::prefs::kAssistPersonalInfoEnabled] =
@@ -308,7 +313,7 @@
       settings_api::PrefType::PREF_TYPE_DICTIONARY;
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Nearby Share.
   (*s_allowlist)[::prefs::kNearbySharingEnabledPrefName] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
@@ -393,14 +398,14 @@
   (*s_allowlist)[::prefs::kLiveCaptionEnabled] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 #endif
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   (*s_allowlist)[::prefs::kAccessibilityFocusHighlightEnabled] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 #endif
   (*s_allowlist)[::prefs::kCaretBrowsingEnabled] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Accounts / Users / People.
   (*s_allowlist)[chromeos::kAccountsPrefAllowGuest] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
@@ -790,7 +795,7 @@
   std::unique_ptr<settings_api::PrefObject> pref_object(
       new settings_api::PrefObject());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const base::Value* value = CrosSettings::Get()->GetPref(name);
   if (!value) {
     LOG(ERROR) << "Cros settings pref not found: " << name;
@@ -832,7 +837,7 @@
     pref_object->value.reset(pref->GetValue()->DeepCopy());
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // We first check for enterprise-managed, then for primary-user managed.
   // Otherwise in multiprofile mode enterprise preference for the secondary
   // user will appear primary-user-controlled, which looks strange, because
@@ -885,7 +890,7 @@
     return pref_object;
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (IsPrefOwnerControlled(name)) {
     // Check for owner controlled after managed checks because if there is a
     // device policy there is no "owner". (In the unlikely case that both
@@ -1001,7 +1006,7 @@
 settings_private::SetPrefResult PrefsUtil::SetCrosSettingsPref(
     const std::string& pref_name,
     const base::Value* value) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (pref_name == chromeos::kSystemTimezone) {
     std::string string_value;
     if (!value->GetAsString(&string_value))
@@ -1030,7 +1035,7 @@
 
 bool PrefsUtil::AppendToListCrosSetting(const std::string& pref_name,
                                         const base::Value& value) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::OwnerSettingsServiceChromeOS* service =
       chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
           profile_);
@@ -1045,7 +1050,7 @@
 
 bool PrefsUtil::RemoveFromListCrosSetting(const std::string& pref_name,
                                           const base::Value& value) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::OwnerSettingsServiceChromeOS* service =
       chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
           profile_);
@@ -1063,7 +1068,7 @@
          settings_api::PrefType::PREF_TYPE_URL;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool PrefsUtil::IsPrefEnterpriseManaged(const std::string& pref_name) {
   policy::BrowserPolicyConnectorChromeOS* connector =
       g_browser_process->platform_part()->browser_policy_connector_chromeos();
@@ -1142,7 +1147,7 @@
   // See http://crbug.com/157147
 
   if (pref_name == proxy_config::prefs::kProxy) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     return user_prefs;
 #else
     return g_browser_process->local_state();
@@ -1162,7 +1167,7 @@
 }
 
 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return CrosSettings::Get()->IsCrosSettings(pref_name);
 #else
   return false;
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.h b/chrome/browser/extensions/api/settings_private/prefs_util.h
index c1b8fba..569aa01 100644
--- a/chrome/browser/extensions/api/settings_private/prefs_util.h
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.h
@@ -11,6 +11,7 @@
 
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/settings_private/prefs_util_enums.h"
 #include "chrome/common/extensions/api/settings_private.h"
 
@@ -69,7 +70,7 @@
   // Returns whether |pref_name| corresponds to a pref whose type is URL.
   bool IsPrefTypeURL(const std::string& pref_name);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Returns whether |pref_name| corresponds to a pref that is enterprise
   // managed.
   bool IsPrefEnterpriseManaged(const std::string& pref_name);
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_apitest.cc b/chrome/browser/extensions/api/settings_private/settings_private_apitest.cc
index 8e29fae..b91aa95e 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_apitest.cc
+++ b/chrome/browser/extensions/api/settings_private/settings_private_apitest.cc
@@ -11,6 +11,7 @@
 #include "base/task/current_thread.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
 #include "chrome/browser/extensions/api/settings_private/settings_private_delegate.h"
 #include "chrome/browser/extensions/api/settings_private/settings_private_delegate_factory.h"
@@ -32,7 +33,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
 #endif
 
@@ -76,7 +77,7 @@
  private:
   testing::NiceMock<policy::MockConfigurationPolicyProvider> provider_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
 #endif
 
@@ -133,7 +134,7 @@
   EXPECT_TRUE(RunSettingsSubtest("onPrefsChanged")) << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SettingsPrivateApiTest, GetPref_CrOSSetting) {
   EXPECT_TRUE(RunSettingsSubtest("getPref_CrOSSetting")) << message_;
 }
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc b/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
index 1306388b..ffe3ea2 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
+++ b/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
@@ -11,6 +11,7 @@
 #include "base/callback_helpers.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/settings_private/generated_prefs.h"
 #include "chrome/browser/extensions/api/settings_private/generated_prefs_factory.h"
@@ -47,7 +48,7 @@
   EventRouter::Get(context_)->UnregisterObserver(this);
 
   if (listening_) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     cros_settings_subscription_map_.clear();
 #endif
     const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
@@ -98,7 +99,7 @@
     for (const auto& it : keys) {
       std::string pref_name = it.first;
       if (prefs_util_->IsCrosSetting(pref_name)) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
         base::CallbackListSubscription subscription =
             chromeos::CrosSettings::Get()->AddSettingsObserver(
                 pref_name.c_str(),
@@ -120,7 +121,7 @@
     const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
     for (const auto& it : keys) {
       if (prefs_util_->IsCrosSetting(it.first)) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
         cros_settings_subscription_map_.erase(it.first);
 #endif
       } else if (generated_prefs && generated_prefs->HasPref(it.first)) {
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_event_router.h b/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
index 25b5742..207bc67 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
+++ b/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
@@ -10,13 +10,14 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/settings_private/generated_pref.h"
 #include "chrome/browser/extensions/api/settings_private/prefs_util.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "components/prefs/pref_change_registrar.h"
 #include "extensions/browser/event_router.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #endif
 
@@ -73,7 +74,7 @@
 
   PrefChangeRegistrar* FindRegistrarForPref(const std::string& pref_name);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   using SubscriptionMap = std::map<std::string, base::CallbackListSubscription>;
   SubscriptionMap cros_settings_subscription_map_;
 #endif
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index b7fc9ae..fe7ec5bf 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -15,6 +15,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/one_shot_event.h"
 #include "base/scoped_observer.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/storage/policy_value_store.h"
 #include "chrome/browser/policy/profile_policy_connector.h"
 #include "chrome/browser/policy/schema_registry_service.h"
@@ -40,7 +41,7 @@
 #include "extensions/common/manifest.h"
 #include "extensions/common/manifest_constants.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #endif
 
@@ -320,7 +321,7 @@
 
 // static
 policy::PolicyDomain ManagedValueStoreCache::GetPolicyDomain(Profile* profile) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return chromeos::ProfileHelper::IsSigninProfile(profile)
              ? policy::POLICY_DOMAIN_SIGNIN_EXTENSIONS
              : policy::POLICY_DOMAIN_EXTENSIONS;
diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_apitest.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_apitest.cc
index 70d5c9c..9e5a851 100644
--- a/chrome/browser/extensions/api/system_indicator/system_indicator_apitest.cc
+++ b/chrome/browser/extensions/api/system_indicator/system_indicator_apitest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager.h"
 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h"
 #include "chrome/browser/extensions/extension_apitest.h"
@@ -49,7 +50,7 @@
 };
 
 // https://crbug.com/960363: Test crashes on ChromeOS.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #define MAYBE_SystemIndicatorBasic DISABLED_SystemIndicatorBasic
 #else
 #define MAYBE_SystemIndicatorBasic SystemIndicatorBasic
diff --git a/chrome/browser/extensions/api/system_private/system_private_api.cc b/chrome/browser/extensions/api/system_private/system_private_api.cc
index ce66a793..802b3dd 100644
--- a/chrome/browser/extensions/api/system_private/system_private_api.cc
+++ b/chrome/browser/extensions/api/system_private/system_private_api.cc
@@ -10,6 +10,7 @@
 #include "base/stl_util.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/event_router_forwarder.h"
 #include "chrome/browser/profiles/profile.h"
@@ -18,7 +19,7 @@
 #include "components/prefs/pref_service.h"
 #include "google_apis/google_api_keys.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/update_engine_client.h"
 #else
@@ -43,9 +44,9 @@
 const char kNotAvailableState[] = "NotAvailable";
 const char kNeedRestartState[] = "NeedRestart";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 const char kUpdatingState[] = "Updating";
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -68,7 +69,7 @@
 ExtensionFunction::ResponseAction SystemPrivateGetUpdateStatusFunction::Run() {
   std::string state;
   double download_progress = 0;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // With UpdateEngineClient, we can provide more detailed information about
   // system updates on ChromeOS.
   const update_engine::StatusResult status = chromeos::DBusThreadManager::Get()
diff --git a/chrome/browser/extensions/api/system_private/system_private_apitest.cc b/chrome/browser/extensions/api/system_private/system_private_apitest.cc
index cfbadf4b..991df38 100644
--- a/chrome/browser/extensions/api/system_private/system_private_apitest.cc
+++ b/chrome/browser/extensions/api/system_private/system_private_apitest.cc
@@ -4,6 +4,7 @@
 
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
@@ -11,7 +12,7 @@
 #include "components/prefs/pref_service.h"
 #include "content/public/test/browser_test.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/fake_update_engine_client.h"
 
@@ -28,7 +29,7 @@
       "system/get_incognito_mode_availability")) << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 class GetUpdateStatusApiTest : public ExtensionApiTest {
  public:
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc
index 30dc47d..9bcecd34 100644
--- a/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc
+++ b/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc
@@ -10,6 +10,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/test/trace_event_analyzer.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/api/tab_capture/tab_capture_performance_test_base.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/profiles/profile.h"
@@ -334,7 +335,7 @@
       PrintFailRateResults(analyzer.get(), kEventCapture));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 // On ChromeOS, software compositing is not an option, and using MSAN on
 // ChromeOS causes problems due to its hardware OpenGL library.
@@ -355,4 +356,4 @@
                                          kTestThroughWebRTC,
                                          kTestThroughWebRTC | kUseGpu));
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
index 69a7e13..4a2f34f 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
@@ -9,6 +9,7 @@
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/api/tab_groups/tab_groups_util.h"
 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
@@ -32,7 +33,7 @@
 #include "ui/display/test/scoped_screen_override.h"
 #include "ui/display/test/test_screen.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/policy/dlp/mock_dlp_content_manager.h"
 #include "chromeos/ui/base/window_pin_type.h"
 #include "chromeos/ui/base/window_properties.h"
@@ -1031,7 +1032,7 @@
   base::RunLoop().RunUntilIdle();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(TabsApiUnitTest, DontCreateTabsInLockedFullscreenMode) {
   scoped_refptr<const Extension> extension_with_tabs_permission =
       CreateTabsExtension();
@@ -1088,6 +1089,6 @@
   browser()->tab_strip_model()->CloseAllTabs();
   policy::DlpContentManager::ResetDlpContentManagerForTesting();
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc
index 25a7bd4e..0a4596e0 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -19,6 +19,7 @@
 #include "base/test/simple_test_tick_clock.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/devtools/devtools_window_testing.h"
@@ -1060,7 +1061,9 @@
   Browser* new_window = ExtensionTabUtil::GetBrowserFromWindowID(
       ChromeExtensionFunctionDetails(function.get()), window_id, &error);
   EXPECT_TRUE(error.empty());
-#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#if !(defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
   // DesktopWindowTreeHostX11::IsMinimized() relies on an asynchronous update
   // from the window server.
   EXPECT_TRUE(new_window->window()->IsMinimized());
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index 68ca3252..a2e981cc 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -30,6 +30,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/time.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/content_settings/cookie_settings_factory.h"
 #include "chrome/browser/extensions/event_router_forwarder.h"
 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
@@ -60,7 +61,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/mojom/service_worker/service_worker_object.mojom-forward.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/login/login_state/scoped_test_public_session_login_state.h"
 #include "components/crx_file/id_util.h"
 #endif
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
index fe5df02..9fff192a 100644
--- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -25,6 +25,7 @@
 #include "base/time/time_override.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/devtools/url_constants.h"
@@ -123,10 +124,10 @@
 #include "ui/base/ui_base_features.h"
 #include "url/origin.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chromeos/login/login_state/login_state.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 using content::WebContents;
 
@@ -463,7 +464,7 @@
   ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestPublicSession) {
   ASSERT_TRUE(StartEmbeddedTestServer());
   chromeos::ScopedTestPublicSessionLoginState login_state;
@@ -475,7 +476,7 @@
   WebRequestPermissions::AllowAllExtensionLocationsInPublicSessionForTesting(
       false);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Test that a request to an OpenSearch description document (OSDD) generates
 // an event with the expected details.
@@ -1791,9 +1792,9 @@
 
   // Create a profile that will be destroyed later.
   base::ScopedAllowBlockingForTesting allow_blocking;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ProfileHelper::SetAlwaysReturnPrimaryUserForTesting(true);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ProfileManager* profile_manager = g_browser_process->profile_manager();
   Profile* temp_profile =
       Profile::CreateProfile(
diff --git a/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc
index 255a0be..95f017a 100644
--- a/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc
@@ -7,6 +7,7 @@
 #include <memory>
 
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service_test_base.h"
 #include "chrome/common/extensions/extension_test_util.h"
 #include "chrome/common/url_constants.h"
@@ -22,9 +23,9 @@
 #include "services/network/public/mojom/fetch_api.mojom-shared.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/login/login_state/login_state.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 using extension_test_util::LoadManifestUnchecked;
 using extensions::Extension;
@@ -244,7 +245,7 @@
           WebRequestPermissions::REQUIRE_ALL_URLS, initiator, kWebRequestType));
 
   // Public Sessions tests.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const GURL org_url("http://example.org");
 
   // com_extension_ doesn't have host permission for .org URLs.
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 1070063..e319ef8a 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -12,6 +12,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
 #include "chrome/browser/extensions/extension_function_test_utils.h"
@@ -60,7 +61,7 @@
 #include "components/signin/public/identity_manager/identity_test_environment.h"
 #include "extensions/common/extension_builder.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_switches.h"
 #endif
 
diff --git a/chrome/browser/extensions/app_background_page_apitest.cc b/chrome/browser/extensions/app_background_page_apitest.cc
index cbc051032..35b6880 100644
--- a/chrome/browser/extensions/app_background_page_apitest.cc
+++ b/chrome/browser/extensions/app_background_page_apitest.cc
@@ -467,7 +467,7 @@
 }
 
 // TODO(https://crbug.com/1124033): Fails on LaCrOS bot.
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
 #define MAYBE_OpenPopupFromBGPage DISABLED_OpenPopupFromBGPage
 #else
 #define MAYBE_OpenPopupFromBGPage OpenPopupFromBGPage
diff --git a/chrome/browser/extensions/browser_context_keyed_service_factories.cc b/chrome/browser/extensions/browser_context_keyed_service_factories.cc
index 310abda..7591f15 100644
--- a/chrome/browser/extensions/browser_context_keyed_service_factories.cc
+++ b/chrome/browser/extensions/browser_context_keyed_service_factories.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/extensions/browser_context_keyed_service_factories.h"
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/activity_log/activity_log.h"
 #include "chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h"
 #include "chrome/browser/extensions/api/autofill_private/autofill_private_event_router_factory.h"
@@ -57,7 +58,7 @@
 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/api/platform_keys/verify_trust_api.h"
 #include "chrome/browser/extensions/api/terminal/terminal_private_api.h"
 #endif
@@ -103,7 +104,7 @@
   extensions::IdentityAPI::GetFactoryInstance();
   extensions::InstallTrackerFactory::GetInstance();
   extensions::InstallVerifierFactory::GetInstance();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   extensions::InputImeAPI::GetFactoryInstance();
 #endif
   extensions::LanguageSettingsPrivateDelegateFactory::GetInstance();
@@ -111,7 +112,7 @@
   extensions::MDnsAPI::GetFactoryInstance();
 #endif
   extensions::MenuManagerFactory::GetInstance();
-#if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_MAC)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN) || defined(OS_MAC)
   auto networking_private_ui_delegate_factory =
       std::make_unique<extensions::NetworkingPrivateUIDelegateFactoryImpl>();
   extensions::NetworkingPrivateDelegateFactory::GetInstance()
@@ -135,11 +136,11 @@
   extensions::SystemIndicatorManagerFactory::GetInstance();
   extensions::TabCaptureRegistry::GetFactoryInstance();
   extensions::TabsWindowsAPI::GetFactoryInstance();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   extensions::TerminalPrivateAPI::GetFactoryInstance();
 #endif
   extensions::TtsAPI::GetFactoryInstance();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   extensions::VerifyTrustAPI::GetFactoryInstance();
 #endif
   extensions::WarningBadgeServiceFactory::GetInstance();
diff --git a/chrome/browser/extensions/browsertest_util.cc b/chrome/browser/extensions/browsertest_util.cc
index 2879cdb..c75c638 100644
--- a/chrome/browser/extensions/browsertest_util.cc
+++ b/chrome/browser/extensions/browsertest_util.cc
@@ -11,6 +11,7 @@
 #include "base/path_service.h"
 #include "base/run_loop.h"
 #include "base/test/bind.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/app_service/app_launch_params.h"
 #include "chrome/browser/apps/app_service/app_service_proxy.h"
 #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -32,7 +33,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/updater/local_extension_cache.h"
 #include "chromeos/constants/chromeos_paths.h"
 #endif
@@ -41,7 +42,7 @@
 namespace browsertest_util {
 
 void CreateAndInitializeLocalCache() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   base::FilePath extension_cache_dir;
   CHECK(base::PathService::Get(chromeos::DIR_DEVICE_EXTENSION_LOCAL_CACHE,
                                &extension_cache_dir));
diff --git a/chrome/browser/extensions/chrome_app_icon.cc b/chrome/browser/extensions/chrome_app_icon.cc
index bd363e47..637c7e4 100644
--- a/chrome/browser/extensions/chrome_app_icon.cc
+++ b/chrome/browser/extensions/chrome_app_icon.cc
@@ -6,6 +6,7 @@
 
 #include <algorithm>
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/chrome_app_icon_delegate.h"
 #include "chrome/browser/extensions/extension_util.h"
 #include "extensions/browser/extension_registry.h"
@@ -15,7 +16,7 @@
 #include "ui/gfx/image/canvas_image_source.h"
 #include "ui/gfx/image/image_skia_operations.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/extensions/gfx_utils.h"
 #endif
 
@@ -79,7 +80,7 @@
         gfx::ImageSkiaOperations::CreateHSLShiftedImage(*image_skia, shift);
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Badge should be added after graying out the icon to have a crisp look.
   if (badge_type != Badge::kNone)
     util::ApplyBadge(image_skia, badge_type);
@@ -144,7 +145,7 @@
 
   Badge badge_type = Badge::kNone;
   bool app_launchable = util::IsAppLaunchable(app_id_, browser_context_);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   has_chrome_badge_ = util::ShouldApplyChromeBadge(browser_context_, app_id_);
   if (!app_launchable) {
     badge_type = Badge::kBlocked;
diff --git a/chrome/browser/extensions/chrome_app_icon.h b/chrome/browser/extensions/chrome_app_icon.h
index ce5dc9b..bf05b63 100644
--- a/chrome/browser/extensions/chrome_app_icon.h
+++ b/chrome/browser/extensions/chrome_app_icon.h
@@ -10,6 +10,7 @@
 
 #include "base/callback.h"
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/browser/extension_icon_image.h"
 #include "ui/gfx/image/image_skia.h"
 
@@ -74,7 +75,7 @@
 
   const gfx::ImageSkia& image_skia() const { return image_skia_; }
   const std::string& app_id() const { return app_id_; }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Returns whether the icon is badged because it's an extension app that has
   // its Android analog installed.
   bool has_chrome_badge() const { return has_chrome_badge_; }
@@ -99,7 +100,7 @@
   // it is updated each time when |icon_| is updated.
   gfx::ImageSkia image_skia_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Whether the icon got badged because it's an extension app that has its
   // Android analog installed.
   bool has_chrome_badge_ = false;
diff --git a/chrome/browser/extensions/chrome_app_icon_service.cc b/chrome/browser/extensions/chrome_app_icon_service.cc
index a718a39..8499028b 100644
--- a/chrome/browser/extensions/chrome_app_icon_service.cc
+++ b/chrome/browser/extensions/chrome_app_icon_service.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "base/threading/thread_task_runner_handle.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/chrome_app_icon.h"
 #include "chrome/browser/extensions/chrome_app_icon_service_factory.h"
 
@@ -20,7 +21,7 @@
 
 ChromeAppIconService::ChromeAppIconService(content::BrowserContext* context)
     : context_(context) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   app_updater_ = std::make_unique<LauncherExtensionAppUpdater>(
       this, context, false /* extensions_only */);
 #endif
@@ -31,7 +32,7 @@
 ChromeAppIconService::~ChromeAppIconService() = default;
 
 void ChromeAppIconService::Shutdown() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   app_updater_.reset();
 #endif
 }
@@ -71,7 +72,7 @@
   OnAppUpdated(extension->id());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void ChromeAppIconService::OnAppUpdated(
     content::BrowserContext* browser_context,
     const std::string& app_id) {
diff --git a/chrome/browser/extensions/chrome_app_icon_service.h b/chrome/browser/extensions/chrome_app_icon_service.h
index 841f6ae..698caeb 100644
--- a/chrome/browser/extensions/chrome_app_icon_service.h
+++ b/chrome/browser/extensions/chrome_app_icon_service.h
@@ -13,11 +13,12 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/scoped_observer.h"
+#include "build/chromeos_buildflags.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "extensions/browser/extension_registry.h"
 #include "extensions/browser/extension_registry_observer.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h"
 #endif
 
@@ -41,7 +42,7 @@
 // is bound to content::BrowserContext.
 // Usage: ChromeAppIconService::Get(context)->CreateIcon().
 class ChromeAppIconService : public KeyedService,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
                              public LauncherAppUpdater::Delegate,
 #endif
                              public ExtensionRegistryObserver {
@@ -95,7 +96,7 @@
                            const Extension* extension,
                            UnloadedExtensionReason reason) override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // LauncherAppUpdater::Delegate:
   void OnAppUpdated(content::BrowserContext* browser_context,
                     const std::string& app_id) override;
@@ -104,7 +105,7 @@
   // Unowned pointer.
   content::BrowserContext* context_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On Chrome OS this handles Chrome app life-cycle events that may change how
   // extension based app icon looks like.
   std::unique_ptr<LauncherExtensionAppUpdater> app_updater_;
diff --git a/chrome/browser/extensions/chrome_app_icon_unittest.cc b/chrome/browser/extensions/chrome_app_icon_unittest.cc
index 186a0bc..5adb450 100644
--- a/chrome/browser/extensions/chrome_app_icon_unittest.cc
+++ b/chrome/browser/extensions/chrome_app_icon_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/bind.h"
 #include "base/macros.h"
 #include "base/run_loop.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/chrome_app_icon.h"
 #include "chrome/browser/extensions/chrome_app_icon_delegate.h"
 #include "chrome/browser/extensions/chrome_app_icon_loader.h"
@@ -25,13 +26,13 @@
 #include "ui/gfx/image/image_skia_operations.h"
 #include "ui/gfx/image/image_unittest_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/arc/arc_util.h"
 #include "chrome/browser/chromeos/extensions/gfx_utils.h"
 #include "chrome/browser/ui/app_list/arc/arc_app_test.h"
 #include "components/arc/test/fake_app_instance.h"
 #include "ui/chromeos/resources/grit/ui_chromeos_resources.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -161,7 +162,7 @@
   return gfx::test::AreImagesEqual(gfx::Image(image1), gfx::Image(image2));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Returns true if |res| image is the |src| image with badge identified by
 // |badge_type| resource. If |grayscale| is true applies HSL shift for the
 // comparison.
@@ -235,7 +236,7 @@
   const size_t update_count_after_disable = reference_icon.icon_update_count();
   EXPECT_NE(2U, update_count_after_disable);
   EXPECT_FALSE(IsBlankImage(reference_icon.image_skia()));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_TRUE(IsBadgeApplied(image_before_disable, reference_icon.image_skia(),
                              ChromeAppIcon::Badge::kBlocked,
                              true /* grayscale */));
@@ -266,7 +267,7 @@
   test_icon2.Reset();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(ChromeAppIconTest, ChromeBadging) {
   ArcAppTest arc_test;
@@ -304,6 +305,6 @@
   EXPECT_TRUE(AreEqual(reference_icon.image_skia(), image_before_badging));
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/chrome_app_sorting.cc b/chrome/browser/extensions/chrome_app_sorting.cc
index 2bd3572..229e742 100644
--- a/chrome/browser/extensions/chrome_app_sorting.cc
+++ b/chrome/browser/extensions/chrome_app_sorting.cc
@@ -13,6 +13,7 @@
 #include "base/stl_util.h"
 #include "base/threading/sequenced_task_runner_handle.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/extension_sync_service.h"
 #include "chrome/browser/profiles/profile.h"
@@ -29,7 +30,7 @@
 #include "extensions/common/constants.h"
 #include "extensions/common/extension.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/extensions/default_app_order.h"
 #include "chrome/browser/ui/app_list/page_break_constants.h"
 #endif
@@ -693,7 +694,7 @@
   default_ordinals_created_ = true;
 
   // The following defines the default order of apps.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::vector<std::string> app_ids;
   chromeos::default_app_order::Get(&app_ids);
 #else
@@ -713,7 +714,7 @@
     default_ordinals_[extension_id].page_ordinal = page_ordinal;
     default_ordinals_[extension_id].app_launch_ordinal = app_launch_ordinal;
     app_launch_ordinal = app_launch_ordinal.CreateAfter();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Default page breaks are installed by default for first-time users so that
     // we can make default apps span multiple pages in the Launcher without
     // fully filling those pages. If |extension_id| is of a default page break,
@@ -721,7 +722,7 @@
     // ordinal.
     if (app_list::IsDefaultPageBreakItem(extension_id))
       page_ordinal = page_ordinal.CreateAfter();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   }
 }
 
diff --git a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
index bec6b14..0847188 100644
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
@@ -13,6 +13,7 @@
 #include "base/stl_util.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/grit/chrome_unscaled_resources.h"
 #include "chrome/grit/component_extension_resources_map.h"
@@ -22,7 +23,7 @@
 #include "pdf/buildflags.h"
 #include "ui/base/resource/resource_bundle.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/keyboard/ui/resources/keyboard_resource_util.h"
 #include "base/command_line.h"
 #include "chrome/browser/browser_process.h"
@@ -70,7 +71,7 @@
 
 ChromeComponentExtensionResourceManager::Data::Data() {
   static const GritResourceMap kExtraComponentExtensionResources[] = {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     {"web_store/webstore_icon_128.png", IDR_WEBSTORE_APP_ICON_128},
     {"web_store/webstore_icon_16.png", IDR_WEBSTORE_APP_ICON_16},
 #else
@@ -78,7 +79,7 @@
     {"web_store/webstore_icon_16.png", IDR_WEBSTORE_ICON_16},
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     {"chrome_app/chrome_app_icon_32.png", IDR_CHROME_APP_ICON_32},
     {"chrome_app/chrome_app_icon_192.png", IDR_CHROME_APP_ICON_192},
     {"pdf/ink/ink_lib_binary.js", IDR_INK_LIB_BINARY_JS},
@@ -92,7 +93,7 @@
                               kComponentExtensionResourcesSize);
   AddComponentResourceEntries(kExtraComponentExtensionResources,
                               base::size(kExtraComponentExtensionResources));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Add Files app JS modules resources.
   AddComponentResourceEntries(kFileManagerResources, kFileManagerResourcesSize);
   AddComponentResourceEntries(kFileManagerGenResources,
diff --git a/chrome/browser/extensions/chrome_component_extension_resource_manager_unittest.cc b/chrome/browser/extensions/chrome_component_extension_resource_manager_unittest.cc
index 4ec7f9f..62f973f 100644
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager_unittest.cc
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager_unittest.cc
@@ -6,6 +6,7 @@
 #include "base/path_service.h"
 #include "base/strings/string_util.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/grit/component_extension_resources.h"
 #include "chrome/grit/component_extension_resources_map.h"
@@ -21,7 +22,7 @@
 #include "extensions/common/manifest_handlers/icons_handler.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ui/file_manager/grit/file_manager_resources.h"
 #endif
 
@@ -70,7 +71,7 @@
                                  extension_misc::EXTENSION_ICON_BITTY,
                                  ExtensionIconSet::MATCH_EXACTLY);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // The resource is a component resource.
   int resource_id = 0;
   ASSERT_TRUE(resource_manager->IsComponentExtensionResource(
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
index 0729110..7f92f61b6 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
@@ -16,6 +16,7 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/stl_util.h"
 #include "base/strings/string_piece.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/component_loader.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -71,10 +72,10 @@
 #include "extensions/common/switches.h"
 #include "url/origin.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "extensions/browser/api/vpn_provider/vpn_service.h"
 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 using blink::web_pref::WebPreferences;
 using content::BrowserContext;
@@ -598,7 +599,7 @@
 std::unique_ptr<content::VpnServiceProxy>
 ChromeContentBrowserClientExtensionsPart::GetVpnServiceProxy(
     content::BrowserContext* browser_context) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::VpnService* vpn_service =
       chromeos::VpnServiceFactory::GetForBrowserContext(browser_context);
   if (!vpn_service)
diff --git a/chrome/browser/extensions/chrome_content_verifier_delegate.cc b/chrome/browser/extensions/chrome_content_verifier_delegate.cc
index 4bc6e51..f0f9b87 100644
--- a/chrome/browser/extensions/chrome_content_verifier_delegate.cc
+++ b/chrome/browser/extensions/chrome_content_verifier_delegate.cc
@@ -21,6 +21,7 @@
 #include "base/version.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/install_verifier.h"
 #include "chrome/browser/extensions/policy_extension_reinstaller.h"
@@ -39,7 +40,7 @@
 #include "net/base/backoff_entry.h"
 #include "net/base/escape.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
 #endif
 
@@ -309,7 +310,7 @@
                        management_policy->ShouldRepairIfCorrupted(&extension);
   bool is_from_webstore = IsFromWebstore(extension);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (ExtensionAssetsManagerChromeOS::IsSharedInstall(&extension)) {
     return VerifyInfo(VerifyInfo::Mode::ENFORCE_STRICT, is_from_webstore,
                       should_repair);
diff --git a/chrome/browser/extensions/chrome_extension_function_unittest.cc b/chrome/browser/extensions/chrome_extension_function_unittest.cc
index a6536f17..49ca931 100644
--- a/chrome/browser/extensions/chrome_extension_function_unittest.cc
+++ b/chrome/browser/extensions/chrome_extension_function_unittest.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service_test_base.h"
 #include "chrome/test/base/testing_browser_process.h"
 #include "extensions/browser/extension_function.h"
@@ -55,7 +56,7 @@
 
 using ChromeExtensionFunctionUnitTest = ExtensionServiceTestBase;
 
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
 #define MAYBE_SimpleFunctionTest DISABLED_SimpleFunctionTest
 #else
 #define MAYBE_SimpleFunctionTest SimpleFunctionTest
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc
index bca6ff57..14cecbc 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
@@ -12,6 +12,7 @@
 #include "base/strings/string_util.h"
 #include "base/version.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/app_mode/app_mode_utils.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_content_browser_client.h"
@@ -66,7 +67,7 @@
 #include "extensions/common/extension_urls.h"
 #include "extensions/common/features/feature_channel.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
 #include "chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h"
 #include "chrome/browser/extensions/updater/extension_cache_impl.h"
@@ -159,7 +160,7 @@
   return static_cast<Profile*>(context)->GetOriginalProfile();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 std::string ChromeExtensionsBrowserClient::GetUserIdHashFromContext(
     content::BrowserContext* context) {
   return chromeos::ProfileHelper::GetUserIdHashFromProfile(
@@ -291,7 +292,7 @@
 }
 
 bool ChromeExtensionsBrowserClient::IsInDemoMode() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const chromeos::DemoSession* const demo_session =
       chromeos::DemoSession::Get();
   return demo_session && demo_session->started();
@@ -302,7 +303,7 @@
 
 bool ChromeExtensionsBrowserClient::IsScreensaverInDemoMode(
     const std::string& app_id) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return app_id == chromeos::DemoSession::GetScreensaverAppId() &&
          IsInDemoMode();
 #endif
@@ -319,7 +320,7 @@
 }
 
 bool ChromeExtensionsBrowserClient::IsLoggedInAsPublicAccount() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return user_manager::UserManager::Get()->IsLoggedInAsPublicAccount();
 #else
   return false;
@@ -364,7 +365,7 @@
 
 ExtensionCache* ChromeExtensionsBrowserClient::GetExtensionCache() {
   if (!extension_cache_.get()) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // TODO(crbug.com/1012892): Replace this with just BEST_EFFORT, since the
     // sign-in profile extensions use a different caching mechanism now.
     base::TaskPriority task_priority =
@@ -502,7 +503,7 @@
 
 bool ChromeExtensionsBrowserClient::IsLockScreenContext(
     content::BrowserContext* context) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return chromeos::ProfileHelper::IsLockScreenAppProfile(
       Profile::FromBrowserContext(context));
 #else
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.h b/chrome/browser/extensions/chrome_extensions_browser_client.h
index d9f7ad9..9e0643a 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.h
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.h
@@ -14,6 +14,7 @@
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/media_router_extension_access_logger_impl.h"
 #include "chrome/browser/extensions/user_script_listener.h"
 #include "extensions/browser/extensions_browser_client.h"
@@ -58,7 +59,7 @@
       content::BrowserContext* context) override;
   content::BrowserContext* GetOriginalContext(
       content::BrowserContext* context) override;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::string GetUserIdHashFromContext(
       content::BrowserContext* context) override;
 #endif
diff --git a/chrome/browser/extensions/chrome_extensions_browser_interface_binders.cc b/chrome/browser/extensions/chrome_extensions_browser_interface_binders.cc
index 4d09c1f..b996e31 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_interface_binders.cc
+++ b/chrome/browser/extensions/chrome_extensions_browser_interface_binders.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "base/callback_helpers.h"
 #include "build/branding_buildflags.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/media/router/media_router_feature.h"       // nogncheck
 #include "chrome/browser/media/router/mojo/media_router_desktop.h"  // nogncheck
 #include "components/media_router/common/mojom/media_router.mojom.h"
@@ -17,7 +18,7 @@
 #include "extensions/common/permissions/api_permission.h"
 #include "extensions/common/permissions/permissions_data.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/remote_apps/remote_apps_impl.h"
 #include "chrome/browser/chromeos/remote_apps/remote_apps_manager.h"
 #include "chrome/browser/chromeos/remote_apps/remote_apps_manager_factory.h"
@@ -49,12 +50,12 @@
 #include "chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h"
 #include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_service_manager.mojom.h"
 #endif
-#endif  // definied(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
 namespace {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
 // Resolves InputEngineManager receiver in InputMethodManager.
@@ -97,7 +98,7 @@
   remote_apps_manager->BindInterface(std::move(pending_receiver));
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }  // namespace
 
 void PopulateChromeFrameBindersForExtension(
@@ -114,7 +115,7 @@
                             base::RetainedRef(extension), context));
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
   // Registry InputEngineManager for official Google XKB Input only.
@@ -179,7 +180,7 @@
     binder_map->Add<chromeos::remote_apps::mojom::RemoteAppsFactory>(
         base::BindRepeating(&BindRemoteAppsFactory));
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/chrome_process_manager_delegate.cc b/chrome/browser/extensions/chrome_process_manager_delegate.cc
index b832f6c..f63be00 100644
--- a/chrome/browser/extensions/chrome_process_manager_delegate.cc
+++ b/chrome/browser/extensions/chrome_process_manager_delegate.cc
@@ -7,6 +7,7 @@
 #include "base/check_op.h"
 #include "base/command_line.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/extension_management.h"
 #include "chrome/browser/profiles/profile.h"
@@ -21,7 +22,7 @@
 #include "extensions/common/extension.h"
 #include "extensions/common/permissions/permissions_data.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
 #include "chromeos/constants/chromeos_switches.h"
@@ -70,7 +71,7 @@
 bool ChromeProcessManagerDelegate::IsExtensionBackgroundPageAllowed(
     content::BrowserContext* context,
     const Extension& extension) const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Profile* profile = Profile::FromBrowserContext(context);
 
   const bool is_signin_profile =
diff --git a/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc b/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
index a2b10aec..34918b6 100644
--- a/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
+++ b/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
@@ -10,13 +10,14 @@
 #include "base/stl_util.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/buildflags.h"
 #include "chrome/common/extensions/extension_constants.h"
 #include "chrome/grit/browser_resources.h"
 #include "extensions/common/constants.h"
 #include "printing/buildflags/buildflags.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/keyboard/ui/grit/keyboard_resources.h"
 #include "chrome/browser/chromeos/input_method/component_extension_ime_manager_delegate_impl.h"
 #include "ui/file_manager/grit/file_manager_resources.h"
@@ -29,7 +30,7 @@
     extension_misc::kInAppPaymentsSupportAppId,
     extension_misc::kCastExtensionIdRelease,
     extension_misc::kPdfExtensionId,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     extension_misc::kAssessmentAssistantExtensionId,
     extension_misc::kAccessibilityCommonExtensionId,
     extension_misc::kChromeVoxExtensionId,
@@ -47,7 +48,7 @@
       return true;
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::ComponentExtensionIMEManagerDelegateImpl::IsIMEExtensionID(
           extension_id)) {
     return true;
@@ -74,7 +75,7 @@
     case IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST:
     case IDR_WEBSTORE_MANIFEST:
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Separate ChromeOS list, as it is quite large.
     case IDR_ARC_SUPPORT_MANIFEST:
     case IDR_AUDIO_PLAYER_MANIFEST:
@@ -94,7 +95,7 @@
     case IDR_HELP_MANIFEST:
     case IDR_QUICKOFFICE_MANIFEST:
 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
       return true;
   }
 
@@ -105,7 +106,7 @@
   return false;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool IsComponentExtensionAllowlistedForSignInProfile(
     const std::string& extension_id) {
   const char* const kAllowed[] = {
diff --git a/chrome/browser/extensions/component_extensions_allowlist/allowlist.h b/chrome/browser/extensions/component_extensions_allowlist/allowlist.h
index 0002936..a3c3e89 100644
--- a/chrome/browser/extensions/component_extensions_allowlist/allowlist.h
+++ b/chrome/browser/extensions/component_extensions_allowlist/allowlist.h
@@ -7,6 +7,8 @@
 
 #include <string>
 
+#include "build/chromeos_buildflags.h"
+
 namespace extensions {
 
 // =============================================================================
@@ -42,7 +44,7 @@
 // Checks using resource ID of manifest.
 bool IsComponentExtensionAllowlisted(int manifest_resource_id);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Checks using extension id for sign in profile.
 bool IsComponentExtensionAllowlistedForSignInProfile(
     const std::string& extension_id);
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 4575431..cdfc420 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -19,6 +19,7 @@
 #include "base/trace_event/trace_event.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
 #include "chrome/browser/extensions/data_deleter.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -49,7 +50,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/keyboard/ui/grit/keyboard_resources.h"
 #include "chromeos/constants/chromeos_features.h"
 #include "chromeos/constants/chromeos_switches.h"
@@ -88,7 +89,7 @@
   return id;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 std::unique_ptr<base::DictionaryValue> LoadManifestOnFileThread(
     const base::FilePath& root_directory,
     const base::FilePath::CharType* manifest_filename,
@@ -124,7 +125,7 @@
          user_manager::UserManager::IsInitialized() &&
          user_manager::UserManager::Get()->IsUserLoggedIn();
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -344,7 +345,7 @@
 }
 
 void ComponentLoader::AddWebStoreApp() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!IsNormalSession())
     return;
 #endif
@@ -355,7 +356,7 @@
       l10n_util::GetStringUTF8(IDS_WEBSTORE_APP_DESCRIPTION));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void ComponentLoader::AddChromeApp() {
   AddWithNameAndDescription(
       IDR_CHROME_APP_MANIFEST, base::FilePath(FILE_PATH_LITERAL("chrome_app")),
@@ -416,7 +417,7 @@
         l10n_util::GetStringUTF8(IDS_ZIP_ARCHIVER_DESCRIPTION));
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 scoped_refptr<const Extension> ComponentLoader::CreateExtension(
     const ComponentExtensionInfo& info,
@@ -437,7 +438,7 @@
     bool skip_session_components) {
   // Do not add component extensions that have background pages here -- add them
   // to AddDefaultComponentExtensionsWithBackgroundPages.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Add(IDR_MOBILE_MANIFEST,
       base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile")));
 
@@ -449,20 +450,20 @@
 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
 
   AddKeyboardApp();
-#else  // defined(OS_CHROMEOS)
+#else  // BUILDFLAG(IS_CHROMEOS_ASH)
   DCHECK(!skip_session_components);
 #if BUILDFLAG(ENABLE_PRINTING)
   // Cloud Print component app. Not required on Chrome OS.
   Add(IDR_CLOUDPRINT_MANIFEST,
       base::FilePath(FILE_PATH_LITERAL("cloud_print")));
 #endif  // BUILDFLAG(ENABLE_PRINTING)
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   if (!skip_session_components) {
     AddWebStoreApp();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     AddChromeApp();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 #if BUILDFLAG(ENABLE_PDF)
     Add(pdf_extension_util::GetManifest(),
         base::FilePath(FILE_PATH_LITERAL("pdf")));
@@ -481,13 +482,13 @@
   if (skip_session_components)
     return;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Component extensions needed for kiosk apps.
   AddFileManagerExtension();
 
   // Add virtual keyboard.
   AddKeyboardApp();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   AddDefaultComponentExtensionsWithBackgroundPagesForKioskMode();
 
@@ -528,7 +529,7 @@
           l10n_util::GetStringUTF8(IDS_FEEDBACK_REPORT_PAGE_TITLE));
     }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     AddChromeCameraApp();
     AddVideoPlayerExtension();
     AddAudioPlayerExtension();
@@ -569,11 +570,11 @@
 
     Add(IDR_ARC_SUPPORT_MANIFEST,
         base::FilePath(FILE_PATH_LITERAL("chromeos/arc_support")));
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   }
 
 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
-#if !defined(OS_CHROMEOS)  // http://crbug.com/314799
+#if !BUILDFLAG(IS_CHROMEOS_ASH)  // http://crbug.com/314799
   AddNetworkSpeechSynthesisExtension();
 #endif
 
@@ -609,7 +610,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void ComponentLoader::AddComponentFromDir(const base::FilePath& root_directory,
                                           const char* extension_id,
                                           const base::Closure& done_cb) {
diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h
index 64f0d79..d7eff4d5 100644
--- a/chrome/browser/extensions/component_loader.h
+++ b/chrome/browser/extensions/component_loader.h
@@ -20,6 +20,7 @@
 #include "base/optional.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/buildflags.h"
 
 class Profile;
@@ -91,7 +92,7 @@
   // Return ids of all registered extensions.
   std::vector<std::string> GetRegisteredComponentExtensionsIds() const;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Add a component extension from a specific directory. Assumes that the
   // extension uses a different manifest file when this is a guest session
   // and that the manifest file lives in |root_directory|. Calls |done_cb|
@@ -183,7 +184,7 @@
                                  const std::string& description_string);
   void AddWebStoreApp();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void AddChromeApp();
   void AddFileManagerExtension();
   void AddVideoPlayerExtension();
@@ -193,7 +194,7 @@
   void AddKeyboardApp();
   void AddChromeCameraApp();
   void AddZipArchiverExtension();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   scoped_refptr<const Extension> CreateExtension(
       const ComponentExtensionInfo& info, std::string* utf8_error);
@@ -201,7 +202,7 @@
   // Unloads |component| from the memory.
   void UnloadComponent(ComponentExtensionInfo* component);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Used as a reply callback by |AddComponentFromDir|.
   // Called with a |root_directory| and parsed |manifest| and invokes
   // |done_cb| after adding the extension.
diff --git a/chrome/browser/extensions/context_menu_matcher.cc b/chrome/browser/extensions/context_menu_matcher.cc
index 7ca86e9..4edd5980 100644
--- a/chrome/browser/extensions/context_menu_matcher.cc
+++ b/chrome/browser/extensions/context_menu_matcher.cc
@@ -8,6 +8,7 @@
 
 #include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/common/extensions/api/context_menus.h"
 #include "content/public/browser/browser_context.h"
@@ -77,7 +78,7 @@
 
   bool prepend_separator = false;
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // If this is the first extension-provided menu item, and there are other
   // items in the menu, and the last item is not a separator add a separator.
   // Also, don't add separators when Smart Text Selection is enabled. Smart
@@ -300,7 +301,7 @@
 
   bool enable_separators = false;
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   enable_separators = true;
 #endif
 
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 70b208e..831e87b 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -22,6 +22,7 @@
 #include "base/time/time.h"
 #include "base/version.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/blocklist_check.h"
 #include "chrome/browser/extensions/convert_user_script.h"
 #include "chrome/browser/extensions/convert_web_app.h"
@@ -71,7 +72,7 @@
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/l10n/l10n_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "components/user_manager/user_manager.h"
 #endif
 
@@ -757,7 +758,7 @@
 
   if (KioskModeInfo::IsKioskOnly(extension())) {
     bool in_kiosk_mode = false;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     user_manager::UserManager* user_manager = user_manager::UserManager::Get();
     in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp();
 #endif
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc
index b72617b..242a7c2 100644
--- a/chrome/browser/extensions/crx_installer_browsertest.cc
+++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -21,6 +21,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/download/download_crx_util.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/extension_install_prompt.h"
@@ -67,7 +68,7 @@
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/l10n/l10n_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
 #include "chromeos/constants/chromeos_switches.h"
@@ -1032,7 +1033,7 @@
             *installation_failure.install_error_detail);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, KioskOnlyTest) {
   base::ScopedAllowBlockingForTesting allow_io;
   // kiosk_only is allowlisted from non-chromeos.
diff --git a/chrome/browser/extensions/default_apps_unittest.cc b/chrome/browser/extensions/default_apps_unittest.cc
index a3c073c..29e3b858 100644
--- a/chrome/browser/extensions/default_apps_unittest.cc
+++ b/chrome/browser/extensions/default_apps_unittest.cc
@@ -7,6 +7,7 @@
 #include <memory>
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/external_pref_loader.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/pref_names.h"
@@ -40,7 +41,7 @@
   content::BrowserTaskEnvironment task_environment_;
 };
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Chrome OS has different way of installing default apps.
 // Android does not currently support installing apps via Chrome.
 TEST_F(DefaultAppsTest, Install) {
diff --git a/chrome/browser/extensions/event_router_forwarder.cc b/chrome/browser/extensions/event_router_forwarder.cc
index 5537ffe..ba788f3a9 100644
--- a/chrome/browser/extensions/event_router_forwarder.cc
+++ b/chrome/browser/extensions/event_router_forwarder.cc
@@ -11,6 +11,7 @@
 #include "base/bind.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "content/public/browser/browser_task_traits.h"
@@ -128,7 +129,7 @@
     std::unique_ptr<base::ListValue> event_args,
     Profile* restrict_to_profile,
     const GURL& event_url) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Extension does not exist for chromeos login.  This needs to be
   // removed once we have an extension service for login screen.
   // crosbug.com/12856.
diff --git a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
index 896fe27..1a49b22 100644
--- a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
+++ b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
@@ -14,6 +14,7 @@
 #include "base/run_loop.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/test_extension_system.h"
 #include "chrome/common/chrome_paths.h"
@@ -32,7 +33,7 @@
 #include "ui/gfx/image/image_skia.h"
 #include "ui/gfx/skia_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -165,7 +166,7 @@
   std::unique_ptr<TestingProfile> profile_;
   ExtensionService* extension_service_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   chromeos::ScopedTestUserManager test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/extension_assets_manager.cc b/chrome/browser/extensions/extension_assets_manager.cc
index 7ce05220..31b5c75 100644
--- a/chrome/browser/extensions/extension_assets_manager.cc
+++ b/chrome/browser/extensions/extension_assets_manager.cc
@@ -7,10 +7,11 @@
 #include "base/macros.h"
 #include "base/memory/singleton.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/common/extension.h"
 #include "extensions/common/file_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
 #endif
 
@@ -56,12 +57,12 @@
 
 // static
 ExtensionAssetsManager* ExtensionAssetsManager::GetInstance() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return ExtensionAssetsManagerChromeOS::GetInstance();
 #else
   // If not Chrome OS, use trivial implementation that doesn't share anything.
   return ExtensionAssetsManagerImpl::GetInstance();
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index b56b41024..3e9c969 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -23,6 +23,7 @@
 #include "base/task/post_task.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/app_service/app_launch_params.h"
 #include "chrome/browser/apps/app_service/app_service_proxy.h"
 #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -76,7 +77,7 @@
 #include "extensions/common/switches.h"
 #include "extensions/common/value_builder.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_switches.h"
 #endif
 
@@ -164,7 +165,7 @@
 
 ExtensionBrowserTest::ExtensionBrowserTest()
     :
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       set_chromeos_user_(true),
 #endif
       // Default channel is STABLE but override with UNKNOWN so that unlaunched
@@ -253,7 +254,7 @@
         new ScopedInstallVerifierBypassForTest());
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (set_chromeos_user_) {
     // This makes sure that we create the Default profile first, with no
     // ExtensionService and then the real profile with one, as we do when
diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h
index c8ab4de..1db36c2 100644
--- a/chrome/browser/extensions/extension_browsertest.h
+++ b/chrome/browser/extensions/extension_browsertest.h
@@ -13,6 +13,7 @@
 #include "base/macros.h"
 #include "base/test/scoped_path_override.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/chrome_extension_test_notification_observer.h"
 #include "chrome/browser/extensions/install_verifier.h"
 #include "chrome/browser/extensions/updater/extension_updater.h"
@@ -352,7 +353,7 @@
   bool ExecuteScriptInBackgroundPageNoWait(const std::string& extension_id,
                                            const std::string& script);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // True if the command line should be tweaked as if ChromeOS user is
   // already logged in.
   bool set_chromeos_user_;
diff --git a/chrome/browser/extensions/extension_commands_global_registry_apitest.cc b/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
index 3346eb47..0b7c3b13 100644
--- a/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
+++ b/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/browser_extension_window_controller.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/ui/browser_window.h"
@@ -30,7 +31,7 @@
 // extension.
 //
 // Doesn't work in CrOS builds, http://crbug.com/619784
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #define MAYBE_GlobalCommand DISABLED_GlobalCommand
 #else
 #define MAYBE_GlobalCommand GlobalCommand
diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc
index 189def8..091201aa 100644
--- a/chrome/browser/extensions/extension_context_menu_browsertest.cc
+++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc
@@ -13,6 +13,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/browsertest_util.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/lazy_background_page_test_util.h"
@@ -721,27 +722,27 @@
   //  normal3
 
   int index = 0;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_EQ(7, menu.GetItemCount());
 #else
   ASSERT_EQ(11, menu.GetItemCount());
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ExpectLabelAndType("radio1", MenuModel::TYPE_RADIO, menu, index++);
   ExpectLabelAndType("radio2", MenuModel::TYPE_RADIO, menu, index++);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_EQ(MenuModel::TYPE_SEPARATOR, menu.GetTypeAt(index++));
 #endif  // !OS_CHROMEOS
   ExpectLabelAndType("normal1", MenuModel::TYPE_COMMAND, menu, index++);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_EQ(MenuModel::TYPE_SEPARATOR, menu.GetTypeAt(index++));
 #endif  // !OS_CHROMEOS
   ExpectLabelAndType("normal2", MenuModel::TYPE_COMMAND, menu, index++);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_EQ(MenuModel::TYPE_SEPARATOR, menu.GetTypeAt(index++));
 #endif  // !OS_CHROMEOS
   ExpectLabelAndType("radio3", MenuModel::TYPE_RADIO, menu, index++);
   ExpectLabelAndType("radio4", MenuModel::TYPE_RADIO, menu, index++);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_EQ(MenuModel::TYPE_SEPARATOR, menu.GetTypeAt(index++));
 #endif  // !OS_CHROMEOS
   ExpectLabelAndType("normal3", MenuModel::TYPE_COMMAND, menu, index++);
diff --git a/chrome/browser/extensions/extension_context_menu_model_unittest.cc b/chrome/browser/extensions/extension_context_menu_model_unittest.cc
index b7947657..62bcd969 100644
--- a/chrome/browser/extensions/extension_context_menu_model_unittest.cc
+++ b/chrome/browser/extensions/extension_context_menu_model_unittest.cc
@@ -14,6 +14,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/metrics/user_action_tester.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/extensions/chrome_extension_browser_constants.h"
 #include "chrome/browser/extensions/context_menu_matcher.h"
@@ -59,7 +60,7 @@
 #include "ui/display/test/test_screen.h"
 #include "ui/gfx/image/image.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
 #endif
 
@@ -405,7 +406,7 @@
       browser_->tab_strip_model()->DetachWebContentsAt(0);
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // The KioskAppManager, if initialized, needs to be cleaned up.
   // TODO(devlin): This should probably go somewhere more central, like
   // chromeos::ScopedCrosSettingsTestHelper.
diff --git a/chrome/browser/extensions/extension_garbage_collector_factory.cc b/chrome/browser/extensions/extension_garbage_collector_factory.cc
index 16823f1..71c7a6c 100644
--- a/chrome/browser/extensions/extension_garbage_collector_factory.cc
+++ b/chrome/browser/extensions/extension_garbage_collector_factory.cc
@@ -8,13 +8,14 @@
 
 #include "base/memory/singleton.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_garbage_collector.h"
 #include "chrome/browser/extensions/extension_system_factory.h"
 #include "chrome/browser/extensions/install_tracker_factory.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "extensions/browser/extensions_browser_client.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/extensions/extension_garbage_collector_chromeos.h"
 #endif
 
@@ -48,7 +49,7 @@
 std::unique_ptr<KeyedService>
 ExtensionGarbageCollectorFactory::BuildInstanceFor(
     content::BrowserContext* context) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return std::make_unique<ExtensionGarbageCollectorChromeOS>(context);
 #else
   return std::make_unique<ExtensionGarbageCollector>(context);
diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
index 710c5e7d..ca62808e 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
@@ -25,6 +25,7 @@
 #include "base/task/thread_pool.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/api/gcm/gcm_api.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -64,7 +65,7 @@
 #include "services/network/test/test_network_connection_tracker.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
@@ -260,7 +261,7 @@
         new content::InProcessUtilityThreadHelper);
 
     // This is needed to create extension service under CrOS.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset(new chromeos::ScopedTestUserManager());
     // Creating a DBus thread manager setter has the side effect of
     // creating a DBusThreadManager, which is needed for testing.
@@ -291,7 +292,7 @@
   }
 
   void TearDown() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     test_user_manager_.reset();
 #endif
 
@@ -413,7 +414,7 @@
   base::ScopedTempDir temp_dir_;
 
   // This is needed to create extension service under CrOS.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   std::unique_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/extension_icon_manager_unittest.cc b/chrome/browser/extensions/extension_icon_manager_unittest.cc
index 0c139ef..fad226d 100644
--- a/chrome/browser/extensions/extension_icon_manager_unittest.cc
+++ b/chrome/browser/extensions/extension_icon_manager_unittest.cc
@@ -15,6 +15,7 @@
 #include "base/test/scoped_command_line.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/test/base/testing_profile.h"
 #include "components/crx_file/id_util.h"
@@ -147,7 +148,7 @@
   EXPECT_TRUE(gfx::test::AreImagesEqual(first_icon, second_icon));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Tests loading an icon for a component extension.
 TEST_F(ExtensionIconManagerTest, LoadComponentExtensionResource) {
   std::unique_ptr<Profile> profile(new TestingProfile());
diff --git a/chrome/browser/extensions/extension_keybinding_apitest.cc b/chrome/browser/extensions/extension_keybinding_apitest.cc
index e740542..921a35e 100644
--- a/chrome/browser/extensions/extension_keybinding_apitest.cc
+++ b/chrome/browser/extensions/extension_keybinding_apitest.cc
@@ -8,6 +8,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/extensions/active_tab_permission_granter.h"
 #include "chrome/browser/extensions/api/commands/command_service.h"
@@ -277,7 +278,7 @@
         .id();
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void RunChromeOSConversionTest(const std::string& extension_path) {
     // Setup the environment.
     ASSERT_TRUE(embedded_test_server()->Start());
@@ -300,7 +301,7 @@
 
     ASSERT_TRUE(catcher.GetNextResult());
   }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 };
 
 class IncognitoCommandsApiTest : public CommandsApiTest,
@@ -935,7 +936,7 @@
 }
 
 //
-#if defined(OS_CHROMEOS) && !defined(NDEBUG)
+#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(NDEBUG)
 // TODO(dtseng): Test times out on Chrome OS debug. See http://crbug.com/412456.
 #define MAYBE_ContinuePropagation DISABLED_ContinuePropagation
 #else
@@ -973,7 +974,7 @@
 }
 
 // Test is only applicable on Chrome OS.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // http://crbug.com/410534
 #if defined(USE_OZONE)
 #define MAYBE_ChromeOSConversions DISABLED_ChromeOSConversions
@@ -983,7 +984,7 @@
 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_ChromeOSConversions) {
   RunChromeOSConversionTest("keybinding/chromeos_conversions");
 }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Make sure component extensions retain keybindings after removal then
 // re-adding.
diff --git a/chrome/browser/extensions/extension_keybinding_registry.cc b/chrome/browser/extensions/extension_keybinding_registry.cc
index 00a3968..befdbec 100644
--- a/chrome/browser/extensions/extension_keybinding_registry.cc
+++ b/chrome/browser/extensions/extension_keybinding_registry.cc
@@ -8,6 +8,7 @@
 #include <utility>
 
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/active_tab_permission_granter.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
 #include "chrome/browser/extensions/tab_helper.h"
@@ -20,7 +21,7 @@
 #include "extensions/common/extension_set.h"
 #include "extensions/common/manifest_constants.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/ui/ash/media_client_impl.h"
 #endif
 
@@ -101,7 +102,7 @@
 
       media_keys_listener_manager->EnableInternalMediaKeyHandling();
     } else {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       MediaClientImpl::Get()->DisableCustomMediaKeyHandler(browser_context_,
                                                            this);
 #endif
@@ -217,7 +218,7 @@
 
       media_keys_listener_manager->DisableInternalMediaKeyHandling();
     } else {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       MediaClientImpl::Get()->EnableCustomMediaKeyHandler(browser_context_,
                                                           this);
 #endif
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc
index 6368e26..fe75a425 100644
--- a/chrome/browser/extensions/extension_management.cc
+++ b/chrome/browser/extensions/extension_management.cc
@@ -17,6 +17,7 @@
 #include "base/syslog_logging.h"
 #include "base/trace_event/trace_event.h"
 #include "base/version.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_management_constants.h"
 #include "chrome/browser/extensions/extension_management_internal.h"
 #include "chrome/browser/extensions/external_policy_loader.h"
@@ -41,7 +42,7 @@
 #include "extensions/common/url_pattern.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #else
 #include "components/enterprise/browser/reporting/common_pref_names.h"
@@ -55,7 +56,7 @@
       is_child_(profile_->IsChild()) {
   TRACE_EVENT0("browser,startup",
                "ExtensionManagement::ExtensionManagement::ctor");
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   is_signin_profile_ = chromeos::ProfileHelper::IsSigninProfile(profile);
 #endif
   pref_change_registrar_.Init(pref_service_);
@@ -76,7 +77,7 @@
                              pref_change_callback);
   pref_change_registrar_.Add(prefs::kCloudExtensionRequestEnabled,
                              pref_change_callback);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   pref_change_registrar_.Add(enterprise_reporting::kCloudReportingEnabled,
                              pref_change_callback);
 #endif
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 37ba854..7b5e446 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -32,6 +32,7 @@
 #include "base/time/time.h"
 #include "base/trace_event/trace_event.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/api/content_settings/content_settings_custom_extension_provider.h"
@@ -106,7 +107,7 @@
 #include "extensions/common/permissions/permissions_data.h"
 #include "extensions/common/switches.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/system/sys_info.h"
 #include "chrome/browser/chromeos/extensions/install_limiter.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
@@ -479,7 +480,7 @@
   component_loader_->LoadAll();
   bool load_saved_extensions = true;
   bool load_command_line_extensions = extensions_enabled_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const bool is_signin_profile =
       chromeos::ProfileHelper::IsSigninProfile(profile_);
   const bool is_lock_screen_app_profile =
@@ -695,7 +696,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void ExtensionService::LoadSigninProfileTestExtension(const std::string& path) {
   base::SysInfo::CrashIfChromeOSNonTestImage();
   std::string extension_id;
@@ -1091,7 +1092,7 @@
   profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForExtension(
       extension.get());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Revoke external file access for the extension from its file system context.
   // It is safe to access the extension's storage partition at this point. The
   // storage partition may get destroyed only after the extension gets unloaded.
@@ -1273,9 +1274,9 @@
 void ExtensionService::OnAllExternalProvidersReady() {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   InstallLimiter::Get(profile_)->OnAllExternalProvidersReady();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Install any pending extensions.
   if (update_once_all_providers_are_ready_ && updater()) {
@@ -1888,7 +1889,7 @@
                         info.crx_location == Manifest::EXTERNAL_POLICY
                             ? GetPolicyVerifierFormat()
                             : GetExternalVerifierFormat());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   InstallLimiter::Get(profile_)->Add(installer, file_info);
 #else
   installer->InstallCrxFile(file_info);
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 6a5e4cfe1..9ec228bc 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -20,6 +20,7 @@
 #include "base/optional.h"
 #include "base/scoped_observer.h"
 #include "base/strings/string16.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/blocklist.h"
 #include "chrome/browser/extensions/extension_management.h"
 #include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h"
@@ -448,7 +449,7 @@
  private:
   // Loads extensions specified via a command line flag/switch.
   void LoadExtensionsFromCommandLineFlag(const char* switch_name);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void LoadSigninProfileTestExtension(const std::string& path);
 #endif
 
diff --git a/chrome/browser/extensions/extension_service_test_base.cc b/chrome/browser/extensions/extension_service_test_base.cc
index 9cbef72..2239de89 100644
--- a/chrome/browser/extensions/extension_service_test_base.cc
+++ b/chrome/browser/extensions/extension_service_test_base.cc
@@ -16,6 +16,7 @@
 #include "base/test/task_environment.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
 #include "chrome/browser/extensions/component_loader.h"
@@ -47,7 +48,7 @@
 #include "extensions/browser/extension_registry.h"
 #include "extensions/browser/pref_names.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/extensions/install_limiter.h"
 #endif
 
@@ -386,7 +387,7 @@
   service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
                                 service_->shared_module_service());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   InstallLimiter::Get(profile_.get())->DisableForTest();
 #endif
 }
diff --git a/chrome/browser/extensions/extension_service_test_base.h b/chrome/browser/extensions/extension_service_test_base.h
index b6399b2..8d6e839 100644
--- a/chrome/browser/extensions/extension_service_test_base.h
+++ b/chrome/browser/extensions/extension_service_test_base.h
@@ -15,6 +15,7 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/test/base/scoped_testing_local_state.h"
 #include "components/policy/core/common/mock_configuration_policy_provider.h"
 #include "components/policy/core/common/policy_service.h"
@@ -25,7 +26,7 @@
 #include "extensions/common/extension.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -201,7 +202,7 @@
   // The associated ExtensionRegistry, for convenience.
   extensions::ExtensionRegistry* registry_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   chromeos::ScopedTestUserManager test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index ee820a6..cc411df 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -40,6 +40,7 @@
 #include "base/values.h"
 #include "base/version.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/blocklist.h"
@@ -1919,7 +1920,7 @@
   EXPECT_FALSE(util::IsIncognitoEnabled(id, profile()));
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // This tests that the granted permissions preferences are correctly set for
 // default apps.
 TEST_F(ExtensionServiceTest, DefaultAppsGrantedPermissions) {
@@ -4693,7 +4694,7 @@
   }
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // This tests if default apps are installed correctly.
 TEST_F(ExtensionServiceTest, DefaultAppsInstall) {
   InitializeEmptyExtensionService();
diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc
index cc0fcfb6..1e226f9 100644
--- a/chrome/browser/extensions/extension_startup_browsertest.cc
+++ b/chrome/browser/extensions/extension_startup_browsertest.cc
@@ -15,6 +15,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -46,7 +47,7 @@
 #include "extensions/common/switches.h"
 #include "net/base/filename_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #endif
 
@@ -273,7 +274,7 @@
   TestInjection(true, true);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest,
                        SigninProfileCommandLineExtensionsDontLoad) {
@@ -283,7 +284,7 @@
                    chromeos::ProfileHelper::GetSigninProfile()));
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // ExtensionsLoadMultipleTest
 // Ensures that we can startup the browser with multiple extensions
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
index 8e433d5..42d571f 100644
--- a/chrome/browser/extensions/extension_system_impl.cc
+++ b/chrome/browser/extensions/extension_system_impl.cc
@@ -16,6 +16,7 @@
 #include "base/strings/string_tokenizer.h"
 #include "base/trace_event/trace_event.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/chrome_app_sorting.h"
 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
@@ -63,7 +64,7 @@
 #include "extensions/common/manifest_url_handlers.h"
 #include "ui/message_center/public/cpp/notifier_id.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/app_mode/app_mode_utils.h"
 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h"
 #include "chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h"
@@ -117,7 +118,7 @@
   rules_store_.reset(new StateStore(
       profile_, store_factory_, ValueStoreFrontend::BackendType::RULES, false));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // We can not perform check for Signin Profile here, as it would result in
   // recursive call upon creation of Signin Profile, so we will create
   // SigninScreenPolicyProvider lazily in RegisterManagementPolicyProviders.
@@ -140,7 +141,7 @@
       ExtensionManagementFactory::GetForBrowserContext(profile_)
           ->GetProviders());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Lazy creation of SigninScreenPolicyProvider.
   if (!signin_screen_policy_provider_) {
     if (chromeos::ProfileHelper::IsSigninProfile(profile_)) {
@@ -155,7 +156,7 @@
   }
   if (signin_screen_policy_provider_)
     management_policy_->RegisterProvider(signin_screen_policy_provider_.get());
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   management_policy_->RegisterProvider(InstallVerifier::Get(profile_));
 }
@@ -170,7 +171,7 @@
   extension_service_->RegisterInstallGate(
       ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
       extension_service_->shared_module_service());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chrome::IsRunningInForcedAppMode()) {
     kiosk_app_update_install_gate_.reset(
         new chromeos::KioskAppUpdateInstallGate(profile_));
@@ -205,12 +206,12 @@
 
   bool autoupdate_enabled = !profile_->IsGuestSession() &&
                             !profile_->IsSystemProfile();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!extensions_enabled ||
       chromeos::ProfileHelper::IsLockScreenAppProfile(profile_)) {
     autoupdate_enabled = false;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   extension_service_.reset(new ExtensionService(
       profile_, base::CommandLine::ForCurrentProcess(),
       profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName),
@@ -226,14 +227,14 @@
     InstallVerifier::Get(profile_)->Init();
     ChromeContentVerifierDelegate::VerifyInfo::Mode mode =
         ChromeContentVerifierDelegate::GetDefaultMode();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     mode = std::max(mode,
                     ChromeContentVerifierDelegate::VerifyInfo::Mode::BOOTSTRAP);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     if (mode >= ChromeContentVerifierDelegate::VerifyInfo::Mode::BOOTSTRAP)
       content_verifier_->Start();
     info_map()->SetContentVerifier(content_verifier_.get());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // This class is used to check the permissions of the force-installed
     // extensions inside the managed-guest session. It updates the local state
     // perf with the result, a boolean value deciding whether the full warning
@@ -256,7 +257,7 @@
   quota_service_.reset(new QuotaService);
 
   bool skip_session_extensions = false;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Skip loading session extensions if we are not in a user session or if the
   // profile is the sign-in or lock screen app profile, which don't correspond
   // to a user session.
diff --git a/chrome/browser/extensions/extension_system_impl.h b/chrome/browser/extensions/extension_system_impl.h
index a1637f73..8980e57 100644
--- a/chrome/browser/extensions/extension_system_impl.h
+++ b/chrome/browser/extensions/extension_system_impl.h
@@ -10,17 +10,18 @@
 #include "base/macros.h"
 #include "base/one_shot_event.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/browser/extension_system.h"
 #include "extensions/browser/unloaded_extension_reason.h"
 
 class Profile;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 namespace chromeos {
 class DeviceLocalAccountManagementPolicyProvider;
 class SigninScreenPolicyProvider;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -151,7 +152,7 @@
 
     std::unique_ptr<UninstallPingSender> uninstall_ping_sender_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     std::unique_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider>
         device_local_account_management_policy_provider_;
     std::unique_ptr<chromeos::SigninScreenPolicyProvider>
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc
index 8544c5c6..9d6f20ff 100644
--- a/chrome/browser/extensions/extension_tabs_apitest.cc
+++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
 #include "chrome/browser/prefs/incognito_mode_prefs.h"
 #include "chrome/browser/profiles/profile.h"
@@ -45,7 +46,7 @@
 };
 
 // Flaky on chromeos: http://crbug.com/870322
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #define MAYBE_Tabs DISABLED_Tabs
 #else
 #define MAYBE_Tabs Tabs
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
index c71493e..b068eab 100644
--- a/chrome/browser/extensions/extension_util.cc
+++ b/chrome/browser/extensions/extension_util.cc
@@ -12,6 +12,7 @@
 #include "base/metrics/field_trial.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/banners/app_banner_manager.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_sync_service.h"
@@ -44,7 +45,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/file_manager/app_id.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #endif
@@ -91,7 +92,7 @@
       ExtensionRegistry::Get(context)->enabled_extensions().GetByID(
           extension_id);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const bool is_policy_extension =
       extension && Manifest::IsPolicyLocation(extension->location());
   Profile* profile = Profile::FromBrowserContext(context);
@@ -122,7 +123,7 @@
       // by sync, for syncable component extensions.
       // See http://crbug.com/112290 and associated CLs for the sordid history.
       bool syncable = sync_helper::IsSyncableComponentExtension(extension);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       // For some users, the file manager app somehow ended up being synced even
       // though it's supposed to be unsyncable; see crbug.com/576964. If the bad
       // data ever gets cleaned up, this hack should be removed.
diff --git a/chrome/browser/extensions/extension_web_ui_unittest.cc b/chrome/browser/extensions/extension_web_ui_unittest.cc
index 127a7624..8914275 100644
--- a/chrome/browser/extensions/extension_web_ui_unittest.cc
+++ b/chrome/browser/extensions/extension_web_ui_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/command_line.h"
 #include "base/run_loop.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_web_ui_override_registrar.h"
 #include "chrome/browser/extensions/test_extension_system.h"
@@ -25,7 +26,7 @@
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/gfx/codec/png_codec.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -66,7 +67,7 @@
   ExtensionService* extension_service_;
   content::BrowserTaskEnvironment task_environment_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   chromeos::ScopedTestUserManager test_user_manager_;
 #endif
diff --git a/chrome/browser/extensions/external_component_loader.cc b/chrome/browser/extensions/external_component_loader.cc
index c8140cc..0192341 100644
--- a/chrome/browser/extensions/external_component_loader.cc
+++ b/chrome/browser/extensions/external_component_loader.cc
@@ -6,6 +6,7 @@
 
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
 #include "chrome/browser/media/router/media_router_feature.h"
@@ -16,7 +17,7 @@
 #include "extensions/common/feature_switch.h"
 #include "extensions/common/manifest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/policy/profile_policy_connector.h"
 #include "chromeos/constants/chromeos_switches.h"
 #endif
@@ -35,7 +36,7 @@
   AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId, prefs.get());
 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   {
     // Only load the Assessment Assistant if the current session is managed.
     if (profile_->GetProfilePolicyConnector()->IsManaged())
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index d579a81..64af83b6 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -20,6 +20,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/apps/user_type_filter.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/chrome_paths.h"
@@ -27,7 +28,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "extensions/browser/extension_file_task_runner.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/prefs/pref_service_syncable_util.h"
 #include "chrome/browser/sync/profile_sync_service_factory.h"
 #include "chromeos/constants/chromeos_features.h"
@@ -52,7 +53,7 @@
 // is a bit complicated.
 // TODO(crbug.com/1023268) This is a temporary measure and should be replaced.
 bool SkipInstallForChromeOSTablet(const base::FilePath& file_path) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!chromeos::switches::IsTabletFormFactor())
     return false;
 
@@ -112,7 +113,7 @@
 
 namespace extensions {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Helper class to wait for priority pref sync to be ready.
 class ExternalPrefLoader::PrioritySyncReadyWaiter
     : public sync_preferences::PrefServiceSyncableObserver,
@@ -238,7 +239,7 @@
 
   DISALLOW_COPY_AND_ASSIGN(PrioritySyncReadyWaiter);
 };
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 ExternalPrefLoader::ExternalPrefLoader(int base_path_id,
                                        int options,
@@ -262,7 +263,7 @@
 
 void ExternalPrefLoader::StartLoading() {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if ((options_ & DELAY_LOAD_UNTIL_PRIORITY_SYNC) &&
       (profile_ && ProfileSyncServiceFactory::IsSyncAllowed(profile_))) {
     pending_waiter_list_.push_back(
@@ -272,13 +273,13 @@
                                      this, waiter_ptr));
     return;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   GetExtensionFileTaskRunner()->PostTask(
       FROM_HERE, base::BindOnce(&ExternalPrefLoader::LoadOnFileThread, this));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void ExternalPrefLoader::OnPrioritySyncReady(
     ExternalPrefLoader::PrioritySyncReadyWaiter* waiter) {
   // Delete |waiter| from |pending_waiter_list_|.
@@ -291,7 +292,7 @@
   GetExtensionFileTaskRunner()->PostTask(
       FROM_HERE, base::BindOnce(&ExternalPrefLoader::LoadOnFileThread, this));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // static.
 std::unique_ptr<base::DictionaryValue>
diff --git a/chrome/browser/extensions/external_pref_loader.h b/chrome/browser/extensions/external_pref_loader.h
index 9e61837..17d5463 100644
--- a/chrome/browser/extensions/external_pref_loader.h
+++ b/chrome/browser/extensions/external_pref_loader.h
@@ -11,6 +11,7 @@
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/external_loader.h"
 
 class Profile;
@@ -31,7 +32,7 @@
     // owned by root and not writable by any non-root user.
     ENSURE_PATH_CONTROLLED_BY_ADMIN = 1 << 0,
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Delay external preference load. It delays default apps installation
     // to not overload the system on first time user login.
     DELAY_LOAD_UNTIL_PRIORITY_SYNC = 1 << 1,
@@ -69,7 +70,7 @@
   friend class ExternalTestingLoader;
   friend class TestExternalPrefLoader;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   class PrioritySyncReadyWaiter;
 #endif
 
@@ -106,7 +107,7 @@
   // Must be called from the File thread.
   void ReadStandaloneExtensionPrefFiles(base::DictionaryValue* prefs);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   void OnPrioritySyncReady(PrioritySyncReadyWaiter* waiter);
 #endif
 
@@ -125,7 +126,7 @@
   // Task runner for tasks that touch file.
   scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::vector<std::unique_ptr<PrioritySyncReadyWaiter>> pending_waiter_list_;
 #endif
 
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index d28017b7..5333e16 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -23,6 +23,7 @@
 #include "base/version.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/app_mode/app_mode_utils.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_process_platform_part.h"
@@ -50,7 +51,7 @@
 #include "extensions/common/manifest.h"
 #include "ui/base/l10n/l10n_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/path_service.h"
 #include "chrome/browser/chromeos/app_mode/kiosk_app_external_loader.h"
 #include "chrome/browser/chromeos/customization/customization_document.h"
@@ -78,7 +79,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Certain default extensions are no longer needed on ARC devices as they were
 // replaced by their ARC counterparts.
@@ -95,7 +96,7 @@
   return false;
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -226,7 +227,7 @@
     const std::string& extension_id = i.key();
     const base::DictionaryValue* extension = nullptr;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     if (ShouldUninstallExtensionReplacedByArcApp(extension_id)) {
       VLOG(1) << "Extension with key: " << extension_id << " was replaced "
               << "by a default ARC app, and will be uninstalled.";
@@ -236,7 +237,7 @@
           InstallStageTracker::FailureReason::REPLACED_BY_ARC_APP);
       continue;
     }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
     if (!crx_file::id_util::IdIsValid(extension_id)) {
       LOG(WARNING) << "Malformed extension dictionary: key "
@@ -599,7 +600,7 @@
   scoped_refptr<ExternalLoader> external_recommended_loader;
   extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::ProfileHelper::IsSigninProfile(profile)) {
     // Download extensions/apps installed by policy in the login profile.
     // Extensions (not apps) installed through this path will have type
@@ -665,7 +666,7 @@
 
   // Load the KioskAppExternalProvider when running in kiosk mode.
   if (chrome::IsRunningInForcedAppMode()) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Kiosk primary app external provider.
     // For enterprise managed kiosk apps, change the location to
     // "force-installed by policy".
@@ -729,7 +730,7 @@
 #if !defined(OS_WIN)
   int bundled_extension_creation_flags = Extension::NO_FLAGS;
 #endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   bundled_extension_creation_flags = Extension::FROM_WEBSTORE |
       Extension::WAS_INSTALLED_BY_DEFAULT;
 
@@ -776,7 +777,9 @@
   }
 #endif
   if (!profile->GetPrefs()->GetBoolean(pref_names::kBlockExternalExtensions)) {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
     provider_list->push_back(std::make_unique<ExternalProviderImpl>(
         service,
         base::MakeRefCounted<ExternalPrefLoader>(
@@ -818,7 +821,7 @@
   }
 
   if (!profile->IsLegacySupervised()) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
     // The default apps are installed as INTERNAL but use the external
     // extension installer codeflow.
     provider_list->push_back(std::make_unique<default_apps::Provider>(
diff --git a/chrome/browser/extensions/external_provider_impl_unittest.cc b/chrome/browser/extensions/external_provider_impl_unittest.cc
index cd7034d..9d68906 100644
--- a/chrome/browser/extensions/external_provider_impl_unittest.cc
+++ b/chrome/browser/extensions/external_provider_impl_unittest.cc
@@ -20,6 +20,7 @@
 #include "base/test/scoped_path_override.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_service_test_base.h"
@@ -42,7 +43,7 @@
 #include "net/test/embedded_test_server/http_response.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/customization/customization_document.h"
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chromeos/system/fake_statistics_provider.h"
@@ -97,7 +98,7 @@
   ~ExternalProviderImplTest() override {}
 
   void InitService() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     user_manager::ScopedUserManager scoped_user_manager(
         std::make_unique<chromeos::FakeChromeUserManager>());
 #endif
@@ -235,7 +236,7 @@
   std::unique_ptr<base::ScopedPathOverride> external_externsions_overrides_;
   std::unique_ptr<ExtensionCacheFake> test_extension_cache_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // chromeos::ServicesCustomizationExternalLoader is hooked up as an
   // extensions::ExternalLoader and depends on a functioning StatisticsProvider.
   chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_;
diff --git a/chrome/browser/extensions/forced_extensions/force_installed_metrics.cc b/chrome/browser/extensions/forced_extensions/force_installed_metrics.cc
index 9f25f8d..ec61213 100644
--- a/chrome/browser/extensions/forced_extensions/force_installed_metrics.cc
+++ b/chrome/browser/extensions/forced_extensions/force_installed_metrics.cc
@@ -9,6 +9,7 @@
 #include "base/bind.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
 #include "chrome/browser/profiles/profile.h"
 #include "components/prefs/pref_service.h"
@@ -18,9 +19,9 @@
 #include "extensions/browser/install/sandboxed_unpacker_failure_reason.h"
 #include "extensions/browser/updater/extension_downloader.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -45,7 +46,7 @@
 constexpr char kCrxFetchFailedFetchTries[] =
     "Extensions.ForceInstalledFetchTries";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Helper method to convert user_manager::UserType to
 // InstallStageTracker::UserType for histogram purposes.
 ForceInstalledMetrics::UserType ConvertUserType(
@@ -77,7 +78,7 @@
   }
   return ForceInstalledMetrics::UserType::kMaxValue;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Reports time taken for force installed extension during different
 // installation stages.
@@ -380,7 +381,7 @@
           "Extensions.OffStore_ForceInstalledFailureReason3", failure_reason);
     }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // Report type of user in case Force Installed Extensions fail to
     // install only if there is a user corresponding to given profile. There can
     // be extensions on the login screen. There is no user on the login screen
@@ -392,7 +393,7 @@
           "Extensions.ForceInstalledFailureSessionType",
           ConvertUserType(user_info));
     }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     VLOG(2) << "Forced extension " << extension_id
             << " failed to install with data="
             << InstallStageTracker::GetFormattedInstallationData(installation);
diff --git a/chrome/browser/extensions/forced_extensions/force_installed_metrics_unittest.cc b/chrome/browser/extensions/forced_extensions/force_installed_metrics_unittest.cc
index ac04155..373a41f5 100644
--- a/chrome/browser/extensions/forced_extensions/force_installed_metrics_unittest.cc
+++ b/chrome/browser/extensions/forced_extensions/force_installed_metrics_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/time/time.h"
 #include "base/timer/mock_timer.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/external_provider_impl.h"
 #include "chrome/browser/extensions/forced_extensions/force_installed_test_base.h"
 #include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h"
@@ -32,13 +33,13 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "components/arc/arc_prefs.h"
 #include "components/user_manager/scoped_user_manager.h"
 #include "components/user_manager/user_names.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace {
 
@@ -82,10 +83,10 @@
     "Extensions.ForceInstalledManifestFetchFailedFetchTries";
 constexpr char kSandboxUnpackFailureReason[] =
     "Extensions.ForceInstalledFailureSandboxUnpackFailureReason";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 constexpr char kFailureSessionStats[] =
     "Extensions.ForceInstalledFailureSessionType";
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 constexpr char kPossibleNonMisconfigurationFailures[] =
     "Extensions.ForceInstalledSessionsWithNonMisconfigurationFailureOccured";
 constexpr char kDisableReason[] =
@@ -795,7 +796,7 @@
       1);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ForceInstalledMetricsTest, ReportManagedGuestSessionOnExtensionFailure) {
   chromeos::FakeChromeUserManager* fake_user_manager =
       new chromeos::FakeChromeUserManager();
@@ -850,7 +851,7 @@
       kFailureSessionStats, ForceInstalledMetrics::UserType::USER_TYPE_GUEST,
       2);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(ForceInstalledMetricsTest, ExtensionsAreDownloading) {
   SetupForceList(true /*is_from_store */);
@@ -1079,7 +1080,7 @@
                                       1);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Session in which either all the extensions installed successfully, or all
 // failures are admin-side misconfigurations. This test verifies that failure
 // REPLACED_BY_ARC_APP is not considered as misconfiguration when ARC++ is
@@ -1122,7 +1123,7 @@
   histogram_tester_.ExpectBucketCount(kPossibleNonMisconfigurationFailures, 1,
                                       1);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Session in which either all the extensions installed successfully, or all
 // failures are admin-side misconfigurations. This test verifies that failure
diff --git a/chrome/browser/extensions/forced_extensions/force_installed_tracker.cc b/chrome/browser/extensions/forced_extensions/force_installed_tracker.cc
index 322f3bbe..204607b 100644
--- a/chrome/browser/extensions/forced_extensions/force_installed_tracker.cc
+++ b/chrome/browser/extensions/forced_extensions/force_installed_tracker.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_management_constants.h"
 #include "chrome/browser/extensions/external_provider_impl.h"
 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
@@ -17,9 +18,9 @@
 #include "extensions/browser/pref_names.h"
 #include "extensions/common/extension_urls.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "components/arc/arc_prefs.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -201,7 +202,7 @@
     }
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // REPLACED_BY_ARC_APP error is a misconfiguration if ARC++ is enabled for
   // the device.
   if (profile_->GetPrefs()->IsManagedPreference(arc::prefs::kArcEnabled) &&
@@ -210,7 +211,7 @@
           InstallStageTracker::FailureReason::REPLACED_BY_ARC_APP) {
     return true;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   if (installation_data.failure_reason ==
       InstallStageTracker::FailureReason::NOT_PERFORMING_NEW_INSTALL) {
diff --git a/chrome/browser/extensions/forced_extensions/install_stage_tracker.cc b/chrome/browser/extensions/forced_extensions/install_stage_tracker.cc
index 16f304a..2c544c3 100644
--- a/chrome/browser/extensions/forced_extensions/install_stage_tracker.cc
+++ b/chrome/browser/extensions/forced_extensions/install_stage_tracker.cc
@@ -5,14 +5,15 @@
 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
 
 #include "base/check_op.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker_factory.h"
 #include "chrome/browser/profiles/profile.h"
 #include "extensions/browser/install/sandboxed_unpacker_failure_reason.h"
 #include "net/base/net_errors.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace extensions {
 
@@ -34,12 +35,12 @@
 
 }  // namespace
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 InstallStageTracker::UserInfo::UserInfo(const UserInfo&) = default;
 InstallStageTracker::UserInfo::UserInfo(user_manager::UserType user_type,
                                         bool is_new_user)
     : user_type(user_type), is_new_user(is_new_user) {}
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // InstallStageTracker::InstallationData implementation.
 
@@ -125,7 +126,7 @@
   return InstallStageTrackerFactory::GetForBrowserContext(context);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 InstallStageTracker::UserInfo InstallStageTracker::GetUserInfo(
     Profile* profile) {
   const user_manager::User* user =
@@ -136,7 +137,7 @@
   UserInfo current_user(user->GetType(), is_new_user);
   return current_user;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 void InstallStageTracker::ReportInfoOnNoUpdatesFailure(
     const ExtensionId& id,
diff --git a/chrome/browser/extensions/forced_extensions/install_stage_tracker.h b/chrome/browser/extensions/forced_extensions/install_stage_tracker.h
index 0887686..ad027b6 100644
--- a/chrome/browser/extensions/forced_extensions/install_stage_tracker.h
+++ b/chrome/browser/extensions/forced_extensions/install_stage_tracker.h
@@ -12,6 +12,7 @@
 #include "base/observer_list_types.h"
 #include "base/optional.h"
 #include "base/strings/string16.h"
+#include "build/chromeos_buildflags.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "extensions/browser/install/crx_install_error.h"
 #include "extensions/browser/install_stage.h"
@@ -19,9 +20,9 @@
 #include "extensions/browser/updater/safe_manifest_parser.h"
 #include "extensions/common/extension_id.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "components/user_manager/user_manager.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 class Profile;
 
@@ -273,7 +274,7 @@
     kMaxValue = kBandwidthLimit,
   };
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Contains information about the current user.
   struct UserInfo {
     UserInfo(const UserInfo&);
@@ -282,7 +283,7 @@
     user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR;
     bool is_new_user = false;
   };
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Contains information about extension installation: failure reason, if any
   // reported, specific details in case of CRX install error, current
@@ -397,12 +398,12 @@
   // Convenience function to get the InstallStageTracker for a BrowserContext.
   static InstallStageTracker* Get(content::BrowserContext* context);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Returns user type of the user associated with the |profile| and whether the
   // user is new or not. This method should be used only if there is a user
   // associated with the profile.
   static UserInfo GetUserInfo(Profile* profile);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   void ReportInfoOnNoUpdatesFailure(const ExtensionId& id,
                                     const std::string& info);
diff --git a/chrome/browser/extensions/launch_util.cc b/chrome/browser/extensions/launch_util.cc
index 06ad059..45aa58e 100644
--- a/chrome/browser/extensions/launch_util.cc
+++ b/chrome/browser/extensions/launch_util.cc
@@ -8,6 +8,7 @@
 
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_sync_service.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/web_applications/extensions/bookmark_app_util.h"
@@ -92,7 +93,7 @@
       // If the pref is set to launch a window (or no pref is set, and
       // window opening is the default), make the container a window.
       result = LaunchContainer::kLaunchContainerWindow;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     } else if (prefs_launch_type == LAUNCH_TYPE_FULLSCREEN) {
       // LAUNCH_TYPE_FULLSCREEN launches in a maximized app window in ash.
       // For desktop chrome AURA on all platforms we should open the
diff --git a/chrome/browser/extensions/process_manager_browsertest.cc b/chrome/browser/extensions/process_manager_browsertest.cc
index ee42f67..b1cb044 100644
--- a/chrome/browser/extensions/process_manager_browsertest.cc
+++ b/chrome/browser/extensions/process_manager_browsertest.cc
@@ -18,6 +18,7 @@
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -56,7 +57,7 @@
 #include "net/dns/mock_host_resolver.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chromeos/constants/chromeos_switches.h"
 #endif
@@ -309,7 +310,7 @@
 class DefaultProfileExtensionBrowserTest : public ExtensionBrowserTest {
  protected:
   DefaultProfileExtensionBrowserTest() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     // We want signin profile on ChromeOS, not logged in user profile.
     set_chromeos_user_ = false;
 #endif
@@ -318,7 +319,7 @@
  private:
   void SetUpCommandLine(base::CommandLine* command_line) override {
     ExtensionBrowserTest::SetUpCommandLine(command_line);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     command_line->AppendSwitch(chromeos::switches::kLoginManager);
     command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests);
 #endif
@@ -338,7 +339,7 @@
   // the signin profile (profile()) is the off-the-record version.
   Profile* original = profile()->GetOriginalProfile();
   Profile* otr = original->GetPrimaryOTRProfile();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_EQ(profile(), otr);
   EXPECT_TRUE(chromeos::ProfileHelper::IsSigninProfile(original));
 #endif
diff --git a/chrome/browser/extensions/test_extension_environment.cc b/chrome/browser/extensions/test_extension_environment.cc
index f9c80e87..f9a57835 100644
--- a/chrome/browser/extensions/test_extension_environment.cc
+++ b/chrome/browser/extensions/test_extension_environment.cc
@@ -9,6 +9,7 @@
 #include "base/command_line.h"
 #include "base/json/json_writer.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/test_extension_system.h"
 #include "chrome/browser/sessions/session_tab_helper_factory.h"
@@ -22,7 +23,7 @@
 #include "extensions/common/value_builder.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/device_settings_service.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
@@ -71,7 +72,7 @@
 
 }  // namespace
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Extra environment state required for ChromeOS.
 class TestExtensionEnvironment::ChromeOSEnv {
  public:
@@ -83,7 +84,7 @@
 
   DISALLOW_COPY_AND_ASSIGN(ChromeOSEnv);
 };
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // static
 ExtensionService* TestExtensionEnvironment::CreateExtensionServiceForProfile(
@@ -99,7 +100,7 @@
           type == Type::kWithTaskEnvironment
               ? std::make_unique<content::BrowserTaskEnvironment>()
               : nullptr),
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       chromeos_env_(chromeos::DeviceSettingsService::IsInitialized()
                         ? nullptr
                         : std::make_unique<ChromeOSEnv>()),
diff --git a/chrome/browser/extensions/test_extension_environment.h b/chrome/browser/extensions/test_extension_environment.h
index 75d80488..1c4e8161 100644
--- a/chrome/browser/extensions/test_extension_environment.h
+++ b/chrome/browser/extensions/test_extension_environment.h
@@ -11,6 +11,7 @@
 #include "base/macros.h"
 #include "base/memory/scoped_refptr.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/common/extension.h"
 
 #if defined(OS_WIN)
@@ -101,7 +102,7 @@
   // |profile_| and destroyed after |profile_|.
   const std::unique_ptr<content::BrowserTaskEnvironment> task_environment_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   const std::unique_ptr<ChromeOSEnv> chromeos_env_;
 #endif
 
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc
index 7c0d10e9..17b00e6 100644
--- a/chrome/browser/extensions/test_extension_system.cc
+++ b/chrome/browser/extensions/test_extension_system.cc
@@ -8,6 +8,7 @@
 
 #include "base/command_line.h"
 #include "base/memory/ptr_util.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/blocklist.h"
 #include "chrome/browser/extensions/chrome_app_sorting.h"
 #include "chrome/browser/extensions/crx_installer.h"
@@ -32,7 +33,7 @@
 #include "extensions/browser/value_store/test_value_store_factory.h"
 #include "extensions/browser/value_store/testing_value_store.h"
 #include "services/data_decoder/data_decoder_service.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "components/user_manager/user_manager.h"
 #endif
 
@@ -50,7 +51,7 @@
       info_map_(new InfoMap()),
       quota_service_(new QuotaService()),
       app_sorting_(new ChromeAppSorting(profile_)) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!user_manager::UserManager::IsInitialized())
     test_user_manager_.reset(new chromeos::ScopedTestUserManager);
 #endif
diff --git a/chrome/browser/extensions/test_extension_system.h b/chrome/browser/extensions/test_extension_system.h
index 79c0839..02e4a83 100644
--- a/chrome/browser/extensions/test_extension_system.h
+++ b/chrome/browser/extensions/test_extension_system.h
@@ -8,10 +8,11 @@
 #include <memory>
 
 #include "base/one_shot_event.h"
+#include "build/chromeos_buildflags.h"
 #include "extensions/browser/extension_system.h"
 #include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #endif
 
@@ -111,7 +112,7 @@
   std::unique_ptr<data_decoder::test::InProcessDataDecoder>
       in_process_data_decoder_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::unique_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
 #endif
 };
diff --git a/chrome/browser/extensions/update_install_gate_unittest.cc b/chrome/browser/extensions/update_install_gate_unittest.cc
index 8091c4a..f191aab 100644
--- a/chrome/browser/extensions/update_install_gate_unittest.cc
+++ b/chrome/browser/extensions/update_install_gate_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/command_line.h"
 #include "base/memory/ptr_util.h"
 #include "base/run_loop.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/test_extension_system.h"
 #include "chrome/test/base/testing_browser_process.h"
@@ -27,7 +28,7 @@
 #include "extensions/common/value_builder.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #include "chrome/browser/chromeos/settings/device_settings_service.h"
@@ -114,7 +115,7 @@
     ASSERT_TRUE(profile_manager_->SetUp());
 
     const char kUserProfile[] = "profile1@example.com";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     const AccountId account_id(AccountId::FromUserEmail(kUserProfile));
     // Needed to allow ChromeProcessManagerDelegate to allow background pages.
     fake_user_manager_ = new chromeos::FakeChromeUserManager();
@@ -216,7 +217,7 @@
   ExtensionRegistry* registry_ = nullptr;
   EventRouter* event_router_ = nullptr;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Needed for creating ExtensionService.
   chromeos::FakeChromeUserManager* fake_user_manager_ = nullptr;
   std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_enabler_;
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index 95992b2..7c46c97c 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -33,6 +33,7 @@
 #include "base/version.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/crx_installer.h"
 #include "chrome/browser/extensions/extension_sync_data.h"
@@ -85,7 +86,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/third_party/mozilla/url_parse.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/files/scoped_temp_dir.h"
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
@@ -256,7 +257,7 @@
                     base::OnceClosure callback));
 };
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // TODO (crbug.com/1061475) : Move this to a utility file.
 std::string CreateUpdateManifest(const std::string& extension_id,
                                  const std::string& extension_version,
@@ -1655,7 +1656,7 @@
     EXPECT_TRUE(base::TouchFile(file, timestamp, timestamp));
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // This tests the condition when the entry for the crx file is already
   // present in the cache but the crx file is itself corrupted. In this case,
   // after detecting the corruption of the crx file, it's entry should be
@@ -2422,7 +2423,7 @@
 
   ScopedTestingLocalState testing_local_state_;
 
-#if defined OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   chromeos::ScopedTestUserManager test_user_manager_;
 #endif
@@ -2514,7 +2515,7 @@
   TestSingleExtensionDownloading(true, false, true);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ExtensionUpdaterTest, TestCacheCorruptionCrxDownload) {
   TestCacheCorruption();
 }
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index 2501d425..65ea831 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -14,6 +14,7 @@
 #include "base/path_service.h"
 #include "base/run_loop.h"
 #include "base/threading/thread.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/test_extension_system.h"
 #include "chrome/browser/extensions/unpacked_installer.h"
@@ -32,7 +33,7 @@
 #include "extensions/browser/extension_registry.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "components/user_manager/scoped_user_manager.h"
 #endif
@@ -80,7 +81,7 @@
             new TestingProfileManager(TestingBrowserProcess::GetGlobal())) {}
 
   void SetUp() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>(
         std::make_unique<chromeos::FakeChromeUserManager>());
 #endif
@@ -140,7 +141,7 @@
   ExtensionService* service_ = nullptr;
   bool was_navigation_resumed_ = false;
   std::unique_ptr<content::WebContents> web_contents_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_;
 #endif
 };
diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc
index b5c2205b..109eac85 100644
--- a/chrome/browser/extensions/window_open_apitest.cc
+++ b/chrome/browser/extensions/window_open_apitest.cc
@@ -8,6 +8,7 @@
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
@@ -39,7 +40,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/base/base_window.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/extensions/window_controller.h"
 #include "chrome/browser/extensions/window_controller_list.h"
@@ -360,7 +361,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace {
 
@@ -480,9 +481,9 @@
   // The current window is still locked-fullscreen.
   EXPECT_EQ(chromeos::WindowPinType::kTrustedPinned, GetCurrentWindowPinType());
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Loading an extension requiring the 'lockWindowFullscreenPrivate' permission
 // on non Chrome OS platforms should always fail since the API is available only
 // on Chrome OS.
diff --git a/chrome/browser/extensions/zipfile_installer_unittest.cc b/chrome/browser/extensions/zipfile_installer_unittest.cc
index deaf671..0a55795 100644
--- a/chrome/browser/extensions/zipfile_installer_unittest.cc
+++ b/chrome/browser/extensions/zipfile_installer_unittest.cc
@@ -16,6 +16,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/extensions/chrome_zipfile_installer.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/load_error_reporter.h"
@@ -34,7 +35,7 @@
 #include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #endif
@@ -167,7 +168,7 @@
       in_process_utility_thread_helper_;
   MockExtensionRegistryObserver observer_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
   // ChromeOS needs a user manager to instantiate an extension service.
   chromeos::ScopedTestUserManager test_user_manager_;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 09a951e..8f5d584 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -475,6 +475,11 @@
     "expiry_milestone": 91
   },
   {
+    "name": "change-password-affiliation",
+    "owners": [ "vsemeniuk", "vasilii"],
+    "expiry_milestone": 90
+  },
+  {
     "name": "check-offline-capability",
     "owners": [ "asamidoi", "//content/browser/service_worker/OWNERS" ],
     "expiry_milestone": 89
@@ -1076,7 +1081,7 @@
   {
     "name": "edit-passwords-in-settings",
     "owners": [ "fhorschig", "jdoerrie" ],
-    "expiry_milestone": 88
+    "expiry_milestone": 89
   },
   {
     "name": "elastic-overscroll-win",
@@ -3706,11 +3711,6 @@
     "expiry_milestone": 90
   },
   {
-    "name": "page-info-refactoring",
-    "owners": [ "ewannpv", "gambard", "bling-flags@google.com" ],
-    "expiry_milestone": 88
-  },
-  {
     "name": "page-info-version-2",
     "owners": [ "eokoyomon", "dullweber" ],
     "expiry_milestone": 88
@@ -4717,6 +4717,11 @@
     "expiry_milestone": 88
   },
   {
+    "name": "use-of-hash-affiliation-fetcher",
+    "owners": [ "vsemeniuk", "vasilii"],
+    "expiry_milestone": 90
+  },
+  {
     "name": "use-preferred-interval-for-video",
     "owners": [ "jiahe.zhang@intel.com", "khushalsagar" ],
     "expiry_milestone": 85
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index dfbc51c..60aafb6 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -312,6 +312,12 @@
     "eligibility requirements for showing app banners, such as having a "
     "manifest, are met.";
 
+const char kChangePasswordAffiliationInfoName[] =
+    "Using Affiliation Service for Change Password URLs";
+const char kChangePasswordAffiliationInfoDescription[] =
+    "In case site doesn't support /.well-known/change-password Chrome will try "
+    "to obtain it using Affiliation Service.";
+
 const char kCheckOfflineCapabilityName[] = "Check offline capability for PWAs";
 const char kCheckOfflineCapabilityDescription[] =
     "Use advanced offline capability check to decide whether the browser "
@@ -2376,6 +2382,12 @@
     "Use the provided list of origins as a First-Party Set, with the first "
     "valid origin as the owner of the set.";
 
+const char kUseOfHashAffiliationFetcherName[] =
+    "Use of Hash Affiliation Fetcher";
+const char kUseOfHashAffiliationFetcherDescription[] =
+    "All requests to the affiliation fetcher are made through the hash prefix "
+    "lookup. Enables use of Hash Affiliation Service for non-synced users.";
+
 const char kUsernameFirstFlowName[] = "Username first flow";
 const char kUsernameFirstFlowDescription[] =
     "Support of username saving and filling on username first flow i.e. login "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 8b96b21..26be5fc 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -192,6 +192,9 @@
 extern const char kBypassAppBannerEngagementChecksName[];
 extern const char kBypassAppBannerEngagementChecksDescription[];
 
+extern const char kChangePasswordAffiliationInfoName[];
+extern const char kChangePasswordAffiliationInfoDescription[];
+
 extern const char kCheckOfflineCapabilityName[];
 extern const char kCheckOfflineCapabilityDescription[];
 
@@ -838,6 +841,9 @@
 extern const char kMouseSubframeNoImplicitCaptureName[];
 extern const char kMouseSubframeNoImplicitCaptureDescription[];
 
+extern const char kUseOfHashAffiliationFetcherName[];
+extern const char kUseOfHashAffiliationFetcherDescription[];
+
 extern const char kUsernameFirstFlowName[];
 extern const char kUsernameFirstFlowDescription[];
 
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
index c1d6933..ac90b99 100644
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -106,6 +106,7 @@
     &feature_engagement::kIPHTabSwitcherButtonFeature,
     &feed::kInterestFeedContentSuggestions,
     &feed::kInterestFeedNoticeCardAutoDismiss,
+    &feed::kInterestFeedSpinnerAlwaysAnimate,
     &feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
     &feed::kInterestFeedV2,
     &feed::kReportFeedUserActions,
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
index 38193b67..5f2907a 100644
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -322,6 +322,8 @@
     public static final String INTEREST_FEED_CONTENT_SUGGESTIONS = "InterestFeedContentSuggestions";
     public static final String INTEREST_FEED_NOTICE_CARD_AUTO_DISMISS =
             "InterestFeedNoticeCardAutoDismiss";
+    public static final String INTEREST_FEED_SPINNER_ALWAYS_ANIMATE =
+            "InterestFeedSpinnerAlwaysAnimate";
     public static final String INTEREST_FEED_V2 = "InterestFeedV2";
     public static final String KITKAT_SUPPORTED = "KitKatSupported";
     public static final String LOOKALIKE_NAVIGATION_URL_SUGGESTIONS_UI =
diff --git a/chrome/browser/lacros/account_manager_facade_factory_lacros.cc b/chrome/browser/lacros/account_manager_facade_factory_lacros.cc
index 094948e..3b85004 100644
--- a/chrome/browser/lacros/account_manager_facade_factory_lacros.cc
+++ b/chrome/browser/lacros/account_manager_facade_factory_lacros.cc
@@ -6,11 +6,25 @@
 
 #include "base/no_destructor.h"
 #include "chrome/browser/lacros/account_manager_facade_lacros.h"
+#include "chromeos/lacros/lacros_chrome_service_impl.h"
 #include "components/account_manager_core/account_manager_facade.h"
+#include "mojo/public/cpp/bindings/remote.h"
 
 account_manager::AccountManagerFacade* GetAccountManagerFacade(
     const std::string& profile_path) {
   // Multi-Login is disabled with Lacros. Always return the same instance.
-  static base::NoDestructor<AccountManagerFacadeLacros> facade;
+  static base::NoDestructor<AccountManagerFacadeLacros> facade([] {
+    auto* lacros_chrome_service_impl = chromeos::LacrosChromeServiceImpl::Get();
+    DCHECK(lacros_chrome_service_impl);
+    if (!lacros_chrome_service_impl->IsAccountManagerAvailable()) {
+      LOG(WARNING) << "Connected to an older version of ash. Account "
+                      "consistency will not be available";
+      return mojo::Remote<crosapi::mojom::AccountManager>();
+    }
+    mojo::Remote<crosapi::mojom::AccountManager> remote;
+    lacros_chrome_service_impl->BindAccountManagerReceiver(
+        remote.BindNewPipeAndPassReceiver());
+    return remote;
+  }());
   return facade.get();
 }
diff --git a/chrome/browser/lacros/account_manager_facade_lacros.cc b/chrome/browser/lacros/account_manager_facade_lacros.cc
index 5cdc5d3..c3b2080d 100644
--- a/chrome/browser/lacros/account_manager_facade_lacros.cc
+++ b/chrome/browser/lacros/account_manager_facade_lacros.cc
@@ -8,7 +8,6 @@
 #include <utility>
 
 #include "base/bind.h"
-#include "chromeos/lacros/lacros_chrome_service_impl.h"
 
 namespace {
 
@@ -18,14 +17,14 @@
 
 }  // namespace
 
-AccountManagerFacadeLacros::AccountManagerFacadeLacros()
-    : lacros_chrome_service_impl_(chromeos::LacrosChromeServiceImpl::Get()) {
-  if (!lacros_chrome_service_impl_->IsAccountManagerAvailable())
+AccountManagerFacadeLacros::AccountManagerFacadeLacros(
+    mojo::Remote<crosapi::mojom::AccountManager> account_manager_remote)
+    : account_manager_remote_(std::move(account_manager_remote)) {
+  if (!account_manager_remote_)
     return;
 
-  lacros_chrome_service_impl_->account_manager_remote().QueryVersion(
-      base::BindOnce(&AccountManagerFacadeLacros::OnVersionCheck,
-                     weak_factory_.GetWeakPtr()));
+  account_manager_remote_.QueryVersion(base::BindOnce(
+      &AccountManagerFacadeLacros::OnVersionCheck, weak_factory_.GetWeakPtr()));
 }
 
 AccountManagerFacadeLacros::~AccountManagerFacadeLacros() = default;
@@ -38,7 +37,7 @@
   if (version < kMinVersionWithObserver)
     return;
 
-  lacros_chrome_service_impl_->account_manager_remote()->AddObserver(
+  account_manager_remote_->AddObserver(
       base::BindOnce(&AccountManagerFacadeLacros::OnReceiverReceived,
                      weak_factory_.GetWeakPtr()));
 }
@@ -50,9 +49,8 @@
           this, std::move(receiver));
   // At this point (|receiver_| exists), we are subscribed to Account Manager.
 
-  lacros_chrome_service_impl_->account_manager_remote()->IsInitialized(
-      base::BindOnce(&AccountManagerFacadeLacros::OnInitialized,
-                     weak_factory_.GetWeakPtr()));
+  account_manager_remote_->IsInitialized(base::BindOnce(
+      &AccountManagerFacadeLacros::OnInitialized, weak_factory_.GetWeakPtr()));
 }
 void AccountManagerFacadeLacros::OnInitialized(bool is_initialized) {
   if (is_initialized)
diff --git a/chrome/browser/lacros/account_manager_facade_lacros.h b/chrome/browser/lacros/account_manager_facade_lacros.h
index 0a06e4b..56c1b03 100644
--- a/chrome/browser/lacros/account_manager_facade_lacros.h
+++ b/chrome/browser/lacros/account_manager_facade_lacros.h
@@ -11,10 +11,7 @@
 #include "chromeos/crosapi/mojom/account_manager.mojom.h"
 #include "components/account_manager_core/account_manager_facade.h"
 #include "mojo/public/cpp/bindings/receiver.h"
-
-namespace chromeos {
-class LacrosChromeServiceImpl;
-}  // namespace chromeos
+#include "mojo/public/cpp/bindings/remote.h"
 
 // Lacros specific implementation of |AccountManagerFacade| that talks to
 // |chromeos::AccountManager|, residing in ash-chrome, over Mojo.
@@ -22,7 +19,8 @@
     : public account_manager::AccountManagerFacade,
       public crosapi::mojom::AccountManagerObserver {
  public:
-  AccountManagerFacadeLacros();
+  explicit AccountManagerFacadeLacros(
+      mojo::Remote<crosapi::mojom::AccountManager> account_manager_remote);
   AccountManagerFacadeLacros(const AccountManagerFacadeLacros&) = delete;
   AccountManagerFacadeLacros& operator=(const AccountManagerFacadeLacros&) =
       delete;
@@ -42,7 +40,7 @@
   void OnInitialized(bool is_initialized);
 
   bool is_initialized_ = false;
-  chromeos::LacrosChromeServiceImpl* const lacros_chrome_service_impl_;
+  mojo::Remote<crosapi::mojom::AccountManager> account_manager_remote_;
   std::unique_ptr<mojo::Receiver<crosapi::mojom::AccountManagerObserver>>
       receiver_;
 
diff --git a/chrome/browser/local_discovery/local_domain_resolver_unittest.cc b/chrome/browser/local_discovery/local_domain_resolver_unittest.cc
index 605715d..27442c8 100644
--- a/chrome/browser/local_discovery/local_domain_resolver_unittest.cc
+++ b/chrome/browser/local_discovery/local_domain_resolver_unittest.cc
@@ -89,7 +89,7 @@
 
   void RunFor(base::TimeDelta time_period) {
     base::RunLoop run_loop;
-    base::CancelableCallback<void()> callback(run_loop.QuitWhenIdleClosure());
+    base::CancelableOnceClosure callback(run_loop.QuitWhenIdleClosure());
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, callback.callback(), time_period);
     run_loop.Run();
diff --git a/chrome/browser/local_discovery/service_discovery_client_unittest.cc b/chrome/browser/local_discovery/service_discovery_client_unittest.cc
index c0efd9c2..4a17b22 100644
--- a/chrome/browser/local_discovery/service_discovery_client_unittest.cc
+++ b/chrome/browser/local_discovery/service_discovery_client_unittest.cc
@@ -219,7 +219,7 @@
  protected:
   void RunFor(base::TimeDelta time_period) {
     base::RunLoop run_loop;
-    base::CancelableCallback<void()> callback(run_loop.QuitWhenIdleClosure());
+    base::CancelableOnceClosure callback(run_loop.QuitWhenIdleClosure());
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, callback.callback(), time_period);
     run_loop.Run();
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
index 04530ce..11b7408 100644
--- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -470,7 +470,7 @@
   if (!base::FeatureList::IsEnabled(
           features::kDesktopCaptureTabSharingInfobar) ||
       request.requested_video_device_id.empty()) {
-    picker = picker_factory_->CreatePicker();
+    picker = picker_factory_->CreatePicker(&request);
     if (!picker) {
       std::move(callback).Run(
           blink::MediaStreamDevices(),
diff --git a/chrome/browser/media/webrtc/desktop_media_picker.h b/chrome/browser/media/webrtc/desktop_media_picker.h
index 483952f1..4690836 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker.h
+++ b/chrome/browser/media/webrtc/desktop_media_picker.h
@@ -15,6 +15,7 @@
 #include "base/optional.h"
 #include "base/strings/string16.h"
 #include "content/public/browser/desktop_media_id.h"
+#include "content/public/browser/media_stream_request.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "ui/base/ui_base_types.h"
 #include "ui/gfx/native_widget_types.h"
@@ -25,8 +26,10 @@
 class WebContents;
 }
 
-// Abstract interface for desktop media picker UI. It's used by Desktop Media
-// API and by ARC to let user choose a desktop media source.
+// Base class for desktop media picker UI. It's used by Desktop Media API, and
+// by ARC to let user choose a desktop media source. It is also used by
+// getCurrentBrowsingContextMedia API to request user's permission to share the
+// current browser context.
 //
 // TODO(crbug.com/987001): Rename this class.
 class DesktopMediaPicker {
@@ -68,12 +71,14 @@
     bool select_only_screen = false;
   };
 
-  // Creates default implementation of DesktopMediaPicker for the current
-  // platform.
-  static std::unique_ptr<DesktopMediaPicker> Create();
+  // Creates a picker dialog/confirmation box depending on the value of
+  // |request|. If no request is available the default picker, namely
+  // DesktopMediaPickerViews is used.
+  static std::unique_ptr<DesktopMediaPicker> Create(
+      const content::MediaStreamRequest* request = nullptr);
 
-  DesktopMediaPicker() {}
-  virtual ~DesktopMediaPicker() {}
+  DesktopMediaPicker() = default;
+  virtual ~DesktopMediaPicker() = default;
 
   // Shows dialog with list of desktop media sources (screens, windows, tabs)
   // provided by |sources_lists|.
diff --git a/chrome/browser/media/webrtc/desktop_media_picker_controller.cc b/chrome/browser/media/webrtc/desktop_media_picker_controller.cc
index 239bf79..2fac9c0 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker_controller.cc
+++ b/chrome/browser/media/webrtc/desktop_media_picker_controller.cc
@@ -101,7 +101,7 @@
 }
 
 void DesktopMediaPickerController::ShowPickerDialog() {
-  picker_ = picker_factory_->CreatePicker();
+  picker_ = picker_factory_->CreatePicker(/*request=*/nullptr);
   if (!picker_) {
     OnPickerDialogResults(
         "Desktop Capture API is not yet implemented for this platform.", {});
diff --git a/chrome/browser/media/webrtc/desktop_media_picker_controller_unittest.cc b/chrome/browser/media/webrtc/desktop_media_picker_controller_unittest.cc
index 545d149..ffaf41b 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker_controller_unittest.cc
+++ b/chrome/browser/media/webrtc/desktop_media_picker_controller_unittest.cc
@@ -46,7 +46,9 @@
 
 class MockDesktopMediaPickerFactory : public DesktopMediaPickerFactory {
  public:
-  MOCK_METHOD0(CreatePicker, std::unique_ptr<DesktopMediaPicker>());
+  MOCK_METHOD1(CreatePicker,
+               std::unique_ptr<DesktopMediaPicker>(
+                   const content::MediaStreamRequest* request));
   MOCK_METHOD1(CreateMediaList,
                std::vector<std::unique_ptr<DesktopMediaList>>(
                    const std::vector<content::DesktopMediaID::Type>& types));
@@ -55,9 +57,10 @@
 class DesktopMediaPickerControllerTest : public testing::Test {
  public:
   void SetUp() override {
-    ON_CALL(factory_, CreatePicker).WillByDefault([this]() {
-      return std::unique_ptr<DesktopMediaPicker>(std::move(picker_));
-    });
+    ON_CALL(factory_, CreatePicker)
+        .WillByDefault([this](const content::MediaStreamRequest* request) {
+          return std::unique_ptr<DesktopMediaPicker>(std::move(picker_));
+        });
     ON_CALL(factory_, CreateMediaList).WillByDefault([this](const auto& types) {
       std::vector<std::unique_ptr<DesktopMediaList>> lists;
       lists.push_back(std::move(media_list_));
@@ -80,7 +83,7 @@
 
 // Test that the picker dialog is shown and the selected media ID is returned.
 TEST_F(DesktopMediaPickerControllerTest, ShowPicker) {
-  EXPECT_CALL(factory_, CreatePicker());
+  EXPECT_CALL(factory_, CreatePicker(nullptr));
   EXPECT_CALL(factory_, CreateMediaList(source_types_));
   EXPECT_CALL(done_, Run("", media_id_));
   EXPECT_CALL(*picker_, Show)
@@ -95,7 +98,7 @@
 
 // Test that a null result is returned in response to WebContentsDestroyed().
 TEST_F(DesktopMediaPickerControllerTest, WebContentsDestroyed) {
-  EXPECT_CALL(factory_, CreatePicker());
+  EXPECT_CALL(factory_, CreatePicker(nullptr));
   EXPECT_CALL(factory_, CreateMediaList(source_types_));
   EXPECT_CALL(done_, Run("", content::DesktopMediaID()));
   EXPECT_CALL(*picker_, Show);
@@ -113,7 +116,7 @@
   source.id = media_id_;
   source.name = base::ASCIIToUTF16("fake name");
 
-  EXPECT_CALL(factory_, CreatePicker()).Times(0);
+  EXPECT_CALL(factory_, CreatePicker(nullptr)).Times(0);
   EXPECT_CALL(factory_, CreateMediaList(source_types_));
   EXPECT_CALL(done_, Run("", source.id));
   EXPECT_CALL(*picker_, Show).Times(0);
diff --git a/chrome/browser/media/webrtc/desktop_media_picker_factory.h b/chrome/browser/media/webrtc/desktop_media_picker_factory.h
index 0e393e9..8da89c3 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker_factory.h
+++ b/chrome/browser/media/webrtc/desktop_media_picker_factory.h
@@ -12,6 +12,7 @@
 #include "chrome/browser/media/webrtc/desktop_media_list.h"
 #include "chrome/browser/media/webrtc/desktop_media_picker.h"
 #include "content/public/browser/desktop_media_id.h"
+#include "content/public/browser/media_stream_request.h"
 
 // Interface for factory creating DesktopMediaList and DesktopMediaPicker
 // instances.
@@ -19,7 +20,8 @@
  public:
   virtual ~DesktopMediaPickerFactory();
 
-  virtual std::unique_ptr<DesktopMediaPicker> CreatePicker() = 0;
+  virtual std::unique_ptr<DesktopMediaPicker> CreatePicker(
+      const content::MediaStreamRequest* request) = 0;
   virtual std::vector<std::unique_ptr<DesktopMediaList>> CreateMediaList(
       const std::vector<content::DesktopMediaID::Type>& types) = 0;
 
diff --git a/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.cc b/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.cc
index d55e7ace..7855ded 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.cc
+++ b/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.cc
@@ -22,12 +22,12 @@
   return impl.get();
 }
 
-std::unique_ptr<DesktopMediaPicker>
-DesktopMediaPickerFactoryImpl::CreatePicker() {
+std::unique_ptr<DesktopMediaPicker> DesktopMediaPickerFactoryImpl::CreatePicker(
+    const content::MediaStreamRequest* request) {
 // DesktopMediaPicker is implemented only for Windows, OSX and Aura Linux
 // builds.
-#if defined(TOOLKIT_VIEWS) || defined(OS_MAC)
-  return DesktopMediaPicker::Create();
+#if defined(TOOLKIT_VIEWS)
+  return DesktopMediaPicker::Create(request);
 #else
   return nullptr;
 #endif
diff --git a/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.h b/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.h
index 4888b59..c6015b6 100644
--- a/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.h
+++ b/chrome/browser/media/webrtc/desktop_media_picker_factory_impl.h
@@ -12,6 +12,7 @@
 #include "chrome/browser/media/webrtc/desktop_media_picker.h"
 #include "chrome/browser/media/webrtc/desktop_media_picker_factory.h"
 #include "content/public/browser/desktop_media_id.h"
+#include "content/public/browser/media_stream_request.h"
 
 // Factory creating DesktopMediaList and DesktopMediaPicker instances.
 class DesktopMediaPickerFactoryImpl : public DesktopMediaPickerFactory {
@@ -24,7 +25,8 @@
 
   // DesktopMediaPickerFactory implementation
   // Can return |nullptr| if platform doesn't support DesktopMediaPicker.
-  std::unique_ptr<DesktopMediaPicker> CreatePicker() override;
+  std::unique_ptr<DesktopMediaPicker> CreatePicker(
+      const content::MediaStreamRequest* request) override;
   std::vector<std::unique_ptr<DesktopMediaList>> CreateMediaList(
       const std::vector<content::DesktopMediaID::Type>& types) override;
 
diff --git a/chrome/browser/media/webrtc/display_media_access_handler.cc b/chrome/browser/media/webrtc/display_media_access_handler.cc
index 52b49928..10026f1e 100644
--- a/chrome/browser/media/webrtc/display_media_access_handler.cc
+++ b/chrome/browser/media/webrtc/display_media_access_handler.cc
@@ -138,17 +138,8 @@
   }
 #endif  // defined(OS_MAC)
 
-  if (request.video_type ==
-      blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB) {
-    // TODO(crbug.com/1136942): Add support for capture-this-tab instead of
-    // returning an error
-    std::move(callback).Run(
-        blink::MediaStreamDevices(),
-        blink::mojom::MediaStreamRequestResult::NOT_SUPPORTED, nullptr);
-    return;
-  }
-
-  std::unique_ptr<DesktopMediaPicker> picker = picker_factory_->CreatePicker();
+  std::unique_ptr<DesktopMediaPicker> picker =
+      picker_factory_->CreatePicker(&request);
   if (!picker) {
     std::move(callback).Run(
         blink::MediaStreamDevices(),
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.cc b/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.cc
index db8e997..cfc6d30 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.cc
+++ b/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.cc
@@ -84,8 +84,8 @@
   current_test_ = 0;
 }
 
-std::unique_ptr<DesktopMediaPicker>
-FakeDesktopMediaPickerFactory::CreatePicker() {
+std::unique_ptr<DesktopMediaPicker> FakeDesktopMediaPickerFactory::CreatePicker(
+    const content::MediaStreamRequest* request) {
   EXPECT_LE(current_test_, tests_count_);
   if (current_test_ >= tests_count_)
     return std::unique_ptr<DesktopMediaPicker>();
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h b/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h
index 76e8c1b..3b1074a 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h
+++ b/chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h
@@ -40,7 +40,8 @@
   void SetTestFlags(TestFlags* test_flags, int tests_count);
   FakeDesktopMediaPicker* picker() const { return picker_; }
   // DesktopMediaPickerFactory implementation
-  std::unique_ptr<DesktopMediaPicker> CreatePicker() override;
+  std::unique_ptr<DesktopMediaPicker> CreatePicker(
+      const content::MediaStreamRequest* request) override;
   std::vector<std::unique_ptr<DesktopMediaList>> CreateMediaList(
       const std::vector<content::DesktopMediaID::Type>& types) override;
 
diff --git a/chrome/browser/metrics/thread_watcher_unittest.cc b/chrome/browser/metrics/thread_watcher_unittest.cc
index cc35a550..84ffb5b3 100644
--- a/chrome/browser/metrics/thread_watcher_unittest.cc
+++ b/chrome/browser/metrics/thread_watcher_unittest.cc
@@ -184,10 +184,10 @@
             quit_closure.Run();
         },
         base::Unretained(this), quit_closure, expected_state);
-    base::CancelableClosure timeout_closure(base::BindRepeating(
-        [](base::RepeatingClosure quit_closure) {
+    base::CancelableOnceClosure timeout_closure(base::BindOnce(
+        [](base::OnceClosure quit_closure) {
           ADD_FAILURE() << "WaitForWaitStateChange timed out";
-          quit_closure.Run();
+          std::move(quit_closure).Run();
         },
         quit_closure));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
@@ -237,8 +237,8 @@
         },
         base::Unretained(this), quit_closure, expected_state,
         base::Unretained(&exit_state));
-    base::CancelableClosure timeout_closure(base::BindRepeating(
-        [](base::RepeatingClosure quit_closure) { quit_closure.Run(); },
+    base::CancelableOnceClosure timeout_closure(base::BindOnce(
+        [](base::OnceClosure quit_closure) { std::move(quit_closure).Run(); },
         quit_closure));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, timeout_closure.callback(),
@@ -270,8 +270,8 @@
         },
         base::Unretained(this), quit_closure, expected_state,
         base::Unretained(&exit_state));
-    base::CancelableClosure timeout_closure(base::BindRepeating(
-        [](base::RepeatingClosure quit_closure) { quit_closure.Run(); },
+    base::CancelableOnceClosure timeout_closure(base::BindOnce(
+        [](base::OnceClosure quit_closure) { std::move(quit_closure).Run(); },
         quit_closure));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, timeout_closure.callback(),
diff --git a/chrome/browser/permissions/permission_auditing_service_factory.cc b/chrome/browser/permissions/permission_auditing_service_factory.cc
new file mode 100644
index 0000000..d6ac166bf
--- /dev/null
+++ b/chrome/browser/permissions/permission_auditing_service_factory.cc
@@ -0,0 +1,61 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/permissions/permission_auditing_service_factory.h"
+
+#include "base/feature_list.h"
+#include "base/memory/singleton.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
+#include "chrome/browser/after_startup_task_utils.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_features.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/permissions/permission_auditing_service.h"
+
+PermissionAuditingServiceFactory::PermissionAuditingServiceFactory()
+    : BrowserContextKeyedServiceFactory(
+          "PermissionAuditingService",
+          BrowserContextDependencyManager::GetInstance()) {}
+
+PermissionAuditingServiceFactory::~PermissionAuditingServiceFactory() = default;
+
+// static
+PermissionAuditingServiceFactory*
+PermissionAuditingServiceFactory::GetInstance() {
+  return base::Singleton<PermissionAuditingServiceFactory>::get();
+}
+
+// static
+permissions::PermissionAuditingService*
+PermissionAuditingServiceFactory::GetForProfile(Profile* profile) {
+  return static_cast<permissions::PermissionAuditingService*>(
+      GetInstance()->GetServiceForBrowserContext(profile, /*create=*/true));
+}
+
+bool PermissionAuditingServiceFactory::ServiceIsCreatedWithBrowserContext()
+    const {
+  return true;
+}
+
+KeyedService* PermissionAuditingServiceFactory::BuildServiceInstanceFor(
+    content::BrowserContext* context) const {
+  if (!base::FeatureList::IsEnabled(features::kPermissionAuditing)) {
+    return nullptr;
+  }
+  auto backend_task_runner = base::ThreadPool::CreateSequencedTaskRunner(
+      {base::MayBlock(), base::TaskPriority::USER_VISIBLE,
+       base::TaskShutdownBehavior::BLOCK_SHUTDOWN});
+  auto* instance =
+      new permissions::PermissionAuditingService(backend_task_runner);
+  base::FilePath database_path =
+      context->GetPath().Append(FILE_PATH_LITERAL("Permission Auditing Logs"));
+  instance->Init(database_path);
+  AfterStartupTaskUtils::PostTask(
+      FROM_HERE, backend_task_runner,
+      base::BindOnce(&permissions::PermissionAuditingService::
+                         StartPeriodicCullingOfExpiredSessions,
+                     instance->AsWeakPtr()));
+  return instance;
+}
diff --git a/chrome/browser/permissions/permission_auditing_service_factory.h b/chrome/browser/permissions/permission_auditing_service_factory.h
new file mode 100644
index 0000000..3b5352c
--- /dev/null
+++ b/chrome/browser/permissions/permission_auditing_service_factory.h
@@ -0,0 +1,54 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_AUDITING_SERVICE_FACTORY_H_
+#define CHROME_BROWSER_PERMISSIONS_PERMISSION_AUDITING_SERVICE_FACTORY_H_
+
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+class Profile;
+
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+}
+
+namespace permissions {
+class PermissionAuditingService;
+}
+
+class PermissionAuditingServiceFactory
+    : public BrowserContextKeyedServiceFactory {
+ public:
+  static PermissionAuditingServiceFactory* GetInstance();
+
+  // Creates a permission auditing service for the given `profile`. Will return
+  // nullptr in case if |profile| is off-the-record or if `kPermissionAuditing`
+  // feature is disabled.
+  static permissions::PermissionAuditingService* GetForProfile(
+      Profile* profile);
+
+  PermissionAuditingServiceFactory(const PermissionAuditingServiceFactory&) =
+      delete;
+  PermissionAuditingServiceFactory& operator=(
+      const PermissionAuditingServiceFactory&) = delete;
+
+  PermissionAuditingServiceFactory(PermissionAuditingServiceFactory&&) = delete;
+  PermissionAuditingServiceFactory& operator=(
+      PermissionAuditingServiceFactory&&) = delete;
+
+ private:
+  friend struct base::DefaultSingletonTraits<PermissionAuditingServiceFactory>;
+
+  PermissionAuditingServiceFactory();
+  ~PermissionAuditingServiceFactory() override;
+
+  // BrowserContextKeyedServiceFactory:
+  bool ServiceIsCreatedWithBrowserContext() const override;
+
+  KeyedService* BuildServiceInstanceFor(
+      content::BrowserContext* context) const override;
+};
+
+#endif  // CHROME_BROWSER_PERMISSIONS_PERMISSION_AUDITING_SERVICE_FACTORY_H_
diff --git a/chrome/browser/permissions/permission_context_base_feature_policy_unittest.cc b/chrome/browser/permissions/permission_context_base_feature_policy_unittest.cc
index da7224c..04250574 100644
--- a/chrome/browser/permissions/permission_context_base_feature_policy_unittest.cc
+++ b/chrome/browser/permissions/permission_context_base_feature_policy_unittest.cc
@@ -17,6 +17,7 @@
 #include "content/public/browser/web_contents.h"
 #include "content/public/test/navigation_simulator.h"
 #include "content/public/test/test_renderer_host.h"
+#include "third_party/blink/public/common/feature_policy/feature_policy.h"
 #include "third_party/blink/public/mojom/feature_policy/feature_policy.mojom.h"
 #include "url/gurl.h"
 #include "url/origin.h"
@@ -80,13 +81,15 @@
                                      blink::mojom::FeaturePolicyFeature feature,
                                      const std::vector<std::string>& origins) {
     content::RenderFrameHost* current = *rfh;
-    SimulateNavigation(&current, current->GetLastCommittedURL());
+    auto navigation = content::NavigationSimulator::CreateRendererInitiated(
+        current->GetLastCommittedURL(), current);
     std::vector<url::Origin> parsed_origins;
     for (const std::string& origin : origins)
       parsed_origins.push_back(url::Origin::Create(GURL(origin)));
-    content::RenderFrameHostTester::For(current)->SimulateFeaturePolicyHeader(
-        feature, parsed_origins);
-    *rfh = current;
+    navigation->SetFeaturePolicyHeader(
+        {{feature, parsed_origins, false, false}});
+    navigation->Commit();
+    *rfh = navigation->GetFinalRenderFrameHost();
   }
 
   ContentSetting GetPermissionForFrame(permissions::PermissionContextBase* pcb,
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
index 2eed9fbc..494fb8d 100644
--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -53,6 +53,7 @@
 #include "chrome/browser/password_manager/password_store_factory.h"
 #include "chrome/browser/permissions/adaptive_quiet_notification_permission_ui_enabler.h"
 #include "chrome/browser/permissions/last_tab_standing_tracker_factory.h"
+#include "chrome/browser/permissions/permission_auditing_service_factory.h"
 #include "chrome/browser/persisted_state_db/persisted_state_db_factory.h"
 #include "chrome/browser/plugins/plugin_prefs_factory.h"
 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator_factory.h"
@@ -96,6 +97,7 @@
 #include "chrome/browser/unified_consent/unified_consent_service_factory.h"
 #include "chrome/browser/web_data_service_factory.h"
 #include "chrome/common/buildflags.h"
+#include "chrome/common/chrome_features.h"
 #include "components/captive_portal/core/buildflags.h"
 #include "components/permissions/features.h"
 #include "components/reading_list/features/reading_list_switches.h"
@@ -334,6 +336,7 @@
   NTPResourceCacheFactory::GetInstance();
 #endif
   PasswordStoreFactory::GetInstance();
+  PermissionAuditingServiceFactory::GetInstance();
   PersistedStateDBFactory::GetInstance();
 #if !defined(OS_ANDROID)
   PinnedTabServiceFactory::GetInstance();
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/accessibility_common/BUILD.gn
index e21da6b..7b01e0e 100644
--- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/BUILD.gn
+++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/BUILD.gn
@@ -61,6 +61,7 @@
   sources = [
     "accessibility_common_test.js",
     "autoclick/autoclick_test.js",
+    "magnifier/docked_magnifier_test.js",
     "magnifier/magnifier_test.js",
   ]
   gen_include_files = [
@@ -68,6 +69,7 @@
     "../common/testing/callback_helper.js",
     "../common/testing/e2e_test_base.js",
     "../common/testing/mock_accessibility_private.js",
+    "magnifier/magnifier_test_common.js",
   ]
 
   # The test base classes generate C++ code with these deps.
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/docked_magnifier_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/docked_magnifier_test.js
new file mode 100644
index 0000000..c9c7252
--- /dev/null
+++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/docked_magnifier_test.js
@@ -0,0 +1,93 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+GEN_INCLUDE(['../../common/testing/e2e_test_base.js']);
+GEN_INCLUDE(['../../common/testing/mock_accessibility_private.js']);
+GEN_INCLUDE(['../../common/rect_util.js']);
+GEN_INCLUDE(['magnifier_test_common.js']);
+
+/**
+ * Magnifier feature using accessibility common extension browser tests.
+ */
+DockedMagnifierE2ETest = class extends E2ETestBase {
+  constructor() {
+    super();
+    window.RoleType = chrome.automation.RoleType;
+
+    /**
+     * Registers a listener for
+     * chrome.accessibilityPrivate.onMagnifierBoundsChanged in the ctor. After
+     * that, the test code can perform the action, and then use
+     * waitForNextMagnifierBounds() to be wait for the previously-registered
+     * listener to be called.
+     *
+     * @private
+     */
+    this.nextMagnifierBoundsWaiter_ = class {
+      constructor() {
+        this.promise_ = new Promise(resolve => {
+          const listener = (magnifierBounds) => {
+            chrome.accessibilityPrivate.onMagnifierBoundsChanged.removeListener(
+                listener);
+            resolve(magnifierBounds);
+          };
+          chrome.accessibilityPrivate.onMagnifierBoundsChanged.addListener(
+              listener);
+        });
+      }
+
+      async waitForNextMagnifierBounds() {
+        return this.promise_;
+      }
+    };
+  }
+
+  /** @override */
+  testGenCppIncludes() {
+    super.testGenCppIncludes();
+    GEN(`
+#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
+#include "chrome/common/extensions/extension_constants.h"
+#include "content/public/test/browser_test.h"
+    `);
+  }
+
+  /** @override */
+  testGenPreamble() {
+    super.testGenPreamble();
+    GEN(`
+    base::Closure load_cb =
+        base::Bind(&chromeos::MagnificationManager::SetDockedMagnifierEnabled,
+            base::Unretained(chromeos::MagnificationManager::Get()),
+            true);
+    WaitForExtension(extension_misc::kAccessibilityCommonExtensionId, load_cb);
+      `);
+  }
+};
+
+TEST_F(
+    'DockedMagnifierE2ETest', 'MovesDockedMagnifierToActiveDescendant',
+    function() {
+      this.runWithLoadedTree(ActiveDescendantSite, async function(root) {
+        const top = root.find({attributes: {name: 'Top'}});
+        const banana = root.find({attributes: {name: 'Banana'}});
+        const group = root.find({role: RoleType.GROUP});
+
+        // Focus and move magnifier to top.
+        // Then verify magnifier contain top and not banana.
+        const boundsWaiter1 = new this.nextMagnifierBoundsWaiter_();
+        top.focus();
+        let bounds = await boundsWaiter1.waitForNextMagnifierBounds();
+        assertTrue(RectUtil.contains(bounds, top.location));
+        assertFalse(RectUtil.contains(bounds, banana.location));
+
+        // Click group to change active descendant to banana.
+        // Then verify magnifier bounds contain banana.
+        const boundsWaiter2 = new this.nextMagnifierBoundsWaiter_();
+        group.doDefault();
+        bounds = await boundsWaiter2.waitForNextMagnifierBounds();
+        assertFalse(RectUtil.contains(bounds, top.location));
+        assertTrue(RectUtil.contains(bounds, banana.location));
+      });
+    });
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test.js
index fe982a2..49542c7e 100644
--- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test.js
+++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test.js
@@ -5,6 +5,7 @@
 GEN_INCLUDE(['../../common/testing/e2e_test_base.js']);
 GEN_INCLUDE(['../../common/testing/mock_accessibility_private.js']);
 GEN_INCLUDE(['../../common/rect_util.js']);
+GEN_INCLUDE(['magnifier_test_common.js']);
 
 /**
  * Magnifier feature using accessibility common extension browser tests.
@@ -77,64 +78,9 @@
   });
 });
 
-// Disabled - flaky: https://crbug.com/1145612
-TEST_F(
-    'MagnifierE2ETest', 'DISABLED_MovesDockedMagnifierToActiveDescendant', function() {
-      const site = `
-    <div role="group" id="parent" aria-activedescendant="apple">
-      <div id="apple" role="treeitem">Apple</div>
-      <div id="banana" role="treeitem">Banana</div>
-    </div>
-    <script>
-      const parent = document.getElementById('parent');
-      parent.addEventListener('click', function() {
-        parent.setAttribute('aria-activedescendant', 'banana');
-      });
-      </script>
-  `;
-      this.runWithLoadedTree(site, async function(root) {
-        // Enable docked magnifier.
-        await new Promise(resolve => {
-          chrome.accessibilityFeatures.dockedMagnifier.set(
-              {value: true}, resolve);
-        });
-
-        // Validate magnifier wants to move to root.
-        const rootLocation = await getNextMagnifierLocation();
-        assertTrue(RectUtil.equal(rootLocation, root.location));
-
-        // Click parent to change active descendant from apple to banana.
-        const parent = root.find({role: RoleType.GROUP});
-        parent.doDefault();
-
-        // Register and wait for rect from magnifier.
-        const rect = await getNextMagnifierLocation();
-
-        // Validate rect from magnifier is rect of banana.
-        const bananaNode =
-            root.find({role: RoleType.TREE_ITEM, attributes: {name: 'Banana'}});
-        assertTrue(RectUtil.equal(rect, bananaNode.location));
-      }, {returnPage: true});
-    });
-
-
 TEST_F(
     'MagnifierE2ETest', 'MovesScreenMagnifierToActiveDescendant', function() {
-      const site = `
-    <span tabindex="1">Top</span>
-    <div id="group" role="group" style="width: 200px"
-        aria-activedescendant="apple">
-      <div id="apple" role="treeitem">Apple</div>
-      <div id="banana" role="treeitem" style="margin-top: 400px">Banana</div>
-    </div>
-    <script>
-      const group = document.getElementById('group');
-      group.addEventListener('click', function() {
-        group.setAttribute('aria-activedescendant', 'banana');
-      });
-    </script>
-  `;
-      this.runWithLoadedTree(site, async function(root) {
+      this.runWithLoadedTree(ActiveDescendantSite, async function(root) {
         const top = root.find({attributes: {name: 'Top'}});
         const banana = root.find({attributes: {name: 'Banana'}});
         const group = root.find({role: RoleType.GROUP});
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test_common.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test_common.js
new file mode 100644
index 0000000..14cca82
--- /dev/null
+++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/magnifier/magnifier_test_common.js
@@ -0,0 +1,20 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+const ActiveDescendantSite = `
+  <span tabindex="1">Top</span>
+  <div id="group" role="group" style="width: 200px"
+      aria-activedescendant="apple">
+    <div id="apple" role="treeitem">Apple</div>
+    <div id="banana" role="treeitem" style="margin-top: 400px">
+      Banana
+    </div>
+  </div>
+  <script>
+    const group = document.getElementById('group');
+    group.addEventListener('click', function() {
+      group.setAttribute('aria-activedescendant', 'banana');
+    });
+  </script>
+`;
diff --git a/chrome/browser/resources/chromeos/login/arc_terms_of_service.html b/chrome/browser/resources/chromeos/login/arc_terms_of_service.html
index 8ee988c..280494ca 100644
--- a/chrome/browser/resources/chromeos/login/arc_terms_of_service.html
+++ b/chrome/browser/resources/chromeos/login/arc_terms_of_service.html
@@ -13,6 +13,8 @@
 <link rel="import" href="/components/oobe_i18n_behavior.html">
 <link rel="import" href="/components/throbber_notice.html">
 
+<link rel="stylesheet" href="chrome://resources/css/overlay.css">
+
 <dom-module id="arc-tos-element">
   <template>
     <style include="oobe-dialog-host"></style>
@@ -29,9 +31,11 @@
       <div id="arcTosContainer" slot="footer" class="flex layout vertical">
         <div id="arcTosViewContainer" class="arc-tos-content flex">
           <webview id="arcTosView" allowTransparency
-              class="oobe-tos-webview"></webview>
+              class="oobe-tos-webview"
+              on-contentload="onTermsViewContentLoad_"></webview>
         </div>
-        <div id="arcPolicyLink" class="arc-tos-content">
+        <div id="arcPolicyLink" class="arc-tos-content"
+            on-click="onPolicyLinkClick_">
           <a class="oobe-local-link" is="action-link">
             [[i18nDynamic(locale, 'arcPolicyLink')]]
           </a>
@@ -183,7 +187,8 @@
     <oobe-help-dialog id="arcTosOverlayPrivacyPolicy"
         on-close="onOverlayClosed_">
       <div slot="content" id = "arcTosOverlayWebviewContainer">
-        <webview id="arcTosOverlayWebview" hidden="[[overlayLoading_]]">
+        <webview id="arcTosOverlayWebview" hidden="[[overlayLoading_]]"
+            on-contentload="onAcrTosOverlayContentLoad_">
         </webview>
         <throbber-notice class="flex layout center-justified vertical"
             hidden="[[!overlayLoading_]]" style="height: 100%;">
diff --git a/chrome/browser/resources/chromeos/login/arc_terms_of_service.js b/chrome/browser/resources/chromeos/login/arc_terms_of_service.js
index 626c0f6..5e8e4f80 100644
--- a/chrome/browser/resources/chromeos/login/arc_terms_of_service.js
+++ b/chrome/browser/resources/chromeos/login/arc_terms_of_service.js
@@ -10,7 +10,18 @@
 Polymer({
   is: 'arc-tos-element',
 
-  behaviors: [OobeI18nBehavior, OobeDialogHostBehavior],
+  behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior],
+
+  EXTERNAL_API: [
+    'setMetricsMode',
+    'setBackupAndRestoreMode',
+    'setLocationServicesMode',
+    'loadPlayStoreToS',
+    'setArcManaged',
+    'setupForDemoMode',
+    'clearDemoMode',
+    'setTosForTesting',
+  ],
 
   properties: {
     /**
@@ -159,41 +170,51 @@
    */
   lastFocusedElement_: null,
 
-  /** Called when dialog is shown */
+  countryCode_: null,
+  language_: null,
+  pageReady_: false,
+
+  /**
+   * The hostname of the url where the terms of service will be fetched.
+   * Overwritten by tests to load terms of service from local test server.
+   */
+  termsOfServiceHostName_: 'https://play.google.com',
+
+  /** @override */
+  ready() {
+    this.initializeLoginScreen('ArcTermsOfServiceScreen', {
+      resetAllowed: true,
+    });
+
+    if (loadTimeData.valueExists('arcTosHostNameForTesting')) {
+      this.setTosHostNameForTesting_(
+          loadTimeData.getString('arcTosHostNameForTesting'));
+    }
+  },
+
+  /** Initial UI State for screen */
+  getOobeUIInitialState() {
+    return OOBE_UI_STATE.ONBOARDING;
+  },
+
+  /**
+   * Event handler that is invoked just before the screen is shown.
+   */
   onBeforeShow() {
+    this.focusButton_();
     this.is_shown_ = true;
     window.setTimeout(this.applyOobeConfiguration_.bind(this), 0);
-  },
 
-  /** Setups overlay webview loading callback */
-  setupOverlay() {
-    var self = this;
-    this.$.arcTosOverlayWebview.addEventListener(
-        'contentload', function() {
-      self.overlayLoading_ = false;
-    });
-  },
-
-  /**
-   * Opens external URL in popup overlay.
-   * @param {string} targetUrl to show in overlay webview.
-   * @param {boolean} isUsingOfflineTerm whether to use offline url.
-   */
-  showUrlOverlay(targetUrl, isUsingOfflineTerm) {
-    if (!isUsingOfflineTerm) {
-      this.$.arcTosOverlayWebview.src = targetUrl;
+    var isDemoModeSetup = this.isDemoModeSetup_();
+    if (isDemoModeSetup) {
+      this.setMetricsMode('arcTextMetricsManagedEnabled', true);
     }
-    this.lastFocusedElement_ = this.shadowRoot.activeElement;
-
-    this.overlayLoading_ = true;
-    this.$.arcTosOverlayPrivacyPolicy.showDialog();
-  },
-
-  /**
-   * Returns element by its id.
-   */
-  getElement(id) {
-    return this.$[id];
+    this.$.acceptTextKey = isDemoModeSetup ?
+        'arcTermsOfServiceAcceptAndContinueButton' :
+        'arcTermsOfServiceAcceptButton';
+    this.$.googleServiceConfirmationText = isDemoModeSetup ?
+        'arcAcceptAndContinueGoogleServiceConfirmation' :
+        'arcTextGoogleServiceConfirmation';
   },
 
   /**
@@ -232,14 +253,480 @@
     window.setTimeout(this.applyOobeConfiguration_.bind(this), 0);
   },
 
+  /** Called when dialog is hidden. */
+  onBeforeHide() {
+    this.reset_();
+  },
+
+  /**
+   * Resets UI elements to their initial state.
+   * @private
+   */
+  reset_() {
+    this.showFullDialog = false;
+    this.$.arcTosNextButton.focus();
+  },
+
+  focusButton_() {
+    var id;
+    if (this.hasClass_('arc-tos-loaded')) {
+      id = 'arcTosNextButton';
+    } else if (this.hasClass_('error')) {
+      id = 'arcTosRetryButton';
+    }
+
+    if (typeof id === 'undefined')
+      return;
+
+    Polymer.RenderStatus.afterNextRender(this, () => this.$[id].focus());
+  },
+
+  /**
+   * Makes sure that UI is initialized.
+   *
+   * @private
+   * @suppress {missingProperties} as WebView type has no addContentScripts
+   */
+  ensureInitialized_() {
+    if (this.pageReady_) {
+      return;
+    }
+
+    this.pageReady_ = true;
+
+    var termsView = this.$.arcTosView;
+    var requestFilter = {urls: ['<all_urls>'], types: ['main_frame']};
+
+    termsView.request.onErrorOccurred.addListener(
+        this.onTermsViewErrorOccurred.bind(this), requestFilter);
+
+    // Open links from webview in overlay dialog.
+    var self = this;
+    termsView.addEventListener('newwindow', function(event) {
+      event.preventDefault();
+      self.showUrlOverlay(event.targetUrl);
+    });
+
+    termsView.addContentScripts([{
+      name: 'postProcess',
+      matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
+      css: {files: ['playstore.css']},
+      js: {files: ['playstore.js']},
+      run_at: 'document_end'
+    }]);
+
+    var overlayUrl = this.$.arcTosOverlayWebview;
+    overlayUrl.addContentScripts([{
+      name: 'postProcess',
+      matches: ['https://support.google.com/*'],
+      css: {files: ['overlay.css']},
+      run_at: 'document_end'
+    }]);
+  },
+
+  /**
+   * Opens external URL in popup overlay.
+   * @param {string} targetUrl to show in overlay webview.
+   */
+  showUrlOverlay(targetUrl) {
+    if (this.usingOfflineTerms_) {
+      const TERMS_URL = 'chrome://terms/arc/privacy_policy';
+      WebViewHelper.loadUrlContentToWebView(
+          this.$.arcTosOverlayWebview, TERMS_URL,
+          WebViewHelper.ContentType.PDF);
+    } else {
+      this.$.arcTosOverlayWebview.src = targetUrl;
+    }
+
+    this.lastFocusedElement_ = this.shadowRoot.activeElement;
+    this.overlayLoading_ = true;
+    this.$.arcTosOverlayPrivacyPolicy.showDialog();
+  },
+
+  /**
+   * Returns current language that can be updated in OOBE flow. If OOBE flow
+   * does not exist then use navigator.language.
+   *
+   * @private
+   */
+  getCurrentLanguage_() {
+    const LANGUAGE_LIST_ID = 'languageList';
+    if (loadTimeData.valueExists(LANGUAGE_LIST_ID)) {
+      var languageList = /** @type {!Array<OobeTypes.LanguageDsc>} */ (
+          loadTimeData.getValue(LANGUAGE_LIST_ID));
+      if (languageList) {
+        var language = getSelectedValue(languageList);
+        if (language) {
+          return language;
+        }
+      }
+    }
+    return navigator.language;
+  },
+
+  /**
+   * Sets current metrics mode.
+   * @param {string} text Describes current metrics state.
+   * @param {boolean} visible If metrics text is visible.
+   */
+  setMetricsMode(text, visible) {
+    this.isMetricsHidden = !visible;
+    this.metricsText = text;
+  },
+
+  /**
+   * Sets current backup and restore mode.
+   * @param {boolean} enabled Defines the value for backup and restore
+   *                          checkbox.
+   * @param {boolean} managed Defines whether this setting is set by policy.
+   */
+  setBackupAndRestoreMode(enabled, managed) {
+    this.backupRestore = enabled;
+    this.backupRestoreManaged = managed;
+  },
+
+  /**
+   * Sets current usage of location service opt in mode.
+   * @param {boolean} enabled Defines the value for location service opt in.
+   * @param {boolean} managed Defines whether this setting is set by policy.
+   */
+  setLocationServicesMode(enabled, managed) {
+    this.backupRestore = enabled;
+    this.backupRestoreManaged = managed;
+  },
+
+  /**
+   * Loads Play Store ToS in case country code has been changed or previous
+   * attempt failed.
+   * @param {string} countryCode Country code based on current timezone.
+   * @suppress {missingProperties} as WebView type has no addContentScripts
+   */
+  loadPlayStoreToS(countryCode) {
+    // Make sure page is initialized for login mode. For OOBE mode, page is
+    // initialized as result of handling updateLocalizedContent.
+    this.ensureInitialized_();
+
+    var language = this.getCurrentLanguage_();
+    countryCode = countryCode.toLowerCase();
+
+    if (this.language_ && this.language_ == language && this.countryCode_ &&
+        this.countryCode_ == countryCode && !this.classList.contains('error') &&
+        !this.usingOfflineTerms_ && this.tosContent_) {
+      this.enableButtons_(true);
+      return;
+    }
+
+    // Store current ToS parameters.
+    this.language_ = language;
+    this.countryCode_ = countryCode;
+
+    var scriptSetParameters = 'document.countryCode = \'' + countryCode + '\';';
+    scriptSetParameters += 'document.language = \'' + language + '\';';
+    scriptSetParameters += 'document.viewMode = \'large-view\';';
+
+    var termsView = this.$.arcTosView;
+
+    termsView.removeContentScripts(['preProcess']);
+    termsView.addContentScripts([{
+      name: 'preProcess',
+      matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
+      js: {code: scriptSetParameters},
+      run_at: 'document_start'
+    }]);
+
+    // Try to use currently loaded document first.
+    var self = this;
+    if (termsView.src != '' && this.classList.contains('arc-tos-loaded')) {
+      var navigateScript = 'processLangZoneTerms(true, \'' + language +
+          '\', \'' + countryCode + '\');';
+      termsView.executeScript({code: navigateScript}, function(results) {
+        if (!results || results.length != 1 ||
+            typeof results[0] !== 'boolean' || !results[0]) {
+          self.reloadPlayStoreToS();
+        }
+      });
+    } else {
+      this.reloadPlayStoreToS();
+    }
+  },
+
+  /**
+   * Sets Play Store terms of service for testing.
+   * @param {string} terms Fake Play Store terms of service.
+   */
+  setTosForTesting(terms) {
+    this.tosContent_ = terms;
+    this.usingOfflineTerms_ = true;
+    this.setTermsViewContentLoadedState_();
+  },
+
+  /**
+   * Sets Play Store hostname url used to fetch terms of service for testing.
+   * @param {string} hostname hostname used to fetch terms of service.
+   * @suppress {missingProperties} as WebView type has no addContentScripts
+   */
+  setTosHostNameForTesting_(hostname) {
+    this.termsOfServiceHostName_ = hostname;
+    this.reloadsLeftForTesting_ = 1;
+
+    // Enable loading content script 'playstore.js' when fetching ToS from
+    // the test server.
+    var termsView = this.$.arcTosView;
+    termsView.removeContentScripts(['postProcess']);
+    termsView.addContentScripts([{
+      name: 'postProcess',
+      matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
+      css: {files: ['playstore.css']},
+      js: {files: ['playstore.js']},
+      run_at: 'document_end'
+    }]);
+  },
+
+  /**
+   * Sets if Arc is managed. ToS webview should not be visible if Arc is
+   * manged.
+   * @param {boolean} managed Defines whether this setting is set by policy.
+   * @param {boolean} child whether current account is a child account.
+   */
+  setArcManaged(managed, child) {
+    this.$.arcTosViewContainer.hidden = managed;
+    this.isChild = child;
+  },
+
   /**
    * On-tap event handler for Accept button.
    *
    * @private
    */
   onAccept_() {
-    chrome.send('login.ArcTermsOfServiceScreen.userActed', ['accept']);
-    this.screen.onAccept();
+    this.userActed('accept');
+
+    this.enableButtons_(false);
+    chrome.send('arcTermsOfServiceAccept', [
+      this.backupRestore, this.locationService, this.reviewSettings,
+      this.tosContent_
+    ]);
+  },
+
+  /**
+   * Enables/Disables set of buttons: Accept, Skip, Retry.
+   * @param {boolean} enable Buttons are enabled if set to true.
+   *
+   * @private
+   */
+  enableButtons_(enable) {
+    this.arcTosButtonsDisabled = !enable;
+  },
+
+  /**
+   * Reloads Play Store ToS.
+   */
+  reloadPlayStoreToS() {
+    if (this.reloadsLeftForTesting_ !== undefined) {
+      if (this.reloadsLeftForTesting_ <= 0)
+        return;
+      --this.reloadsLeftForTesting_;
+    }
+    this.termsError = false;
+    this.usingOfflineTerms_ = false;
+    var termsView = this.$.arcTosView;
+    termsView.src = this.termsOfServiceHostName_ + '/about/play-terms.html';
+    this.removeClass_('arc-tos-loaded');
+    this.removeClass_('error');
+    this.addClass_('arc-tos-loading');
+    this.enableButtons_(false);
+  },
+
+  /**
+   * Sets up the variant of the screen dedicated falsedemo mode.
+   */
+  setupForDemoMode() {
+    this.demoMode = true;
+  },
+
+  /**
+   * Sets up the variant of the screen dedicated for demo mode.
+   */
+  clearDemoMode() {
+    this.demoMode = false;
+  },
+
+  /**
+   * Adds new class to the list of classes of root OOBE style.
+   * @param {string} className class to remove.
+   *
+   * @private
+   */
+  addClass_(className) {
+    this.$.arcTosDialog.classList.add(className);
+  },
+
+  /**
+   * Removes class from the list of classes of root OOBE style.
+   * @param {string} className class to remove.
+   *
+   * @private
+   */
+  removeClass_(className) {
+    this.$.arcTosDialog.classList.remove(className);
+  },
+
+  /**
+   * Checks if class exists in the list of classes of root OOBE style.
+   * @param {string} className class to check.
+   *
+   * @private
+   */
+  hasClass_(className) {
+    return this.$.arcTosDialog.classList.contains(className);
+  },
+
+  /**
+   * Returns a match pattern compatible version of termsOfServiceHostName_ by
+   * stripping the port number part of the hostname. During tests
+   * termsOfServiceHostName_ will contain a port number part.
+   * @return {string}
+   * @private
+   */
+  getTermsOfServiceHostNameForMatchPattern_() {
+    return this.termsOfServiceHostName_.replace(/:[0-9]+/, '');
+  },
+
+  /**
+   * Handles event when terms view is loaded.
+   * @suppress {missingProperties}
+   */
+  onTermsViewContentLoad_() {
+    if (this.termsError) {
+      return;
+    }
+
+    var termsView = this.$.arcTosView;
+    if (this.usingOfflineTerms_) {
+      // Process offline ToS. Scripts added to web view by addContentScripts()
+      // are not executed when using data url.
+      this.tosContent_ = termsView.src;
+      var setParameters =
+          `document.body.classList.add('large-view', 'offline-terms');`;
+      termsView.executeScript({code: setParameters});
+      termsView.insertCSS({file: 'playstore.css'});
+      this.setTermsViewContentLoadedState_();
+    } else {
+      // Process online ToS.
+      var getToSContent = {code: 'getToSContent();'};
+      termsView.executeScript(getToSContent, this.onGetToSContent_.bind(this));
+    }
+  },
+
+  /** Setups overlay webview loading callback */
+  onAcrTosOverlayContentLoad_() {
+    this.overlayLoading_ = false;
+  },
+
+  /**
+   * Handles callback for getToSContent.
+   */
+  onGetToSContent_(results) {
+    if (!results || results.length != 1 || typeof results[0] !== 'string') {
+      this.showError_();
+      return;
+    }
+
+    this.tosContent_ = results[0];
+    this.setTermsViewContentLoadedState_();
+  },
+
+  /**
+   * Sets the screen in the loaded state. Should be called after arc terms
+   * were loaded.
+   * @private
+   */
+  setTermsViewContentLoadedState_() {
+    this.removeClass_('arc-tos-loading');
+    this.removeClass_('error');
+    this.addClass_('arc-tos-loaded');
+
+    this.enableButtons_(true);
+    this.showFullDialog = false;
+    this.$.arcTosNextButton.focus();
+  },
+
+  /**
+   * Handles event when terms view cannot be loaded.
+   */
+  onTermsViewErrorOccurred(details) {
+    // If in demo mode fallback to offline Terms of Service copy.
+    if (this.isDemoModeSetup_()) {
+      this.usingOfflineTerms_ = true;
+      const TERMS_URL = 'chrome://terms/arc/terms';
+      var webView = this.$.arcTosView;
+      WebViewHelper.loadUrlContentToWebView(
+          webView, TERMS_URL, WebViewHelper.ContentType.HTML);
+      return;
+    }
+    this.showError_();
+  },
+
+  /**
+   * Shows error UI when terms view cannot be loaded or terms content cannot
+   * be fetched from webview.
+   */
+  showError_() {
+    this.termsError = true;
+    this.removeClass_('arc-tos-loading');
+    this.removeClass_('arc-tos-loaded');
+    this.addClass_('error');
+
+    this.enableButtons_(true);
+    this.$.arcTosRetryButton.focus();
+  },
+
+  /**
+   * Updates localized content of the screen that is not updated via template.
+   */
+  updateLocalizedContent() {
+    this.ensureInitialized_();
+
+    // We might need to reload Play Store ToS in case language was changed.
+    if (this.countryCode_) {
+      this.loadPlayStoreToS(this.countryCode_);
+    }
+  },
+
+  /**
+   * Returns whether arc terms are shown as a part of demo mode setup.
+   * @return {boolean}
+   * @private
+   */
+  isDemoModeSetup_() {
+    return this.demoMode;
+  },
+
+  /**
+   * Shows loading screen for debugging purpose
+   */
+  showLoadingScreenForTesting() {
+    this.removeClass_('arc-tos-loaded');
+    this.removeClass_('error');
+    this.addClass_('arc-tos-loading');
+    this.enableButtons_(false);
+  },
+
+  onPolicyLinkClick_() {
+    this.userActed('policy-link');
+
+    var termsView = this.$.arcTosView;
+    var self = this;
+    termsView.executeScript(
+        {code: 'getPrivacyPolicyLink();'}, function(results) {
+          if (results && results.length == 1 && typeof results[0] == 'string') {
+            self.showUrlOverlay(results[0]);
+          } else {
+            var defaultLink = 'https://www.google.com/intl/' +
+                self.getCurrentLanguage_() + '/policies/privacy/';
+            self.showUrlOverlay(defaultLink);
+          }
+        });
   },
 
   /**
@@ -248,7 +735,8 @@
    * @private
    */
   onNext_() {
-    chrome.send('login.ArcTermsOfServiceScreen.userActed', ['next']);
+    this.userActed('next');
+
     this.showFullDialog = true;
     this.$.arcTosDialog.scrollToBottom();
     this.$.arcTosAcceptButton.focus();
@@ -260,8 +748,8 @@
    * @private
    */
   onRetry_() {
-    chrome.send('login.ArcTermsOfServiceScreen.userActed', ['retry']);
-    this.screen.reloadPlayStoreToS();
+    this.userActed('retry');
+    this.reloadPlayStoreToS();
   },
 
   /**
@@ -270,7 +758,7 @@
    * @private
    */
   onBack_() {
-    chrome.send('login.ArcTermsOfServiceScreen.userActed', ['go-back']);
+    this.userActed('go-back');
   },
 
   /**
@@ -278,8 +766,7 @@
    * @private
    */
   onMetricsLearnMoreTap_() {
-    chrome.send(
-        'login.ArcTermsOfServiceScreen.userActed', ['metrics-learn-more']);
+    this.userActed('metrics-learn-more');
     this.lastFocusedElement_ = this.shadowRoot.activeElement;
     this.$.arcMetricsPopup.showDialog();
   },
@@ -289,9 +776,7 @@
    * @private
    */
   onBackupRestoreLearnMoreTap_() {
-    chrome.send(
-        'login.ArcTermsOfServiceScreen.userActed',
-        ['backup-restore-learn-more']);
+    this.userActed('backup-restore-learn-more');
     this.lastFocusedElement_ = this.shadowRoot.activeElement;
     if (this.isChild) {
       this.$.arcBackupRestoreChildPopup.showDialog();
@@ -305,9 +790,7 @@
    * @private
    */
   onLocationServiceLearnMoreTap_() {
-    chrome.send(
-        'login.ArcTermsOfServiceScreen.userActed',
-        ['location-service-learn-more']);
+    this.userActed('location-service-learn-more');
     this.lastFocusedElement_ = this.shadowRoot.activeElement;
     this.$.arcLocationServicePopup.showDialog();
   },
@@ -317,9 +800,7 @@
    * @private
    */
   onPaiLearnMoreTap_() {
-    chrome.send(
-        'login.ArcTermsOfServiceScreen.userActed',
-        ['play-auto-install-learn-more']);
+    this.userActed('play-auto-install-learn-more');
     this.lastFocusedElement_ = this.shadowRoot.activeElement;
     this.$.arcPaiPopup.showDialog();
   },
diff --git a/chrome/browser/resources/chromeos/login/md_login.js b/chrome/browser/resources/chromeos/login/md_login.js
index aa9707e..ba48b4e 100644
--- a/chrome/browser/resources/chromeos/login/md_login.js
+++ b/chrome/browser/resources/chromeos/login/md_login.js
@@ -22,7 +22,6 @@
 // <include src="oobe_screen_autolaunch.js">
 // <include src="oobe_select.js">
 
-// <include src="screen_arc_terms_of_service.js">
 // <include src="screen_error_message.js">
 // <include src="screen_discover.js">
 // <include src="screen_multidevice_setup.js">
@@ -52,7 +51,6 @@
         login.AccountPickerScreen.register();
         login.AutolaunchScreen.register();
         login.ErrorMessageScreen.register();
-        login.ArcTermsOfServiceScreen.register();
         login.DiscoverScreen.register();
         login.MultiDeviceSetupScreen.register();
 
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js
index 2c41bc4b..2115305 100644
--- a/chrome/browser/resources/chromeos/login/oobe.js
+++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -23,7 +23,6 @@
 // <include src="oobe_screen_autolaunch.js">
 // <include src="oobe_select.js">
 
-// <include src="screen_arc_terms_of_service.js">
 // <include src="screen_error_message.js">
 // <include src="screen_discover.js">
 // <include src="screen_multidevice_setup.js">
@@ -46,7 +45,6 @@
         login.AutolaunchScreen.register();
         login.AccountPickerScreen.register();
         login.ErrorMessageScreen.register();
-        login.ArcTermsOfServiceScreen.register();
         login.DiscoverScreen.register();
         login.MultiDeviceSetupScreen.register();
 
diff --git a/chrome/browser/resources/chromeos/login/oobe_welcome.html b/chrome/browser/resources/chromeos/login/oobe_welcome.html
index aed0eeb..c6629d3b 100644
--- a/chrome/browser/resources/chromeos/login/oobe_welcome.html
+++ b/chrome/browser/resources/chromeos/login/oobe_welcome.html
@@ -290,5 +290,22 @@
             on-click="closeAdvancedOptionsSection_"></oobe-text-button>
       </div>
     </oobe-dialog>
+    <!-- Demo Mode confirmation dialog -->
+    <oobe-help-dialog id="demoModeConfirmationDialog">
+      <div slot="title">
+        [[i18nDynamic(locale, 'enableDemoModeDialogTitle')]]
+      </div>
+      <div slot="content">
+        [[i18nDynamic(locale, 'enableDemoModeDialogText')]]
+      </div>
+      <div slot="buttons">
+        <oobe-text-button id="cancelButton" border
+            on-click="onDemoModeDialogCancelTap_"
+            text-key="enableDemoModeDialogCancel"></oobe-text-button>
+        <oobe-text-button inverse on-click="onDemoModeDialogConfirmTap_"
+            id="okButton"
+            text-key="enableDemoModeDialogConfirm"></oobe-text-button>
+      </div>
+    </oobe-help-dialog>
   </template>
 </dom-module>
diff --git a/chrome/browser/resources/chromeos/login/oobe_welcome.js b/chrome/browser/resources/chromeos/login/oobe_welcome.js
index ce6ebd2..5cd62f3fa 100644
--- a/chrome/browser/resources/chromeos/login/oobe_welcome.js
+++ b/chrome/browser/resources/chromeos/login/oobe_welcome.js
@@ -409,22 +409,27 @@
   },
 
   /**
+   * On-tap event handler for demo mode confirmation dialog cancel button.
+   * @private
+   */
+  onDemoModeDialogCancelTap_() {
+    this.$.demoModeConfirmationDialog.hideDialog();
+  },
+
+  /**
+   * On-tap event handler for demo mode confirmation dialog confirm button.
+   * @private
+   */
+  onDemoModeDialogConfirmTap_() {
+    this.userActed('setupDemoMode');
+    this.$.demoModeConfirmationDialog.hideDialog();
+  },
+
+  /**
    * Shows confirmation dialog for starting Demo mode
    */
   showDemoModeConfirmationDialog() {
-    if (!this.enableDemoModeDialog_) {
-      this.enableDemoModeDialog_ =
-          new cr.ui.dialogs.ConfirmDialog(document.body);
-      this.enableDemoModeDialog_.setOkLabel(
-          loadTimeData.getString('enableDemoModeDialogConfirm'));
-      this.enableDemoModeDialog_.setCancelLabel(
-          loadTimeData.getString('enableDemoModeDialogCancel'));
-    }
-    this.enableDemoModeDialog_.showWithTitle(
-        loadTimeData.getString('enableDemoModeDialogTitle'),
-        loadTimeData.getString('enableDemoModeDialogText'), () => {
-          this.userActed('setupDemoMode');
-        });
+    this.$.demoModeConfirmationDialog.showDialog();
   },
 
   onSetupDemoModeGesture() {
diff --git a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.html b/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.html
deleted file mode 100644
index ee29893..0000000
--- a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<link rel="stylesheet" href="chrome://resources/css/overlay.css">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
-
-<div class="step right hidden arc-tos-loading" id="arc-tos"
-    role="group" hidden>
-  <arc-tos-element id="arc-tos-root"></arc-tos-element>
-</div>
diff --git a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js b/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js
deleted file mode 100644
index e26030e..0000000
--- a/chrome/browser/resources/chromeos/login/screen_arc_terms_of_service.js
+++ /dev/null
@@ -1,548 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview Oobe ARC Terms of Service screen implementation.
- */
-
-login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
-  return {
-    EXTERNAL_API: [
-      'setMetricsMode', 'setBackupAndRestoreMode', 'setLocationServicesMode',
-      'loadPlayStoreToS', 'setArcManaged', 'setupForDemoMode', 'clearDemoMode',
-      'setTosForTesting'
-    ],
-
-    /** @override */
-    decorate(element) {
-      this.countryCode_ = null;
-      this.language_ = null;
-      this.pageReady_ = false;
-
-      /* The hostname of the url where the terms of service will be fetched.
-       * Overwritten by tests to load terms of service from local test server.*/
-      this.termsOfServiceHostName_ = 'https://play.google.com';
-      if (loadTimeData.valueExists('arcTosHostNameForTesting')) {
-        this.setTosHostNameForTesting_(
-            loadTimeData.getString('arcTosHostNameForTesting'));
-      }
-    },
-
-    /** Initial UI State for screen */
-    getOobeUIInitialState() {
-      return OOBE_UI_STATE.ONBOARDING;
-    },
-
-    /**
-     * Returns current language that can be updated in OOBE flow. If OOBE flow
-     * does not exist then use navigator.language.
-     *
-     * @private
-     */
-    getCurrentLanguage_() {
-      const LANGUAGE_LIST_ID = 'languageList';
-      if (loadTimeData.valueExists(LANGUAGE_LIST_ID)) {
-        var languageList = loadTimeData.getValue(LANGUAGE_LIST_ID);
-        if (languageList) {
-          var language = getSelectedValue(languageList);
-          if (language) {
-            return language;
-          }
-        }
-      }
-      return navigator.language;
-    },
-
-    /**
-     * Makes sure that UI is initialized.
-     *
-     * @private
-     */
-    ensureInitialized_() {
-      if (this.pageReady_) {
-        return;
-      }
-
-      this.pageReady_ = true;
-      $('arc-tos-root').screen = this;
-      $('arc-tos-root').setupOverlay();
-
-      var termsView = this.getElement_('arcTosView');
-      var requestFilter = {urls: ['<all_urls>'], types: ['main_frame']};
-
-      termsView.request.onErrorOccurred.addListener(
-          this.onTermsViewErrorOccurred.bind(this), requestFilter);
-      termsView.addEventListener(
-          'contentload', this.onTermsViewContentLoad.bind(this));
-
-      // Open links from webview in overlay dialog.
-      var self = this;
-      termsView.addEventListener('newwindow', function(event) {
-        event.preventDefault();
-        self.showUrlOverlay(event.targetUrl);
-      });
-
-      termsView.addContentScripts([{
-        name: 'postProcess',
-        matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
-        css: {files: ['playstore.css']},
-        js: {files: ['playstore.js']},
-        run_at: 'document_end'
-      }]);
-
-      this.getElement_('arcPolicyLink').onclick = function() {
-        chrome.send('login.ArcTermsOfServiceScreen.userActed', ['policy-link']);
-        termsView.executeScript(
-            {code: 'getPrivacyPolicyLink();'}, function(results) {
-              if (results && results.length == 1 &&
-                  typeof results[0] == 'string') {
-                self.showUrlOverlay(results[0]);
-              } else {
-                var defaultLink = 'https://www.google.com/intl/' +
-                    self.getCurrentLanguage_() + '/policies/privacy/';
-                self.showUrlOverlay(defaultLink);
-              }
-            });
-      };
-
-      var overlayUrl = this.getElement_('arcTosOverlayWebview');
-      overlayUrl.addContentScripts([{
-        name: 'postProcess',
-        matches: ['https://support.google.com/*'],
-        css: {files: ['overlay.css']},
-        run_at: 'document_end'
-      }]);
-
-      // Update the screen size after setup layout.
-      if (Oobe.getInstance().currentScreen === this)
-        Oobe.getInstance().updateScreenSize(this);
-    },
-
-    /**
-     * Sets current metrics mode.
-     * @param {string} text Describes current metrics state.
-     * @param {boolean} visible If metrics text is visible.
-     */
-    setMetricsMode(text, visible) {
-      $('arc-tos-root').isMetricsHidden = !visible;
-      $('arc-tos-root').metricsText = text;
-    },
-
-    /**
-     * Sets current backup and restore mode.
-     * @param {boolean} enabled Defines the value for backup and restore
-     *                          checkbox.
-     * @param {boolean} managed Defines whether this setting is set by policy.
-     */
-    setBackupAndRestoreMode(enabled, managed) {
-      $('arc-tos-root').backupRestore = enabled;
-      $('arc-tos-root').backupRestoreManaged = managed;
-    },
-
-    /**
-     * Sets current usage of location service opt in mode.
-     * @param {boolean} enabled Defines the value for location service opt in.
-     * @param {boolean} managed Defines whether this setting is set by policy.
-     */
-    setLocationServicesMode(enabled, managed) {
-      $('arc-tos-root').backupRestore = enabled;
-      $('arc-tos-root').backupRestoreManaged = managed;
-    },
-
-    /**
-     * Loads Play Store ToS in case country code has been changed or previous
-     * attempt failed.
-     * @param {string} countryCode Country code based on current timezone.
-     */
-    loadPlayStoreToS(countryCode) {
-      // Make sure page is initialized for login mode. For OOBE mode, page is
-      // initialized as result of handling updateLocalizedContent.
-      this.ensureInitialized_();
-
-      var language = this.getCurrentLanguage_();
-      countryCode = countryCode.toLowerCase();
-
-      if (this.language_ && this.language_ == language && this.countryCode_ &&
-          this.countryCode_ == countryCode &&
-          !this.classList.contains('error') && !this.usingOfflineTerms_ &&
-          this.tosContent_) {
-        this.enableButtons_(true);
-        return;
-      }
-
-      // Store current ToS parameters.
-      this.language_ = language;
-      this.countryCode_ = countryCode;
-
-      var scriptSetParameters =
-          'document.countryCode = \'' + countryCode + '\';';
-      scriptSetParameters += 'document.language = \'' + language + '\';';
-      scriptSetParameters += 'document.viewMode = \'large-view\';';
-
-      var termsView = this.getElement_('arcTosView');
-
-      termsView.removeContentScripts(['preProcess']);
-      termsView.addContentScripts([{
-        name: 'preProcess',
-        matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
-        js: {code: scriptSetParameters},
-        run_at: 'document_start'
-      }]);
-
-      // Try to use currently loaded document first.
-      var self = this;
-      if (termsView.src != '' && this.classList.contains('arc-tos-loaded')) {
-        var navigateScript = 'processLangZoneTerms(true, \'' + language +
-            '\', \'' + countryCode + '\');';
-        termsView.executeScript({code: navigateScript}, function(results) {
-          if (!results || results.length != 1 ||
-              typeof results[0] !== 'boolean' || !results[0]) {
-            self.reloadPlayStoreToS();
-          }
-        });
-      } else {
-        this.reloadPlayStoreToS();
-      }
-    },
-
-    /**
-     * Sets Play Store terms of service for testing.
-     * @param {string} terms Fake Play Store terms of service.
-     */
-    setTosForTesting(terms) {
-      this.tosContent_ = terms;
-      this.usingOfflineTerms_ = true;
-      this.setTermsViewContentLoadedState_();
-    },
-
-    /**
-     * Sets Play Store hostname url used to fetch terms of service for testing.
-     * @param {string} hostname hostname used to fetch terms of service.
-     */
-    setTosHostNameForTesting_(hostname) {
-      this.termsOfServiceHostName_ = hostname;
-      this.reloadsLeftForTesting_ = 1;
-
-      // Enable loading content script 'playstore.js' when fetching ToS from
-      // the test server.
-      var termsView = this.getElement_('arcTosView');
-      termsView.removeContentScripts(['postProcess']);
-      termsView.addContentScripts([{
-        name: 'postProcess',
-        matches: [this.getTermsOfServiceHostNameForMatchPattern_() + '/*'],
-        css: {files: ['playstore.css']},
-        js: {files: ['playstore.js']},
-        run_at: 'document_end'
-      }]);
-    },
-
-    /**
-     * Sets if Arc is managed. ToS webview should not be visible if Arc is
-     * manged.
-     * @param {boolean} managed Defines whether this setting is set by policy.
-     * @param {boolean} whether current account is a child account.
-     */
-    setArcManaged(managed, child) {
-      var visibility = managed ? 'hidden' : 'visible';
-      this.getElement_('arcTosViewContainer').style.visibility = visibility;
-      $('arc-tos-root').isChild = child;
-    },
-
-    /**
-     * Handles Accept button click.
-     */
-    onAccept() {
-      this.enableButtons_(false);
-
-      var isBackupRestoreEnabled = $('arc-tos-root').backupRestore;
-      var isLocationServiceEnabled = $('arc-tos-root').locationService;
-      var reviewArcSettings = $('arc-tos-root').reviewSettings;
-      chrome.send('arcTermsOfServiceAccept', [
-        isBackupRestoreEnabled, isLocationServiceEnabled, reviewArcSettings,
-        this.tosContent_
-      ]);
-    },
-
-    /**
-     * Enables/Disables set of buttons: Accept, Skip, Retry.
-     * @param {boolean} enable Buttons are enabled if set to true.
-     *
-     * @private
-     */
-    enableButtons_(enable) {
-      $('arc-tos-root').arcTosButtonsDisabled = !enable;
-    },
-
-    /**
-     * Opens external URL in popup overlay.
-     * @param {string} targetUrl URL to open.
-     */
-    showUrlOverlay(targetUrl) {
-      if (this.usingOfflineTerms_) {
-        const TERMS_URL = 'chrome://terms/arc/privacy_policy';
-        WebViewHelper.loadUrlContentToWebView(
-            this.getElement_('arcTosOverlayWebview'), TERMS_URL,
-            WebViewHelper.ContentType.PDF);
-      }
-      $('arc-tos-root').showUrlOverlay(targetUrl, this.usingOfflineTerms_);
-    },
-
-    /**
-     * Reloads Play Store ToS.
-     */
-    reloadPlayStoreToS() {
-      if (this.reloadsLeftForTesting_ !== undefined) {
-        if (this.reloadsLeftForTesting_ <= 0)
-          return;
-        --this.reloadsLeftForTesting_;
-      }
-      this.termsError = false;
-      this.usingOfflineTerms_ = false;
-      var termsView = this.getElement_('arcTosView');
-      termsView.src = this.termsOfServiceHostName_ + '/about/play-terms.html';
-      this.removeClass_('arc-tos-loaded');
-      this.removeClass_('error');
-      this.addClass_('arc-tos-loading');
-      this.enableButtons_(false);
-    },
-
-    /**
-     * Sets up the variant of the screen dedicated falsedemo mode.
-     */
-    setupForDemoMode() {
-      $('arc-tos-root').demoMode = true;
-    },
-
-    /**
-     * Sets up the variant of the screen dedicated for demo mode.
-     */
-    clearDemoMode() {
-      $('arc-tos-root').demoMode = false;
-    },
-
-    /**
-     * Adds new class to the list of classes of root OOBE style.
-     * @param {string} className class to remove.
-     *
-     * @private
-     */
-    addClass_(className) {
-      $('arc-tos-root').getElement('arcTosDialog').classList.add(className);
-    },
-
-    /**
-     * Removes class from the list of classes of root OOBE style.
-     * @param {string} className class to remove.
-     *
-     * @private
-     */
-    removeClass_(className) {
-      $('arc-tos-root').getElement('arcTosDialog').classList.remove(className);
-    },
-
-    /**
-     * Checks if class exsists in the list of classes of root OOBE style.
-     * @param {string} className class to check.
-     *
-     * @private
-     */
-    hasClass_(className) {
-      return $('arc-tos-root')
-          .getElement('arcTosDialog')
-          .classList.contains(className);
-    },
-
-    /**
-     * Returns a match pattern compatible version of termsOfServiceHostName_ by
-     * stripping the port number part of the hostname. During tests
-     * termsOfServiceHostName_ will contain a port number part.
-     * @return {string}
-     * @private
-     */
-    getTermsOfServiceHostNameForMatchPattern_() {
-      return this.termsOfServiceHostName_.replace(/:[0-9]+/, '');
-    },
-
-    /**
-     * Handles event when terms view is loaded.
-     */
-    onTermsViewContentLoad() {
-      if (this.termsError) {
-        return;
-      }
-
-      var termsView = this.getElement_('arcTosView');
-      if (this.usingOfflineTerms_) {
-        // Process offline ToS. Scripts added to web view by addContentScripts()
-        // are not executed when using data url.
-        this.tosContent_ = termsView.src;
-        var setParameters =
-            `document.body.classList.add('large-view', 'offline-terms');`;
-        termsView.executeScript({code: setParameters});
-        termsView.insertCSS({file: 'playstore.css'});
-        this.setTermsViewContentLoadedState_();
-      } else {
-        // Process online ToS.
-        var getToSContent = {code: 'getToSContent();'};
-        termsView.executeScript(
-            getToSContent, this.onGetToSContent_.bind(this));
-      }
-    },
-
-    /**
-     * Handles callback for getToSContent.
-     */
-    onGetToSContent_(results) {
-      if (!results || results.length != 1 || typeof results[0] !== 'string') {
-        this.showError_();
-        return;
-      }
-
-      this.tosContent_ = results[0];
-      this.setTermsViewContentLoadedState_();
-    },
-
-    /**
-     * Sets the screen in the loaded state. Should be called after arc terms
-     * were loaded.
-     * @private
-     */
-    setTermsViewContentLoadedState_() {
-      this.removeClass_('arc-tos-loading');
-      this.removeClass_('error');
-      this.addClass_('arc-tos-loaded');
-
-      this.enableButtons_(true);
-      $('arc-tos-root').showFullDialog = false;
-      this.getElement_('arcTosNextButton').focus();
-    },
-
-    /**
-     * Handles event when terms view cannot be loaded.
-     */
-    onTermsViewErrorOccurred(details) {
-      // If in demo mode fallback to offline Terms of Service copy.
-      if (this.isDemoModeSetup_()) {
-        this.usingOfflineTerms_ = true;
-        const TERMS_URL = 'chrome://terms/arc/terms';
-        var webView = this.getElement_('arcTosView');
-        WebViewHelper.loadUrlContentToWebView(
-            webView, TERMS_URL, WebViewHelper.ContentType.HTML);
-        return;
-      }
-      this.showError_();
-    },
-
-    /**
-     * Shows error UI when terms view cannot be loaded or terms content cannot
-     * be fetched from webview.
-     */
-    showError_() {
-      this.termsError = true;
-      this.removeClass_('arc-tos-loading');
-      this.removeClass_('arc-tos-loaded');
-      this.addClass_('error');
-
-      this.enableButtons_(true);
-      this.getElement_('arcTosRetryButton').focus();
-    },
-
-    /**
-     * Event handler that is invoked just before the screen is shown.
-     * @param {object} data Screen init payload.
-     */
-    onBeforeShow(data) {
-      this.focusButton_();
-
-      cr.ui.login.invokePolymerMethod($('arc-tos-root'), 'onBeforeShow');
-
-      var isDemoModeSetup = this.isDemoModeSetup_();
-      if (isDemoModeSetup) {
-        this.setMetricsMode('arcTextMetricsManagedEnabled', true);
-      }
-      $('arc-tos-root').accpetTextKey = isDemoModeSetup ?
-          'arcTermsOfServiceAcceptAndContinueButton' :
-          'arcTermsOfServiceAcceptButton';
-      $('arc-tos-root').googleServiceConfirmationText = isDemoModeSetup ?
-          'arcAcceptAndContinueGoogleServiceConfirmation' :
-          'arcTextGoogleServiceConfirmation';
-    },
-
-    /** @override */
-    onBeforeHide() {
-      this.reset_();
-    },
-
-    /**
-     * Resets UI elements to their initial state.
-     * @private
-     */
-    reset_() {
-      $('arc-tos-root').showFullDialog = false;
-      this.getElement_('arcTosNextButton').focus();
-    },
-
-    /**
-     * Ensures the correct button is focused when the page is shown.
-     *
-     * @private
-     */
-    focusButton_() {
-      var id;
-      if (this.hasClass_('arc-tos-loaded')) {
-        id = 'arcTosNextButton';
-      } else if (this.hasClass_('error')) {
-        id = 'arcTosRetryButton';
-      }
-
-      if (typeof id === 'undefined')
-        return;
-
-      setTimeout(function() {
-        this.getElement_(id).focus();
-      }.bind(this), 0);
-    },
-
-    /**
-     * Returns requested element from related part of HTML.
-     * @param {string} id Id of an element to find.
-     *
-     * @private
-     */
-    getElement_(id) {
-      return $('arc-tos-root').getElement(id);
-    },
-
-    /**
-     * Updates localized content of the screen that is not updated via template.
-     */
-    updateLocalizedContent() {
-      this.ensureInitialized_();
-
-      // We might need to reload Play Store ToS in case language was changed.
-      if (this.countryCode_) {
-        this.loadPlayStoreToS(this.countryCode_);
-      }
-    },
-
-    /**
-     * Returns whether arc terms are shown as a part of demo mode setup.
-     * @return {boolean}
-     * @private
-     */
-    isDemoModeSetup_() {
-      return $('arc-tos-root').demoMode;
-    },
-
-    /**
-     * Shows loading screen for debugging purpose
-     */
-    showLoadingScreenForTesting() {
-      this.removeClass_('arc-tos-loaded');
-      this.removeClass_('error');
-      this.addClass_('arc-tos-loading');
-      this.enableButtons_(false);
-    }
-  };
-});
diff --git a/chrome/browser/resources/chromeos/login/structure/screens_common.html b/chrome/browser/resources/chromeos/login/structure/screens_common.html
index 0a636e8..68e0d9db 100644
--- a/chrome/browser/resources/chromeos/login/structure/screens_common.html
+++ b/chrome/browser/resources/chromeos/login/structure/screens_common.html
@@ -13,7 +13,8 @@
 </assistant-optin-element>
 <include src="../../../../../../ui/login/account_picker/chromeos_screen_account_picker.html">
 <include src="../screen_error_message.html">
-<include src="../screen_arc_terms_of_service.html">
+<arc-tos-element id="arc-tos" class="step right hidden arc-tos-loading" hidden>
+</arc-tos-element>
 <gaia-signin-element id="gaia-signin" class="step hidden" hidden>
 </gaia-signin-element>
 <offline-ad-login-element id="offline-ad-login" class="step hidden" hidden>
@@ -43,9 +44,9 @@
 </gesture-navigation-element>
 <marketing-opt-in-element id="marketing-opt-in" class="step hidden">
 </marketing-opt-in-element>
-<family-link-notice-element id="family-link-notice" class="step hidden">
+<family-link-notice-element id="family-link-notice" class="step hidden" hidden>
 </family-link-notice-element>
-<user-creation-element id="user-creation" class="step hidden">
+<user-creation-element id="user-creation" class="step hidden" hidden>
 </user-creation-element>
-<parental-handoff-element id="parental-handoff" class="step hidden">
+<parental-handoff-element id="parental-handoff" class="step hidden" hidden>
 </parental-handoff-element>
diff --git a/chrome/browser/resources/device_log_ui/device_log_ui.html b/chrome/browser/resources/device_log_ui/device_log_ui.html
index 7b8ed70a..0970967 100644
--- a/chrome/browser/resources/device_log_ui/device_log_ui.html
+++ b/chrome/browser/resources/device_log_ui/device_log_ui.html
@@ -73,6 +73,10 @@
       <input id="log-type-serial" type="checkbox">
       <span>$i18n{logTypeSerialText}</span>
     </label>
+    <label>
+      <input id="log-type-camera" type="checkbox">
+      <span>$i18n{logTypeCameraText}</span>
+    </label>
   </div>
   <div id="log-container"></div>
 </body>
diff --git a/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar-new.html b/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar-new.html
index cc1f1b5..562941f 100644
--- a/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar-new.html
+++ b/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar-new.html
@@ -6,7 +6,6 @@
         0 4px 8px rgba(0, 0, 0, 0.06),
         0 1px 2px rgba(0, 0, 0, 0.3),
         0 2px 6px rgba(0, 0, 0, 0.15);
-    height: var(--viewer-pdf-toolbar-height);
     position: relative;
   }
 
diff --git a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
index 79b68ec..0c8c1b2 100644
--- a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
+++ b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
@@ -10,7 +10,6 @@
       </div>
     </div>
     <site-list
-        has-discarded-exceptions="{{blockSiteListHasDiscardedExceptions_}}"
         category="[[category]]"
         category-subtype="[[ContentSetting.BLOCK]]"
         category-header="[[blockHeader]]"
@@ -26,7 +25,6 @@
         search-filter="[[searchFilter]]">
     </site-list>
     <site-list
-        has-discarded-exceptions="{{allowSiteListHasDiscardedExceptions_}}"
         category="[[category]]"
         category-subtype="[[ContentSetting.ALLOW]]"
         category-header="[[allowHeader]]"
diff --git a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
index 9188a9a..b81f324 100644
--- a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
+++ b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js
@@ -84,32 +84,6 @@
       type: Boolean,
       value: true,
     },
-
-    /**
-     * Whether the block list has any discarded content setting
-     * pattern.
-     * @private
-     */
-    blockSiteListHasDiscardedExceptions_: Boolean,
-
-    /**
-     * Whether the allow list has any discarded content setting
-     * pattern.
-     * @private
-     */
-    allowSiteListHasDiscardedExceptions_: Boolean,
-
-    /**
-     * Boolean which keeps a track if any of the displayed lists has discarded
-     * content setting patterns.
-     */
-    siteListsHaveDiscardedExceptions: {
-      type: Boolean,
-      computed: 'computeHasDiscarded_(blockSiteListHasDiscardedExceptions_, ' +
-          'allowSiteListHasDiscardedExceptions_)',
-      notify: true,
-    },
-
   },
 
   observers: [
@@ -158,17 +132,5 @@
    */
   getReadOnlyList_() {
     return this.readOnlyList || this.defaultManaged_;
-  },
-
-  /**
-   * Merges the flags which keep track of discarded content setting patterns
-   * from each list into one boolean.
-   * @return {boolean}
-   * @private
-   */
-  computeHasDiscarded_() {
-    return this.blockSiteListHasDiscardedExceptions_ ||
-        this.allowSiteListHasDiscardedExceptions_;
-  },
-
+  }
 });
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js
index f8c3265..ffa01d18 100644
--- a/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -160,16 +160,6 @@
     tooltipText_: String,
 
     searchFilter: String,
-
-    /**
-     * Boolean which keeps a track if any of the list has discarded content
-     * setting patterns.
-     */
-    hasDiscardedExceptions: {
-      type: Boolean,
-      computed: 'computeHasDiscardedExceptions_(sites.*)',
-      notify: true,
-    }
   },
 
   // <if expr="chromeos">
@@ -538,16 +528,6 @@
   },
 
   /**
-   * Iterates through the sites list and returns true if one of those sites is
-   * a discarded content setting pattern.
-   * @return {boolean}
-   * @private
-   */
-  computeHasDiscardedExceptions_() {
-    return this.sites.some(exception => exception.isDiscarded);
-  },
-
-  /**
    * @return {string}
    * @private
    */
diff --git a/chrome/browser/resources/settings/site_settings/site_list_entry.html b/chrome/browser/resources/settings/site_settings/site_list_entry.html
index 13665a49..c40e35b 100644
--- a/chrome/browser/resources/settings/site_settings/site_list_entry.html
+++ b/chrome/browser/resources/settings/site_settings/site_list_entry.html
@@ -7,30 +7,19 @@
         flex: 1
       }
 
-      .settings-row.discarded .display-name {
-        text-decoration: line-through;
-      }
-
-      .settings-row.discarded .discarded-label {
-        margin-inline-start: 8px;
-      }
-
       /* Tooltip is hidden since site-list will display a common tooltip. */
       cr-policy-pref-indicator::part(tooltip) {
         display: none;
       }
     </style>
     <div class="list-item" focus-row-container>
-      <div class$="settings-row [[getClassForSiteListEntry_(model.isDiscarded)]]"
+      <div class="settings-row"
           actionable$="[[allowNavigateToSiteDetail_]]" on-click="onOriginTap_">
         <site-favicon url="[[model.origin]]"></site-favicon>
         <div class="middle no-min-width">
           <div class="text-elide">
-            <span class="display-name url-directionality">
+            <span class="url-directionality">
               [[computeDisplayName_(model)]]</span>
-            <span class="discarded-label"
-              hidden="[[!model.isDiscarded]]">$i18n{discardedPerSiteSetting}
-            </span>
           </div>
 
           <!-- This div must not contain extra whitespace. -->
diff --git a/chrome/browser/resources/settings/site_settings/site_list_entry.js b/chrome/browser/resources/settings/site_settings/site_list_entry.js
index 71a28e4..60bdfa8 100644
--- a/chrome/browser/resources/settings/site_settings/site_list_entry.js
+++ b/chrome/browser/resources/settings/site_settings/site_list_entry.js
@@ -251,18 +251,5 @@
     this.browserProxy.isOriginValid(this.model.origin).then((valid) => {
       this.allowNavigateToSiteDetail_ = valid;
     });
-  },
-
-  /**
-   * Returns the appropriate class name for styling purposes. It could be empty
-   * or 'discarded' for discarded content setting patterns.
-   * Patterns like `*://*.google.com:443/* are no longer supported for Plugin
-   * content settings.
-   * @param {boolean} isDiscarded Whether the exception is discarded
-   * @return {string}
-   * @private
-   */
-  getClassForSiteListEntry_(isDiscarded) {
-    return isDiscarded ? 'discarded' : '';
   }
 });
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
index 5ef8dd3..8866ea2 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -169,7 +169,6 @@
       embeddingOrigin: embeddingOrigin,
       incognito: exception.incognito,
       isEmbargoed: exception.isEmbargoed,
-      isDiscarded: exception.isDiscarded,
       origin: origin,
       displayName: exception.displayName,
       setting: exception.setting,
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
index 5dcfeb2..afaa9b7 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
@@ -70,7 +70,6 @@
  * @typedef {{embeddingOrigin: string,
  *            incognito: boolean,
  *            isEmbargoed: boolean,
- *            isDiscarded: boolean,
  *            origin: string,
  *            displayName: string,
  *            type: string,
@@ -86,7 +85,6 @@
  *            embeddingOrigin: string,
  *            incognito: boolean,
  *            isEmbargoed: boolean,
- *            isDiscarded: boolean,
  *            origin: string,
  *            displayName: string,
  *            setting: !ContentSetting,
diff --git a/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc b/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
index a79af5b7..613f45b 100644
--- a/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
@@ -125,7 +125,7 @@
 
   void RunFor(base::TimeDelta time_period) {
     base::RunLoop run_loop;
-    base::CancelableCallback<void()> callback(run_loop.QuitWhenIdleClosure());
+    base::CancelableOnceClosure callback(run_loop.QuitWhenIdleClosure());
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, callback.callback(), time_period);
     run_loop.Run();
diff --git a/chrome/browser/signin/services/DIR_METADATA b/chrome/browser/signin/services/DIR_METADATA
new file mode 100644
index 0000000..c22824a1
--- /dev/null
+++ b/chrome/browser/signin/services/DIR_METADATA
@@ -0,0 +1,5 @@
+monorail {
+  component: "Services>SignIn"
+}
+team_email: "chrome-signin@chromium.org"
+os: ANDROID
diff --git a/chrome/browser/signin/services/OWNERS b/chrome/browser/signin/services/OWNERS
index a1fed54..1c49383 100644
--- a/chrome/browser/signin/services/OWNERS
+++ b/chrome/browser/signin/services/OWNERS
@@ -1,5 +1,2 @@
 bsazonov@chromium.org
 aliceywang@chromium.org
-
-# TEAM: chrome-signin@chromium.org
-# COMPONENT: Services>SignIn
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc
index a9b83d65..8c62986 100644
--- a/chrome/browser/sync/chrome_sync_client.cc
+++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -13,6 +13,7 @@
 #include "base/path_service.h"
 #include "base/syslog_logging.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
 #include "chrome/browser/consent_auditor/consent_auditor_factory.h"
 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
@@ -122,7 +123,7 @@
 #include "chrome/browser/sync/trusted_vault_client_android.h"
 #endif  // defined(OS_ANDROID)
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "ash/public/cpp/app_list/app_list_switches.h"
 #include "chrome/browser/chromeos/arc/arc_util.h"
 #include "chrome/browser/chromeos/printing/printers_sync_bridge.h"
@@ -141,7 +142,7 @@
 #include "chromeos/constants/chromeos_features.h"
 #include "chromeos/constants/chromeos_switches.h"
 #include "components/arc/arc_util.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 using content::BrowserThread;
 using syncer::ForwardingModelTypeControllerDelegate;
@@ -445,7 +446,7 @@
   }
 #endif  // !defined(OS_ANDROID)
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Some profile types (e.g. sign-in screen) don't support app list.
   // Temporarily Disable AppListSyncableService for tablet form factor devices.
   // See crbug/1013732 for details.
@@ -466,7 +467,7 @@
               GetSyncableServiceForType(syncer::APP_LIST), dump_stack));
     }
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Chrome prefers OS provided spell checkers where they exist. So only sync the
 // custom dictionary on platforms that typically don't provide one.
@@ -481,7 +482,7 @@
   }
 #endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (arc::IsArcAllowedForProfile(profile_) &&
       !arc::IsArcAppSyncFlowDisabled()) {
     controllers.push_back(std::make_unique<ArcPackageSyncModelTypeController>(
@@ -542,7 +543,7 @@
           std::make_unique<ForwardingModelTypeControllerDelegate>(delegate)));
     }
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   return controllers;
 }
@@ -585,11 +586,11 @@
     case syncer::EXTENSIONS:
       return GetWeakPtrOrNull(ExtensionSyncService::Get(profile_));
 #endif  // BUILDFLAG(ENABLE_EXTENSIONS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::APP_LIST:
       return GetWeakPtrOrNull(
           app_list::AppListSyncableServiceFactory::GetForProfile(profile_));
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 #if !defined(OS_ANDROID)
     case syncer::THEMES:
       return ThemeServiceFactory::GetForProfile(profile_)->
@@ -614,7 +615,7 @@
           ->GetAllowlistService()
           ->AsWeakPtr();
 #endif  // BUILDFLAG(ENABLE_SUPERVISED_USERS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::ARC_PACKAGE:
       return arc::ArcPackageSyncableService::Get(profile_)->AsWeakPtr();
     case syncer::OS_PREFERENCES:
@@ -622,7 +623,7 @@
       return PrefServiceSyncableFromProfile(profile_)
           ->GetSyncableService(type)
           ->AsWeakPtr();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     default:
       NOTREACHED();
       return nullptr;
@@ -639,7 +640,7 @@
           ->change_processor()
           ->GetControllerDelegate();
     }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::PRINTERS:
       return chromeos::SyncedPrintersManagerFactory::GetForBrowserContext(
                  profile_)
@@ -650,7 +651,7 @@
       return WifiConfigurationSyncServiceFactory::GetForProfile(profile_,
                                                                 /*create=*/true)
           ->GetControllerDelegate();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::SHARING_MESSAGE:
       return SharingMessageBridgeFactory::GetForBrowserContext(profile_)
           ->GetControllerDelegate();
@@ -716,7 +717,7 @@
 std::unique_ptr<syncer::ModelTypeController>
 ChromeSyncClient::CreateAppsModelTypeController(
     syncer::SyncService* sync_service) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     return AppsModelTypeController::Create(
         GetModelTypeStoreService()->GetStoreFactory(),
@@ -733,7 +734,7 @@
 std::unique_ptr<syncer::ModelTypeController>
 ChromeSyncClient::CreateAppSettingsModelTypeController(
     syncer::SyncService* sync_service) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     return std::make_unique<AppSettingsModelTypeController>(
         GetModelTypeStoreService()->GetStoreFactory(),
@@ -755,7 +756,7 @@
     syncer::SyncService* sync_service) {
   syncer::ModelTypeControllerDelegate* delegate =
       GetControllerDelegateForModelType(syncer::WEB_APPS).get();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     // Use the same delegate in full-sync and transport-only modes.
     return std::make_unique<OsSyncModelTypeController>(
diff --git a/chrome/browser/sync/device_info_sync_service_factory.cc b/chrome/browser/sync/device_info_sync_service_factory.cc
index fe0450e..2eb956e 100644
--- a/chrome/browser/sync/device_info_sync_service_factory.cc
+++ b/chrome/browser/sync/device_info_sync_service_factory.cc
@@ -13,6 +13,7 @@
 #include "base/memory/singleton.h"
 #include "base/time/default_clock.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
@@ -42,12 +43,17 @@
   std::string GetSigninScopedDeviceId() const override {
 // Since the local sync backend is currently only supported on Windows, Mac and
 // Linux don't even check the pref on other os-es.
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+// TODO(crbug.com/1052397): Reassess whether the next block needs to be included
+// in lacros-chrome once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || defined(OS_MAC) || \
+    (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
     syncer::SyncPrefs prefs(profile_->GetPrefs());
     if (prefs.IsLocalSyncEnabled()) {
       return "local_device";
     }
-#endif  // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_MAC) || (defined(OS_LINUX) ||
+        // BUILDFLAG(IS_CHROMEOS_LACROS))
 
     return GetSigninScopedDeviceIdForProfile(profile_);
   }
diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc
index 3f95a01c..99de28f5 100644
--- a/chrome/browser/sync/profile_sync_service_factory.cc
+++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -13,6 +13,7 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/autofill/personal_data_manager_factory.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
 #include "chrome/browser/browser_process.h"
@@ -73,11 +74,11 @@
 #include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
 #endif  // BUILDFLAG(ENABLE_SUPERVISED_USERS)
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/printing/synced_printers_manager_factory.h"
 #include "chrome/browser/sync/wifi_configuration_sync_service_factory.h"
 #include "chromeos/constants/chromeos_features.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace {
 
@@ -166,10 +167,10 @@
   DependsOn(extensions::StorageFrontend::GetFactoryInstance());
   DependsOn(web_app::WebAppProviderFactory::GetInstance());
 #endif  // BUILDFLAG(ENABLE_EXTENSIONS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   DependsOn(chromeos::SyncedPrintersManagerFactory::GetInstance());
   DependsOn(WifiConfigurationSyncServiceFactory::GetInstance());
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() = default;
@@ -202,7 +203,12 @@
 
 // Only check the local sync backend pref on the supported platforms of
 // Windows, Mac and Linux.
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+// TODO(crbug.com/1052397): Reassess whether the following block needs to be
+// included
+// in lacros-chrome once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || defined(OS_MAC) || \
+    (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
   syncer::SyncPrefs prefs(profile->GetPrefs());
   local_sync_backend_enabled = prefs.IsLocalSyncEnabled();
   UMA_HISTOGRAM_BOOLEAN("Sync.Local.Enabled", local_sync_backend_enabled);
@@ -220,7 +226,8 @@
 
     init_params.start_behavior = syncer::ProfileSyncService::AUTO_START;
   }
-#endif  // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_MAC) || (defined(OS_LINUX) ||
+        // BUILDFLAG(IS_CHROMEOS_LACROS))
 
   if (!local_sync_backend_enabled) {
     // Always create the GCMProfileService instance such that we can listen to
@@ -250,7 +257,7 @@
     // need to take care that ProfileSyncService doesn't get tripped up between
     // those two cases. Bug 88109.
     bool is_auto_start = browser_defaults::kSyncAutoStarts;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     if (chromeos::features::IsSplitSettingsSyncEnabled())
       is_auto_start = false;
 #endif
diff --git a/chrome/browser/sync/profile_sync_service_factory_unittest.cc b/chrome/browser/sync/profile_sync_service_factory_unittest.cc
index 695bbf2..b9478d0 100644
--- a/chrome/browser/sync/profile_sync_service_factory_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_factory_unittest.cc
@@ -12,6 +12,7 @@
 #include "base/feature_list.h"
 #include "base/task/thread_pool/thread_pool_instance.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/favicon/favicon_service_factory.h"
 #include "chrome/browser/history/history_service_factory.h"
 #include "chrome/common/buildflags.h"
@@ -26,7 +27,7 @@
 #include "extensions/buildflags/buildflags.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/arc/arc_util.h"
 #include "chrome/browser/sync/wifi_configuration_sync_service_factory.h"
 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
@@ -41,9 +42,9 @@
 class ProfileSyncServiceFactoryTest : public testing::Test {
  public:
   void SetUp() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     app_list::AppListSyncableServiceFactory::SetUseInTesting(true);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     TestingProfile::Builder builder;
     builder.AddTestingFactory(FaviconServiceFactory::GetInstance(),
                               FaviconServiceFactory::GetDefaultFactory());
@@ -55,14 +56,14 @@
   }
 
   void TearDown() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     app_list::AppListSyncableServiceFactory::SetUseInTesting(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     base::ThreadPoolInstance::Get()->FlushForTesting();
   }
 
  protected:
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   ProfileSyncServiceFactoryTest() {
     // Fake network stack is required for WIFI_CONFIGURATIONS datatype.
     chromeos::NetworkHandler::Initialize();
@@ -111,7 +112,7 @@
     datatypes.push_back(syncer::DICTIONARY);
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     datatypes.push_back(syncer::APP_LIST);
     if (arc::IsArcAllowedForProfile(profile()))
       datatypes.push_back(syncer::ARC_PACKAGE);
@@ -123,7 +124,7 @@
     if (base::FeatureList::IsEnabled(switches::kSyncWifiConfigurations)) {
       datatypes.push_back(syncer::WIFI_CONFIGURATIONS);
     }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
     // Common types. This excludes PASSWORDS because the password store factory
     // is null for testing and hence no controller gets instantiated.
@@ -178,7 +179,7 @@
   content::BrowserTaskEnvironment task_environment_;
   std::unique_ptr<TestingProfile> profile_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Sets up  and  tears down the Chrome OS networking mojo service as needed
   // for the WIFI_CONFIGURATIONS sync service.
   chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index 872c5ac..8e1c59e 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -6,6 +6,7 @@
 
 #include <utility>
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
 #include "chrome/browser/signin/identity_manager_factory.h"
@@ -23,7 +24,7 @@
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "net/base/url_util.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -32,7 +33,7 @@
 namespace {
 
 StatusLabels GetStatusForUnrecoverableError(bool is_user_signout_allowed) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   int status_label_string_id =
       is_user_signout_allowed
           ? IDS_SYNC_STATUS_UNRECOVERABLE_ERROR
@@ -189,12 +190,12 @@
 bool HasUserOptedInToSync(const syncer::SyncUserSettings* settings) {
   if (settings->IsFirstSetupComplete())
     return true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled() &&
       settings->IsOsSyncFeatureEnabled()) {
     return true;
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   return false;
 }
 
diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc
index 2ab7568..dbff9d92 100644
--- a/chrome/browser/sync/sync_ui_util_unittest.cc
+++ b/chrome/browser/sync/sync_ui_util_unittest.cc
@@ -9,6 +9,7 @@
 #include <utility>
 
 #include "base/test/task_environment.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/grit/chromium_strings.h"
 #include "chrome/grit/generated_resources.h"
 #include "components/signin/public/identity_manager/identity_test_environment.h"
@@ -17,7 +18,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/test/scoped_feature_list.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -98,7 +99,7 @@
       service->SetDetailedSyncStatus(false, syncer::SyncStatus());
       return {
         SYNC_ERROR,
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
             IDS_SYNC_STATUS_UNRECOVERABLE_ERROR,
 #else
             IDS_SYNC_STATUS_UNRECOVERABLE_ERROR_NEEDS_SIGNOUT,
@@ -254,7 +255,7 @@
   EXPECT_THAT(GetStatusLabels(&service, environment.identity_manager(),
                               /*is_user_signout_allowed=*/true),
               StatusLabelsMatch(SYNC_ERROR,
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
                                 IDS_SYNC_STATUS_UNRECOVERABLE_ERROR,
 #else
                                 IDS_SYNC_STATUS_UNRECOVERABLE_ERROR_NEEDS_SIGNOUT,
@@ -357,9 +358,9 @@
 TEST(SyncUIUtilTest, ShouldShowPassphraseError_SyncDisabled) {
   syncer::TestSyncService service;
   service.SetFirstSetupComplete(false);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   service.GetUserSettings()->SetOsSyncFeatureEnabled(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   service.SetPassphraseRequiredForPreferredDataTypes(true);
   EXPECT_FALSE(ShouldShowPassphraseError(&service));
 }
@@ -371,7 +372,7 @@
   EXPECT_FALSE(ShouldShowPassphraseError(&service));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST(SyncUIUtilTest, ShouldShowPassphraseError_OsSyncEnabled) {
   base::test::ScopedFeatureList feature_list;
   feature_list.InitAndEnableFeature(chromeos::features::kSplitSettingsSync);
@@ -381,7 +382,7 @@
   service.GetUserSettings()->SetOsSyncFeatureEnabled(true);
   EXPECT_TRUE(ShouldShowPassphraseError(&service));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
diff --git a/chrome/browser/sync/test/integration/local_sync_test.cc b/chrome/browser/sync/test/integration/local_sync_test.cc
index 48c787e..e398906 100644
--- a/chrome/browser/sync/test/integration/local_sync_test.cc
+++ b/chrome/browser/sync/test/integration/local_sync_test.cc
@@ -9,6 +9,7 @@
 #include "base/macros.h"
 #include "build/branding_buildflags.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/send_tab_to_self/send_tab_to_self_util.h"
 #include "chrome/browser/sync/profile_sync_service_factory.h"
@@ -67,7 +68,11 @@
 };
 
 // The local sync backend is currently only supported on Windows, Mac and Linux.
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+// TODO(crbug.com/1052397): Reassess whether the following block needs to be
+// included in lacros-chrome once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || defined(OS_MAC) || \
+    (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
 IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) {
   ProfileSyncService* service =
       ProfileSyncServiceFactory::GetAsProfileSyncServiceForProfile(
@@ -97,7 +102,12 @@
       syncer::NIGORI);
 
   // The dictionary is currently only synced on Windows and Linux.
-#if defined(OS_WIN) || defined(OS_LINUX)
+  // TODO(crbug.com/1052397): Reassess whether the following block needs to be
+  // included
+  // in lacros-chrome once build flag switch of lacros-chrome is
+  // complete.
+
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
   expected_active_data_types.Put(syncer::DICTIONARY);
 #endif
 
@@ -111,6 +121,7 @@
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::SHARING_MESSAGE));
   EXPECT_FALSE(send_tab_to_self::IsUserSyncTypeActive(browser()->profile()));
 }
-#endif  // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_MAC) || (defined(OS_LINUX) ||
+        // BUILDFLAG(IS_CHROMEOS_LACROS))
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/password_manager_sync_test.cc b/chrome/browser/sync/test/integration/password_manager_sync_test.cc
index b8ea128..0edf9d3 100644
--- a/chrome/browser/sync/test/integration/password_manager_sync_test.cc
+++ b/chrome/browser/sync/test/integration/password_manager_sync_test.cc
@@ -13,6 +13,7 @@
 #include "base/test/scoped_feature_list.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
 #include "chrome/browser/password_manager/account_password_store_factory.h"
 #include "chrome/browser/password_manager/password_manager_test_base.h"
@@ -69,7 +70,7 @@
 
 // Note: This helper applies to ChromeOS too, but is currently unused there. So
 // define it out to prevent a compile error due to the unused function.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void GetNewTab(Browser* browser, content::WebContents** web_contents) {
   PasswordManagerBrowserTestBase::GetNewTab(browser, web_contents);
 }
@@ -108,7 +109,7 @@
   base::RunLoop run_loop_;
 };
 
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // This test fixture is similar to SingleClientPasswordsSyncTest, but it also
 // sets up all the necessary test hooks etc for PasswordManager code (like
@@ -368,7 +369,7 @@
   AccountInfo signed_in_account_;
 };
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(PasswordManagerSyncTest, ChooseDestinationStore) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
   content::WebContents* web_contents = nullptr;
@@ -968,6 +969,6 @@
   EXPECT_TRUE(waiter.WaitForPathToBeDeleted());
 }
 
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
index b290e6f..d9af26e5 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
@@ -15,6 +15,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/test/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/sync/profile_sync_service_factory.h"
@@ -240,7 +241,7 @@
                username_, sync_prefs.GetBirthday());
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void ProfileSyncServiceHarness::SignOutPrimaryAccount() {
   DCHECK(!username_.empty());
   signin::ClearPrimaryAccount(
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.h b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
index 93bde33..44d7d1d 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.h
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
@@ -12,6 +12,7 @@
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/optional.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/user_selectable_type.h"
 #include "components/sync/driver/profile_sync_service.h"
 #include "components/sync/engine/cycle/sync_cycle_snapshot.h"
@@ -52,7 +53,7 @@
   // This is similar to click the reset button on chrome.google.com/sync.
   void ResetSyncForPrimaryAccount();
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Signs out of the primary account. ChromeOS doesn't have the concept of
   // sign-out, so this only exists on other platforms.
   void SignOutPrimaryAccount();
diff --git a/chrome/browser/sync/test/integration/secondary_account_helper.cc b/chrome/browser/sync/test/integration/secondary_account_helper.cc
index 9802abc..b179d05 100644
--- a/chrome/browser/sync/test/integration/secondary_account_helper.cc
+++ b/chrome/browser/sync/test/integration/secondary_account_helper.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/sync/test/integration/secondary_account_helper.h"
 
 #include "base/bind.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/signin/chrome_signin_client_factory.h"
 #include "chrome/browser/signin/chrome_signin_client_test_util.h"
@@ -13,13 +14,13 @@
 #include "components/signin/public/identity_manager/identity_test_utils.h"
 #include "components/signin/public/identity_manager/primary_account_mutator.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
 #include "chromeos/network/network_handler.h"
 #include "chromeos/network/network_state.h"
 #include "chromeos/network/network_state_handler.h"
 #include "chromeos/network/portal_detector/network_portal_detector.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace secondary_account_helper {
 
@@ -42,7 +43,7 @@
           &OnWillCreateBrowserContextServices, test_url_loader_factory));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 void InitNetwork() {
   auto* portal_detector = new chromeos::NetworkPortalDetectorTestImpl();
 
@@ -60,7 +61,7 @@
   // Takes ownership.
   chromeos::network_portal_detector::InitializeForTesting(portal_detector);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 AccountInfo SignInSecondaryAccount(
     Profile* profile,
@@ -85,7 +86,7 @@
   signin::RemoveRefreshTokenForAccount(identity_manager, account_id);
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 void MakeAccountPrimary(Profile* profile, const std::string& email) {
   signin::IdentityManager* identity_manager =
       IdentityManagerFactory::GetForProfile(profile);
@@ -97,6 +98,6 @@
   auto* primary_account_mutator = identity_manager->GetPrimaryAccountMutator();
   primary_account_mutator->SetPrimaryAccount(maybe_account->account_id);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace secondary_account_helper
diff --git a/chrome/browser/sync/test/integration/secondary_account_helper.h b/chrome/browser/sync/test/integration/secondary_account_helper.h
index b938cc6..69500fc8 100644
--- a/chrome/browser/sync/test/integration/secondary_account_helper.h
+++ b/chrome/browser/sync/test/integration/secondary_account_helper.h
@@ -9,6 +9,7 @@
 #include <string>
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/signin/public/identity_manager/account_info.h"
 
@@ -28,7 +29,7 @@
 base::CallbackListSubscription SetUpSigninClient(
     network::TestURLLoaderFactory* test_url_loader_factory);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Sets up necessary fakes for fake network responses to work. Meant to be
 // called from SetUpOnMainThread.
 // TODO(crbug.com/882770): On ChromeOS, we need to set up a fake
@@ -37,7 +38,7 @@
 // the ListAccounts requests (i.e. getting cookie accounts) will never make it
 // far enough to even request our fake response.
 void InitNetwork();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Makes a non-primary account available with both a refresh token and cookie.
 AccountInfo SignInSecondaryAccount(
@@ -51,11 +52,11 @@
     network::TestURLLoaderFactory* test_url_loader_factory,
     const CoreAccountId& account_id);
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Makes the given account Chrome's primary one. The account must already be
 // signed in (per SignInSecondaryAccount).
 void MakeAccountPrimary(Profile* profile, const std::string& email);
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace secondary_account_helper
 
diff --git a/chrome/browser/sync/test/integration/single_client_app_settings_sync_test.cc b/chrome/browser/sync/test/integration/single_client_app_settings_sync_test.cc
index 8641514..35f2edd 100644
--- a/chrome/browser/sync/test/integration/single_client_app_settings_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_app_settings_sync_test.cc
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/user_selectable_type.h"
@@ -10,7 +11,7 @@
 #include "content/public/test/browser_test.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/os_sync_test.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -20,7 +21,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Chrome OS syncs apps as an OS type.
 class SingleClientAppSettingsOsSyncTest : public OsSyncTest {
  public:
@@ -43,7 +44,7 @@
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::APP_SETTINGS));
 }
 
-#else   // !defined(OS_CHROMEOS)
+#else   // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // See also TwoClientExtensionSettingsAndAppSettingsSyncTest.
 class SingleClientAppSettingsSyncTest : public SyncTest {
@@ -63,6 +64,6 @@
   EXPECT_FALSE(settings->GetSelectedTypes().Has(UserSelectableType::kApps));
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::APP_SETTINGS));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc
index d4f252c..926e2177 100644
--- a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc
@@ -9,6 +9,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/metrics/histogram_tester.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
@@ -919,11 +920,11 @@
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
   ASSERT_EQ(1u, GetBookmarkBarNode(kSingleProfileIndex)->children().size());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization());
 
   // After restart, the last sync cycle snapshot should be empty.
@@ -1306,11 +1307,11 @@
   ASSERT_FALSE(node->is_favicon_loading());
   ASSERT_FALSE(node->is_favicon_loaded());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->StartSyncService());
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization());
   ASSERT_TRUE(bookmarks_helper::ServerBookmarksEqualityChecker(
@@ -1340,11 +1341,11 @@
 
   base::HistogramTester histogram_tester;
   ASSERT_TRUE(SetupClients());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization());
 
   // Make sure the favicon gets loaded.
@@ -1430,11 +1431,11 @@
                    .bookmark()
                    .has_full_title());
   ASSERT_TRUE(SetupClients());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization());
   ASSERT_TRUE(
       BookmarkFaviconLoadedChecker(kSingleProfileIndex, GURL(kBookmarkPageUrl))
@@ -1482,11 +1483,11 @@
                    .has_full_title());
 
   ASSERT_TRUE(SetupClients());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization());
   ASSERT_TRUE(
       BookmarkFaviconLoadedChecker(kSingleProfileIndex, GURL(kBookmarkPageUrl))
diff --git a/chrome/browser/sync/test/integration/single_client_device_info_sync_test.cc b/chrome/browser/sync/test/integration/single_client_device_info_sync_test.cc
index ff4bb9f..d5347f0 100644
--- a/chrome/browser/sync/test/integration/single_client_device_info_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_device_info_sync_test.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/device_info_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
@@ -120,12 +121,12 @@
                        CommitLocalDevice_TransportOnly) {
   ASSERT_TRUE(SetupClients());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On ChromeOS, Sync-the-feature gets started automatically once a primary
   // account is signed in. To prevent that, explicitly set SyncRequested to
   // false.
   GetSyncService(0)->GetUserSettings()->SetSyncRequested(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Setup a primary account, but don't actually enable Sync-the-feature (so
   // that Sync will start in transport mode).
@@ -149,12 +150,12 @@
 
   ASSERT_TRUE(SetupClients());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On ChromeOS, Sync-the-feature gets started automatically once a primary
   // account is signed in. To prevent that, explicitly set SyncRequested to
   // false.
   GetSyncService(0)->GetUserSettings()->SetSyncRequested(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Setup a primary account, but don't actually enable Sync-the-feature (so
   // that Sync will start in transport mode).
diff --git a/chrome/browser/sync/test/integration/single_client_extension_apps_sync_test.cc b/chrome/browser/sync/test/integration/single_client_extension_apps_sync_test.cc
index 16f5075..a182bf2d 100644
--- a/chrome/browser/sync/test/integration/single_client_extension_apps_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_extension_apps_sync_test.cc
@@ -3,13 +3,14 @@
 // found in the LICENSE file.
 
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/apps_helper.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
 #include "components/sync/driver/profile_sync_service.h"
 #include "content/public/test/browser_test.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/os_sync_test.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -114,7 +115,7 @@
   ASSERT_TRUE(AllProfilesHaveSameApps());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Tests for SplitSettingsSync.
 class SingleClientExtensionAppsOsSyncTest : public OsSyncTest {
@@ -142,4 +143,4 @@
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::APPS));
 }
 
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc b/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc
index e6cc70bd..d788396 100644
--- a/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc
@@ -14,6 +14,7 @@
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/sync_ui_util.h"
 #include "chrome/browser/sync/test/integration/cookie_helper.h"
 #include "chrome/browser/sync/test/integration/encryption_helper.h"
@@ -503,11 +504,11 @@
   ASSERT_FALSE(GetSyncService(0)->GetActiveDataTypes().Has(syncer::PASSWORDS));
   ASSERT_TRUE(sync_ui_util::ShouldShowSyncKeysMissingError(GetSyncService(0)));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Verify the profile-menu error string.
   ASSERT_EQ(sync_ui_util::TRUSTED_VAULT_KEY_MISSING_FOR_PASSWORDS_ERROR,
             sync_ui_util::GetAvatarSyncErrorType(GetProfile(0)));
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Verify the string that would be displayed in settings.
   ASSERT_THAT(sync_ui_util::GetStatusLabels(GetProfile(0)),
@@ -543,11 +544,11 @@
       StatusLabelsMatch(sync_ui_util::SYNCED, IDS_SYNC_ACCOUNT_SYNCING,
                         IDS_SETTINGS_EMPTY_STRING, sync_ui_util::NO_ACTION));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Verify the profile-menu error string is empty.
   EXPECT_EQ(sync_ui_util::NO_SYNC_ERROR,
             sync_ui_util::GetAvatarSyncErrorType(GetProfile(0)));
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 IN_PROC_BROWSER_TEST_F(SingleClientNigoriWithWebApiTest,
@@ -604,11 +605,11 @@
       StatusLabelsMatch(sync_ui_util::SYNCED, IDS_SYNC_ACCOUNT_SYNCING,
                         IDS_SETTINGS_EMPTY_STRING, sync_ui_util::NO_ACTION));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Verify the profile-menu error string is empty.
   EXPECT_EQ(sync_ui_util::NO_SYNC_ERROR,
             sync_ui_util::GetAvatarSyncErrorType(GetProfile(0)));
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 IN_PROC_BROWSER_TEST_F(
@@ -985,12 +986,12 @@
   EXPECT_TRUE(sync_ui_util::ShouldShowTrustedVaultDegradedRecoverabilityError(
       GetSyncService(0)));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Verify the profile-menu error string is empty.
   EXPECT_EQ(
       sync_ui_util::TRUSTED_VAULT_RECOVERABILITY_DEGRADED_FOR_PASSWORDS_ERROR,
       sync_ui_util::GetAvatarSyncErrorType(GetProfile(0)));
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   // No messages expected in settings.
   EXPECT_THAT(
@@ -1015,11 +1016,11 @@
   EXPECT_FALSE(sync_ui_util::ShouldShowTrustedVaultDegradedRecoverabilityError(
       GetSyncService(0)));
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // Verify the profile-menu error string is empty.
   EXPECT_EQ(sync_ui_util::NO_SYNC_ERROR,
             sync_ui_util::GetAvatarSyncErrorType(GetProfile(0)));
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_offer_sync_test.cc b/chrome/browser/sync/test/integration/single_client_offer_sync_test.cc
index 2af7a58..9610ea1 100644
--- a/chrome/browser/sync/test/integration/single_client_offer_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_offer_sync_test.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/autofill_helper.h"
 #include "chrome/browser/sync/test/integration/offer_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
@@ -149,7 +150,7 @@
 }
 
 // ChromeOS does not sign out, so the test below does not apply.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Offer data should get cleared from the database when the user signs out.
 IN_PROC_BROWSER_TEST_F(SingleClientOfferSyncTest, ClearOnSignOut) {
   GetFakeServer()->SetOfferData({CreateDefaultSyncCardLinkedOffer()});
@@ -164,7 +165,7 @@
   WaitForNumberOfOffers(0, pdm);
   EXPECT_EQ(0uL, pdm->GetCreditCardOffers().size());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Offer is not using incremental updates. Make sure existing data gets
 // replaced when synced down.
diff --git a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc
index b4a9d463..43d8586 100644
--- a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc
@@ -4,6 +4,7 @@
 
 #include "base/macros.h"
 #include "base/test/metrics/histogram_tester.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/sync/test/integration/encryption_helper.h"
 #include "chrome/browser/sync/test/integration/passwords_helper.h"
@@ -197,11 +198,11 @@
   base::HistogramTester histogram_tester;
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
   ASSERT_EQ(1, GetPasswordCount(0));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(0)->AwaitEngineInitialization());
 
   // After restart, the last sync cycle snapshot should be empty. Once a sync
@@ -236,9 +237,9 @@
   }
 
   void SetUpOnMainThread() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     secondary_account_helper::InitNetwork();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     SyncTest::SetUpOnMainThread();
 
     fake_server::SetKeystoreNigoriInFakeServer(GetFakeServer());
@@ -302,12 +303,12 @@
 
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On ChromeOS, Sync-the-feature gets started automatically once a primary
   // account is signed in. To prevent that, explicitly set SyncRequested to
   // false.
   GetSyncService(0)->GetUserSettings()->SetSyncRequested(false);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Setup a primary account, but don't actually enable Sync-the-feature (so
   // that Sync will start in transport mode).
@@ -335,7 +336,7 @@
 // The unconsented primary account isn't supported on ChromeOS (see
 // IdentityManager::ComputeUnconsentedPrimaryAccountInfo()) so Sync won't start
 // up for a secondary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
                        StoresDataForSecondaryAccountInAccountDB) {
   AddTestPasswordToFakeServer();
@@ -364,10 +365,10 @@
       passwords_helper::GetAccountPasswordStore(0);
   EXPECT_EQ(passwords_helper::GetAllLogins(account_store).size(), 1u);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // ChromeOS does not support signing out of a primary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Sanity check: The profile database should *not* get cleared on signout.
 IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
                        DoesNotClearProfileDBOnSignout) {
@@ -396,12 +397,12 @@
   // Make sure the password is still in the store.
   ASSERT_EQ(passwords_helper::GetAllLogins(profile_store).size(), 1u);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // The unconsented primary account isn't supported on ChromeOS (see
 // IdentityManager::ComputeUnconsentedPrimaryAccountInfo()) so Sync won't start
 // up for a secondary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
                        ClearsAccountDBOnSignout) {
   AddTestPasswordToFakeServer();
@@ -431,7 +432,7 @@
   // Make sure the password is gone from the store.
   ASSERT_EQ(passwords_helper::GetAllLogins(account_store).size(), 0u);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
                        SwitchesStoresOnEnablingSync) {
@@ -442,9 +443,9 @@
   // On ChromeOS, Sync-the-feature starts automatically as soon as a primary
   // account is signed in. To prevent that, explicitly set SyncRequested to
   // false on ChromeOS.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   GetSyncService(0)->GetUserSettings()->SetSyncRequested(false);
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Sign in to a primary account, but don't enable Sync-the-feature.
   // Note: This state shouldn't actually be reachable (the flow for setting a
@@ -493,7 +494,7 @@
 // The unconsented primary account isn't supported on ChromeOS (see
 // IdentityManager::ComputeUnconsentedPrimaryAccountInfo()) so Sync won't start
 // up for a secondary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
                        SwitchesStoresOnMakingAccountPrimary) {
   AddTestPasswordToFakeServer();
@@ -579,6 +580,6 @@
   // Now password sync should be active.
   EXPECT_TRUE(GetSyncService(0)->GetActiveDataTypes().Has(syncer::PASSWORDS));
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc b/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc
index 41253b02..2ab3ac5 100644
--- a/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc
@@ -5,6 +5,7 @@
 #include "base/macros.h"
 #include "base/run_loop.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/session_hierarchy_match_checker.h"
 #include "chrome/browser/sync/test/integration/sessions_helper.h"
@@ -127,11 +128,11 @@
 IN_PROC_BROWSER_TEST_F(SingleClientPollingSyncTest,
                        ShouldPollWhenIntervalExpiredAcrossRestarts) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(0)->AwaitEngineInitialization());
 
   SyncPrefs remote_prefs(GetProfile(0)->GetPrefs());
diff --git a/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc
index 4875f69d..6c0f4c5 100644
--- a/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc
@@ -9,6 +9,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/preferences_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
@@ -162,11 +163,11 @@
 
   base::HistogramTester histogram_tester;
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // signin::SetRefreshTokenForPrimaryAccount() is needed on ChromeOS in order
   // to get a non-empty refresh token on startup.
   GetClient(0)->SignInPrimaryAccount();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_TRUE(GetClient(0)->AwaitEngineInitialization());
 
   // After restart, the last sync cycle snapshot should be empty.
diff --git a/chrome/browser/sync/test/integration/single_client_secondary_account_sync_test.cc b/chrome/browser/sync/test/integration/single_client_secondary_account_sync_test.cc
index 6c37574..ad4da8f 100644
--- a/chrome/browser/sync/test/integration/single_client_secondary_account_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_secondary_account_sync_test.cc
@@ -9,6 +9,7 @@
 #include "base/test/scoped_feature_list.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/defaults.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
@@ -23,7 +24,7 @@
 
 namespace {
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 syncer::ModelTypeSet AllowedTypesInStandaloneTransportMode() {
   // Only some special whitelisted types (and control types) are allowed in
   // standalone transport mode.
@@ -39,7 +40,7 @@
   base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
   return user_data_path.AppendASCII("SyncTestTmpCacheGuid");
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 class SingleClientSecondaryAccountSyncTest : public SyncTest {
  public:
@@ -52,9 +53,9 @@
   }
 
   void SetUpOnMainThread() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     secondary_account_helper::InitNetwork();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     SyncTest::SetUpOnMainThread();
   }
 
@@ -70,7 +71,7 @@
 
 // The unconsented primary account (aka secondary account) isn't supported on
 // ChromeOS, see IdentityManager::ComputeUnconsentedPrimaryAccountInfo().
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
                        StartsSyncTransportOnSignin) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
@@ -115,11 +116,11 @@
   EXPECT_EQ(syncer::SyncService::TransportState::DISABLED,
             GetSyncService(0)->GetTransportState());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // ChromeOS doesn't support changes to the primary account after startup, so
 // this test doesn't apply.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
                        SwitchesFromTransportToFeature) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
@@ -153,7 +154,7 @@
       syncer::UserSelectableType::kBookmarks));
   EXPECT_TRUE(GetSyncService(0)->GetActiveDataTypes().Has(syncer::BOOKMARKS));
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Regression test for crbug.com/955989 that verifies the cache GUID is not
 // reset upon restart of the browser, in standalone transport mode with
@@ -161,7 +162,7 @@
 //
 // The unconsented primary account (aka secondary account) isn't supported on
 // ChromeOS, see IdentityManager::ComputeUnconsentedPrimaryAccountInfo().
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
                        PRE_ReusesSameCacheGuid) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
@@ -185,11 +186,11 @@
   ASSERT_NE(-1, base::WriteFile(GetTestFilePathForCacheGuid(),
                                 cache_guid.c_str(), cache_guid.size()));
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // The unconsented primary account (aka secondary account) isn't supported on
 // ChromeOS, see IdentityManager::ComputeUnconsentedPrimaryAccountInfo().
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
                        ReusesSameCacheGuid) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
@@ -212,6 +213,6 @@
 
   EXPECT_EQ(old_cache_guid, prefs.GetCacheGuid());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
index a9a9f10b..ed68dec 100644
--- a/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
@@ -5,6 +5,7 @@
 #include <vector>
 
 #include "base/test/mock_callback.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sharing/features.h"
 #include "chrome/browser/sharing/sharing_message_bridge.h"
 #include "chrome/browser/sharing/sharing_message_bridge_factory.h"
@@ -240,7 +241,7 @@
 
 // ChromeOS does not support late signin after profile creation, so the test
 // below does not apply, at least in the current form.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
                        ShouldSubmitInTransportMode) {
   // We avoid calling SetupSync(), because we don't want to turn on full sync,
@@ -270,7 +271,7 @@
   EXPECT_TRUE(WaitForSharingMessage({specifics}));
   EXPECT_TRUE(callback_checker.Wait());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
                        ShouldPropagateCommitFailure) {
diff --git a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
index a4526f4..5f711b8 100644
--- a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
@@ -9,6 +9,7 @@
 #include "base/test/scoped_feature_list.h"
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/defaults.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
@@ -20,7 +21,7 @@
 #include "components/sync/driver/sync_driver_switches.h"
 #include "content/public/test/browser_test.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/os_sync_test.h"
 #include "chromeos/constants/chromeos_features.h"
 #include "components/browser_sync/browser_sync_switches.h"
@@ -37,7 +38,7 @@
       syncer::DEVICE_INFO, syncer::USER_CONSENTS, syncer::SECURITY_EVENTS,
       syncer::AUTOFILL_WALLET_DATA, syncer::SHARING_MESSAGE);
   allowed_types.PutAll(syncer::ControlTypes());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // OS sync types run in transport mode.
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     allowed_types.PutAll({syncer::APPS, syncer::APP_SETTINGS, syncer::APP_LIST,
@@ -48,7 +49,7 @@
   if (base::FeatureList::IsEnabled(switches::kSyncWifiConfigurations)) {
     allowed_types.Put(syncer::WIFI_CONFIGURATIONS);
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   return allowed_types;
 }
 
@@ -78,7 +79,7 @@
 
 IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
                        StartsSyncTransportOnSignin) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On Chrome OS before SplitSettingSync, sync auto-starts on sign-in.
   if (!chromeos::features::IsSplitSettingsSyncEnabled())
     return;
@@ -190,7 +191,7 @@
   EXPECT_TRUE(GetSyncService(0)->HasDisableReason(
       syncer::SyncService::DISABLE_REASON_USER_CHOICE));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // On ChromeOS, the primary account should remain, and Sync should start up
   // again in standalone transport mode.
   EXPECT_TRUE(GetSyncService(0)->IsAuthenticatedAccountPrimary());
@@ -212,7 +213,7 @@
   // account, and so Sync would start up again in standalone transport mode.
   // However, since we haven't set up cookies in this test, the account is *not*
   // considered primary anymore (not even "unconsented").
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 // Regression test for crbug.com/955989 that verifies the cache GUID is not
@@ -229,10 +230,10 @@
   // On platforms where Sync starts automatically (in practice, Android and
   // ChromeOS), IsFirstSetupComplete gets set automatically, and so the full
   // Sync feature will start upon sign-in to a primary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_FALSE(GetSyncService(0)->GetUserSettings()->IsFirstSetupComplete());
   ASSERT_FALSE(GetSyncService(0)->IsSyncFeatureEnabled());
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   syncer::SyncPrefs prefs(GetProfile(0)->GetPrefs());
   const std::string cache_guid = prefs.GetCacheGuid();
@@ -258,10 +259,10 @@
   // On platforms where Sync starts automatically (in practice, Android and
   // ChromeOS), IsFirstSetupComplete gets set automatically, and so the full
   // Sync feature will start upon sign-in to a primary account.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   ASSERT_FALSE(GetSyncService(0)->GetUserSettings()->IsFirstSetupComplete());
   ASSERT_FALSE(GetSyncService(0)->IsSyncFeatureEnabled());
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
   syncer::SyncPrefs prefs(GetProfile(0)->GetPrefs());
   ASSERT_FALSE(prefs.GetCacheGuid().empty());
@@ -275,7 +276,7 @@
   EXPECT_EQ(old_cache_guid, prefs.GetCacheGuid());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 class SingleClientStandaloneTransportOsSyncTest : public OsSyncTest {
  public:
   SingleClientStandaloneTransportOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
@@ -359,6 +360,6 @@
   EXPECT_TRUE(active_types.Has(syncer::SESSIONS));
   EXPECT_TRUE(active_types.Has(syncer::TYPED_URLS));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_sync_invalidations_test.cc b/chrome/browser/sync/test/integration/single_client_sync_invalidations_test.cc
index aaf48dfc..55de306 100644
--- a/chrome/browser/sync/test/integration/single_client_sync_invalidations_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_sync_invalidations_test.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/test/scoped_feature_list.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/sync_invalidations_service_factory.h"
 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
 #include "chrome/browser/sync/test/integration/device_info_helper.h"
@@ -265,7 +266,7 @@
 }
 
 // ChromeOS doesn't have the concept of sign-out.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(
     SingleClientWithUseSyncInvalidationsForWalletAndOfferTest,
     SignoutAndSignin) {
diff --git a/chrome/browser/sync/test/integration/single_client_user_consents_sync_test.cc b/chrome/browser/sync/test/integration/single_client_user_consents_sync_test.cc
index 69dfa3b..8649004 100644
--- a/chrome/browser/sync/test/integration/single_client_user_consents_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_user_consents_sync_test.cc
@@ -5,6 +5,7 @@
 #include <stdint.h>
 
 #include "base/macros.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/consent_auditor/consent_auditor_factory.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
@@ -176,7 +177,7 @@
 
 // ChromeOS does not support late signin after profile creation, so the test
 // below does not apply, at least in the current form.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientUserConsentsSyncTest,
                        ShouldSubmitIfSignedInAlthoughFullSyncNotEnabled) {
   // We avoid calling SetupSync(), because we don't want to turn on full sync,
@@ -208,6 +209,6 @@
   specifics.set_account_id(GetAccountId().ToString());
   EXPECT_TRUE(ExpectUserConsents({specifics}));
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
index 896f3038..b8116d600 100644
--- a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
@@ -7,6 +7,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/autofill_helper.h"
 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
@@ -128,7 +129,7 @@
   return std::move(consumer.result());
 }
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 std::unique_ptr<autofill::PaymentsCustomerData> GetPaymentsCustomerData(
     scoped_refptr<autofill::AutofillWebDataService> service) {
   AutofillWebDataServiceConsumer<
@@ -279,7 +280,7 @@
 
 // ChromeOS does not support late signin after profile creation, so the test
 // below does not apply, at least in the current form.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest,
                        DownloadAccountStorage_Card) {
   ASSERT_TRUE(SetupClients());
@@ -391,7 +392,7 @@
   ASSERT_EQ(1uL, pdm->GetCreditCardCloudTokenData().size());
   EXPECT_EQ("data-2", pdm->GetCreditCardCloudTokenData()[0]->instrument_token);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, EnabledByDefault) {
   ASSERT_TRUE(SetupSync());
@@ -495,7 +496,7 @@
 }
 
 // ChromeOS does not sign out, so the test below does not apply.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 // Wallet data should get cleared from the database when the user signs out.
 IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnSignOut) {
   GetFakeServer()->SetWalletData({CreateDefaultSyncWalletAddress(),
@@ -526,7 +527,7 @@
   EXPECT_EQ(0U, GetServerCardsMetadata(0).size());
   EXPECT_EQ(0U, GetServerAddressesMetadata(0).size());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Wallet is not using incremental updates. Make sure existing data gets
 // replaced when synced down.
@@ -1208,9 +1209,9 @@
   }
 
   void SetUpOnMainThread() override {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     secondary_account_helper::InitNetwork();
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
     SyncTest::SetUpOnMainThread();
   }
 
@@ -1226,7 +1227,7 @@
 
 // ChromeOS doesn't support changes to the primary account after startup, so
 // these secondary-account-related tests don't apply.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 IN_PROC_BROWSER_TEST_F(SingleClientWalletSecondaryAccountSyncTest,
                        SwitchesFromAccountToProfileStorageOnSyncOptIn) {
   ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
@@ -1370,7 +1371,7 @@
   EXPECT_EQ(0U, GetCreditCardCloudTokenData(account_data).size());
   EXPECT_EQ(1U, GetCreditCardCloudTokenData(profile_data).size());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // This tests that switching between Sync-the-feature and
 // Sync-standalone-transport properly migrates server credit cards between the
diff --git a/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc b/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc
index c4ba770..004caf6 100644
--- a/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/user_selectable_type.h"
@@ -10,7 +11,7 @@
 #include "content/public/test/browser_test.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/os_sync_test.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -20,7 +21,7 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 // These tests test the new Web Apps system with next generation sync.
 //
@@ -46,7 +47,7 @@
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::WEB_APPS));
 }
 
-#else   // !defined(OS_CHROMEOS)
+#else   // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // These tests test the new Web Apps system with next generation sync.
 class SingleClientWebAppsSyncTest : public SyncTest {
@@ -67,6 +68,6 @@
   ASSERT_FALSE(settings->GetSelectedTypes().Has(UserSelectableType::kApps));
   EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::WEB_APPS));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc
index 7bf5276..e01c09f 100644
--- a/chrome/browser/sync/test/integration/sync_errors_test.cc
+++ b/chrome/browser/sync/test/integration/sync_errors_test.cc
@@ -5,6 +5,7 @@
 #include "base/macros.h"
 #include "base/test/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/session_hierarchy_match_checker.h"
@@ -173,7 +174,7 @@
 // This test verifies that sync keeps retrying if it encounters error during
 // setup.
 // crbug.com/689662
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #define MAYBE_ErrorWhileSettingUp DISABLED_ErrorWhileSettingUp
 #else
 #define MAYBE_ErrorWhileSettingUp ErrorWhileSettingUp
@@ -181,7 +182,7 @@
 IN_PROC_BROWSER_TEST_F(SyncErrorTest, MAYBE_ErrorWhileSettingUp) {
   ASSERT_TRUE(SetupClients());
 
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   // On non auto start enabled environments if the setup sync fails then
   // the setup would fail. So setup sync normally.
   // In contrast on auto start enabled platforms like chrome os we should be
@@ -194,7 +195,7 @@
   GetFakeServer()->TriggerError(sync_pb::SyncEnums::TRANSIENT_ERROR);
   EXPECT_TRUE(GetFakeServer()->EnableAlternatingTriggeredErrors());
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Now setup sync and it should succeed.
   ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
 #else
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 03b009af..6845370 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -21,6 +21,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_process_platform_part.h"
@@ -81,7 +82,7 @@
 #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/printers_helper.h"
 #include "chrome/browser/sync/test/integration/sync_arc_package_helper.h"
 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
@@ -91,7 +92,7 @@
 #include "chromeos/constants/chromeos_features.h"
 #include "chromeos/constants/chromeos_switches.h"
 #include "components/arc/arc_util.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if defined(OS_ANDROID)
 #include "chrome/browser/sync/test/integration/sync_test_utils_android.h"
@@ -124,13 +125,13 @@
       ChromeSigninClientFactory::GetForProfile(profile));
   signin_client->SetURLLoaderFactoryForTest(url_loader_factory);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   chromeos::AccountManagerFactory* factory =
       g_browser_process->platform_part()->GetAccountManagerFactory();
   chromeos::AccountManager* account_manager =
       factory->GetAccountManager(profile->GetPath().value());
   account_manager->SetUrlLoaderFactoryForTests(url_loader_factory);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 class FakePerUserTopicSubscriptionManager
@@ -388,7 +389,7 @@
 void SyncTest::SetUpCommandLine(base::CommandLine* cl) {
   AddTestSwitches(cl);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   cl->AppendSwitch(chromeos::switches::kIgnoreUserProfileMappingForTests);
   cl->AppendSwitch(chromeos::switches::kDisableArcOptInVerification);
   arc::SetArcAvailableCommandLineForTesting(cl);
@@ -645,7 +646,7 @@
     cl->AppendSwitchASCII(switches::kSyncDeferredStartupTimeoutSeconds, "1");
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // ARC_PACKAGE do not support supervised users, switches::kSupervisedUserId
   // need to be set in SetUpCommandLine() when a test will use supervise users.
   if (!cl->HasSwitch(switches::kSupervisedUserId)) {
@@ -691,7 +692,7 @@
     WaitForDataModels(verifier());
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // SplitSettingsSync makes several types (e.g. APPS, APP_LIST, PRINTERS) into
   // OS sync types. OS sync is on-by-default, so enable it here.
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
@@ -1200,7 +1201,7 @@
   bookmarks::test::WaitForBookmarkModelToLoad(
       BookmarkModelFactory::GetForBrowserContext(profile));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   printers_helper::WaitForPrinterStoreToLoad(profile);
 #endif
 }
@@ -1332,7 +1333,7 @@
 }
 
 arc::SyncArcPackageHelper* SyncTest::sync_arc_helper() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return arc::SyncArcPackageHelper::GetInstance();
 #else
   return nullptr;
diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h
index d6c6f2b..dfd4db3 100644
--- a/chrome/browser/sync/test/integration/sync_test.h
+++ b/chrome/browser/sync/test/integration/sync_test.h
@@ -16,6 +16,7 @@
 #include "base/time/time.h"
 #include "build/build_config.h"
 #include "build/buildflag.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/test/integration/configuration_refresher.h"
 #include "chrome/browser/sync/test/integration/fake_server_invalidation_sender.h"
@@ -31,9 +32,9 @@
 #include "net/http/http_status_code.h"
 #include "services/network/test/test_url_loader_factory.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if defined(OS_ANDROID)
 #include "chrome/test/base/android/android_browser_test.h"
@@ -523,7 +524,7 @@
   extensions::ScopedInstallVerifierBypassForTest ignore_install_verification_;
 #endif
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // A factory-like callback to create a model updater for testing, which will
   // take the place of the real updater in AppListSyncableService for testing.
   std::unique_ptr<
diff --git a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc
index 9812b3f..9b868d69 100644
--- a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc
@@ -4,6 +4,7 @@
 
 #include "base/macros.h"
 #include "base/strings/stringprintf.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/test/integration/apps_helper.h"
 #include "chrome/browser/sync/test/integration/extension_settings_helper.h"
@@ -13,7 +14,7 @@
 #include "chrome/browser/sync/test/integration/sync_test.h"
 #include "content/public/test/browser_test.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chrome/browser/sync/test/integration/os_sync_test.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -219,7 +220,7 @@
       InstallHostedAppForAllProfiles(1), InstallHostedAppForAllProfiles(2));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Tests for SplitSettingsSync, which uses a different ModelTypeController for
 // syncer::APP_SETTINGS.
 class TwoClientAppSettingsOsSyncTest : public OsSyncTest {
@@ -250,6 +251,6 @@
       StartWithDifferentSettingsTest, InstallHostedAppForAllProfiles(0),
       InstallHostedAppForAllProfiles(1), InstallHostedAppForAllProfiles(2));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
diff --git a/chrome/browser/sync/test/integration/two_client_web_apps_bmo_sync_test.cc b/chrome/browser/sync/test/integration/two_client_web_apps_bmo_sync_test.cc
index a42ef7c4..27bc6b4d0 100644
--- a/chrome/browser/sync/test/integration/two_client_web_apps_bmo_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_web_apps_bmo_sync_test.cc
@@ -7,6 +7,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/bind.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/installable/installable_metrics.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
@@ -596,7 +597,7 @@
     base::RunLoop loop;
     base::RepeatingCallback<void(const AppId&)> on_installed_closure;
     base::RepeatingCallback<void(const AppId&)> on_hooks_closure;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     on_installed_closure = base::DoNothing();
     on_hooks_closure = base::BindLambdaForTesting(
         [&](const AppId& installed_app_id) { loop.Quit(); });
@@ -615,7 +616,7 @@
   }
   EXPECT_EQ(
       1u, GetOsIntegrationManager(GetProfile(0)).num_create_shortcuts_calls());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   auto last_options =
       GetOsIntegrationManager(GetProfile(1)).get_last_install_options();
   EXPECT_TRUE(last_options.has_value());
diff --git a/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc
index bb01ff0..ebeb6ae 100644
--- a/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc
@@ -6,6 +6,7 @@
 #include "base/macros.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/bind.h"
+#include "build/chromeos_buildflags.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/installable/installable_metrics.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
@@ -149,7 +150,7 @@
   EXPECT_EQ(WebAppInstallObserver(GetProfile(1)).AwaitNextInstall(), app_id);
   bool is_locally_installed =
       GetRegistrar(GetProfile(1)).IsLocallyInstalled(app_id);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   EXPECT_TRUE(is_locally_installed);
 #else
   EXPECT_FALSE(is_locally_installed);
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 7d75dc5..27d675c 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -3531,6 +3531,8 @@
       "views/desktop_capture/desktop_media_source_view.h",
       "views/desktop_capture/desktop_media_tab_list.cc",
       "views/desktop_capture/desktop_media_tab_list.h",
+      "views/desktop_capture/get_current_browsing_context_media_dialog.cc",
+      "views/desktop_capture/get_current_browsing_context_media_dialog.h",
       "views/device_chooser_content_view.cc",
       "views/device_chooser_content_view.h",
       "views/devtools_process_observer.cc",
diff --git a/chrome/browser/ui/ash/system_tray_client_browsertest.cc b/chrome/browser/ui/ash/system_tray_client_browsertest.cc
index 34b433a..d369dd68 100644
--- a/chrome/browser/ui/ash/system_tray_client_browsertest.cc
+++ b/chrome/browser/ui/ash/system_tray_client_browsertest.cc
@@ -34,6 +34,7 @@
 #include "content/public/test/browser_test.h"
 #include "content/public/test/test_utils.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 #include "url/gurl.h"
 
 using chromeos::ProfileHelper;
@@ -51,11 +52,13 @@
   if (ash::features::IsManagedDeviceUIRedesignEnabled()) {
     // The text shows the domain.
     EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+                                         ui::GetChromeOSDeviceName(),
                                          base::UTF8ToUTF16("example.com")),
               test_api->GetBubbleViewText(ash::VIEW_ID_TRAY_ENTERPRISE_LABEL));
   } else {
     // The tooltip shows the domain.
     EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+                                         ui::GetChromeOSDeviceName(),
                                          base::UTF8ToUTF16("example.com")),
               test_api->GetBubbleViewTooltip(ash::VIEW_ID_TRAY_ENTERPRISE));
   }
diff --git a/chrome/browser/ui/browser_dialogs.h b/chrome/browser/ui/browser_dialogs.h
index c95dcf7..bceac0e3 100644
--- a/chrome/browser/ui/browser_dialogs.h
+++ b/chrome/browser/ui/browser_dialogs.h
@@ -295,6 +295,7 @@
   CROSTINI_RECOVERY = 103,
   PARENT_PERMISSION = 104,  // ChromeOS only.
   SIGNIN_REAUTH = 105,
+  CURRENT_BROWSING_CONTEXT_CONFIRMATION_BOX = 106,
   // Add values above this line with a corresponding label in
   // tools/metrics/histograms/enums.xml
   MAX_VALUE
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
index 5a97d615..d69bec5b 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
@@ -7,6 +7,7 @@
 #include "chrome/browser/themes/theme_service_aura_linux.h"
 #include "chrome/browser/ui/browser_list.h"
 #include "chrome/browser/ui/views/theme_profile_key.h"
+#include "ui/base/ime/linux/fake_input_method_context_factory.h"
 #include "ui/display/screen.h"
 #include "ui/views/linux_ui/linux_ui.h"
 
@@ -17,6 +18,9 @@
 
 #if defined(USE_OZONE)
 #include "ui/base/cursor/cursor_factory.h"
+#include "ui/base/ime/input_method.h"
+#include "ui/base/ui_base_features.h"
+#include "ui/ozone/public/ozone_platform.h"
 #endif
 
 #if defined(USE_X11)
@@ -68,8 +72,25 @@
   ChromeBrowserMainExtraPartsViews::ToolkitInitialized();
 
   views::LinuxUI* linux_ui = BuildLinuxUI();
-  if (!linux_ui)
+  if (!linux_ui) {
+    // In case if GTK is not used, input method factory won't be set for X11 and
+    // Ozone/X11. Set a fake one instead to avoid crashing browser later.
+    DCHECK(!ui::LinuxInputMethodContextFactory::instance());
+#if defined(USE_OZONE)
+    // Try to create input method through Ozone so that the backend has a chance
+    // to set factory by itself.
+    if (features::IsUsingOzonePlatform()) {
+      ui::OzonePlatform::GetInstance()->CreateInputMethod(
+          nullptr, gfx::kNullAcceleratedWidget);
+    }
+#endif
+    // If factory is not set, set a fake instance.
+    if (!ui::LinuxInputMethodContextFactory::instance()) {
+      ui::LinuxInputMethodContextFactory::SetInstance(
+          new ui::FakeInputMethodContextFactory());
+    }
     return;
+  }
 
   linux_ui->SetUseSystemThemeCallback(
       base::BindRepeating([](aura::Window* window) {
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
index d0676ecc..045c239 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -18,6 +18,7 @@
 #include "chrome/browser/ui/browser_window.h"
 #include "chrome/browser/ui/views/chrome_layout_provider.h"
 #include "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h"
+#include "chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h"
 #include "chrome/grit/chromium_strings.h"
 #include "chrome/grit/generated_resources.h"
 #include "components/constrained_window/constrained_window_views.h"
@@ -25,6 +26,7 @@
 #include "components/web_modal/web_contents_modal_dialog_manager.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
+#include "content/public/browser/media_stream_request.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/web_contents_delegate.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -486,6 +488,12 @@
 }
 
 // static
-std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
-  return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
+std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create(
+    const content::MediaStreamRequest* request) {
+  if (request &&
+      request->video_type ==
+          blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB) {
+    return std::make_unique<GetCurrentBrowsingContextMediaDialog>();
+  }
+  return std::make_unique<DesktopMediaPickerViews>();
 }
diff --git a/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.cc b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.cc
new file mode 100644
index 0000000..3be2ce6
--- /dev/null
+++ b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.cc
@@ -0,0 +1,171 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h"
+
+#include "chrome/browser/media/webrtc/desktop_media_picker_manager.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/views/chrome_layout_provider.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/constrained_window/constrained_window_views.h"
+#include "components/web_modal/web_contents_modal_dialog_manager.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents_delegate.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/models/dialog_model.h"
+#include "ui/views/controls/button/checkbox.h"
+#include "ui/views/controls/textfield/textfield.h"
+#include "ui/views/layout/box_layout.h"
+
+namespace {
+constexpr int kCheckboxId = 1;
+
+class GetCurrentBrowsingContextMediaDialogDelegate
+    : public ui::DialogModelDelegate {
+ public:
+  GetCurrentBrowsingContextMediaDialogDelegate(
+      const DesktopMediaPicker::Params& params,
+      GetCurrentBrowsingContextMediaDialog* parent)
+      : render_process_id_(
+            params.web_contents->GetMainFrame()->GetProcess()->GetID()),
+        render_frame_id_(params.web_contents->GetMainFrame()->GetRoutingID()),
+        parent_(parent) {
+    DCHECK(parent_);
+  }
+
+  // Callback functions for when the permission is granted.
+  void OnAccept() {
+    // |id| is non-null if and only if it refers to a native screen/window.
+    content::DesktopMediaID source(content::DesktopMediaID::TYPE_WEB_CONTENTS,
+                                   /*id=*/content::DesktopMediaID::kNullId,
+                                   content::WebContentsMediaCaptureId(
+                                       render_process_id_, render_frame_id_));
+
+    source.audio_share =
+        dialog_model()->HasField(kCheckboxId) &&
+        dialog_model()->GetCheckboxByUniqueId(kCheckboxId)->is_checked();
+
+    // Gets the tab to be shared, which is the current tab in this
+    // case.
+    content::WebContents* const tab = content::WebContents::FromRenderFrameHost(
+        content::RenderFrameHost::FromID(render_process_id_, render_frame_id_));
+    // Activates the current tab and browser as confirmation that this is the
+    // tab being shared as the user might tab away between the time "share" was
+    // pressed and the actual share starts.
+    tab->GetDelegate()->ActivateContents(tab);
+    Browser* browser = chrome::FindBrowserWithWebContents(tab);
+    if (browser && browser->window()) {
+      browser->window()->Activate();
+    }
+
+    if (parent_) {
+      parent_->NotifyDialogResult(source);
+      parent_ = nullptr;
+    }
+  }
+
+  // Callback functions for when the permission is rejected or if the
+  // dialog/window is closed by the user.
+  void OnClose() {
+    if (parent_) {
+      parent_->NotifyDialogResult(content::DesktopMediaID());
+      parent_ = nullptr;
+    }
+  }
+
+ private:
+  // The pair of values (render_process_id_, render_frame_id_) together define
+  // the browsing context which is to be shared.
+  const int render_process_id_;
+  const int render_frame_id_;
+
+  GetCurrentBrowsingContextMediaDialog* parent_;
+
+  DISALLOW_COPY_AND_ASSIGN(GetCurrentBrowsingContextMediaDialogDelegate);
+};
+}  // namespace
+
+GetCurrentBrowsingContextMediaDialog::GetCurrentBrowsingContextMediaDialog() =
+    default;
+GetCurrentBrowsingContextMediaDialog::~GetCurrentBrowsingContextMediaDialog() =
+    default;
+
+std::unique_ptr<views::DialogDelegate>
+GetCurrentBrowsingContextMediaDialog::CreateDialogHost(
+    const DesktopMediaPicker::Params& params) {
+  auto unique_model_delegate =
+      std::make_unique<GetCurrentBrowsingContextMediaDialogDelegate>(params,
+                                                                     this);
+  GetCurrentBrowsingContextMediaDialogDelegate* model_delegate =
+      unique_model_delegate.get();
+
+  ui::DialogModel::Builder dialog_builder(std::move(unique_model_delegate));
+  // TODO(crbug.com/1136942): Reconcile design-doc and implementation wrt
+  // the body text; display frame's URL.
+  dialog_builder
+      .AddBodyText(ui::DialogModelLabel(l10n_util::GetStringFUTF16(
+          IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TEXT_REQUESTED_BY_APP,
+          params.target_name)))
+      .AddCancelButton(
+          base::BindOnce(&GetCurrentBrowsingContextMediaDialogDelegate::OnClose,
+                         base::Unretained(model_delegate)))
+      .AddOkButton(
+          base::BindOnce(
+              &GetCurrentBrowsingContextMediaDialogDelegate::OnAccept,
+              base::Unretained(model_delegate)),
+          l10n_util::GetStringUTF16(
+              IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_SHARE_BUTTON))
+      .SetCloseCallback(
+          base::BindOnce(&GetCurrentBrowsingContextMediaDialogDelegate::OnClose,
+                         base::Unretained(model_delegate)))
+      .SetTitle(l10n_util::GetStringUTF16(
+          IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE));
+
+  if (params.request_audio) {
+    dialog_builder.AddCheckbox(
+        kCheckboxId,
+        ui::DialogModelLabel(l10n_util::GetStringUTF16(
+            IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_AUDIO_SHARE)),
+        ui::DialogModelCheckbox::Params().SetIsChecked(
+            params.approve_audio_by_default));
+  }
+
+  auto dialog_host = views::BubbleDialogModelHost::CreateModal(
+      dialog_builder.Build(), params.modality);
+  dialog_host->SetDefaultButton(ui::DIALOG_BUTTON_CANCEL);
+  dialog_host->SetOwnedByWidget(true);
+  dialog_model_host_for_testing_ = dialog_host.get();
+  return dialog_host;
+}
+
+void GetCurrentBrowsingContextMediaDialog::Show(
+    const DesktopMediaPicker::Params& params,
+    std::vector<std::unique_ptr<DesktopMediaList>> source_lists,
+    DoneCallback done_callback) {
+  DCHECK(params.web_contents);
+
+  DesktopMediaPickerManager::Get()->OnShowDialog();
+  callback_ = std::move(done_callback);
+  std::unique_ptr<views::DialogDelegate> unique_delegate =
+      CreateDialogHost(params);
+
+  constrained_window::ShowWebModalDialogViews(unique_delegate.release(),
+                                              params.web_contents);
+
+  chrome::RecordDialogCreation(
+      chrome::DialogIdentifier::CURRENT_BROWSING_CONTEXT_CONFIRMATION_BOX);
+}
+
+void GetCurrentBrowsingContextMediaDialog::NotifyDialogResult(
+    const content::DesktopMediaID& source) {
+  DesktopMediaPickerManager::Get()->OnHideDialog();
+
+  if (callback_) {
+    std::move(callback_).Run(source);
+  }
+}
diff --git a/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h
new file mode 100644
index 0000000..32b366c
--- /dev/null
+++ b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h
@@ -0,0 +1,44 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_H_
+#define CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_H_
+
+#include "base/macros.h"
+#include "build/build_config.h"
+#include "chrome/browser/media/webrtc/desktop_media_picker.h"
+#include "chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.h"
+#include "ui/base/models/dialog_model.h"
+#include "ui/base/models/dialog_model_field.h"
+#include "ui/views/bubble/bubble_dialog_model_host.h"
+#include "ui/views/window/dialog_delegate.h"
+
+class GetCurrentBrowsingContextMediaDialog : public DesktopMediaPicker {
+ public:
+  GetCurrentBrowsingContextMediaDialog();
+  ~GetCurrentBrowsingContextMediaDialog() override;
+
+  void NotifyDialogResult(const content::DesktopMediaID& source);
+
+  // DesktopMediaPicker:
+  void Show(const DesktopMediaPicker::Params& params,
+            std::vector<std::unique_ptr<DesktopMediaList>> source_lists,
+            DoneCallback done_callback) override;
+
+  views::BubbleDialogModelHost* GetHostForTesting() {
+    return dialog_model_host_for_testing_;
+  }
+
+ private:
+  // Used to create the dialog using ui::DialogModel.
+  std::unique_ptr<views::DialogDelegate> CreateDialogHost(
+      const DesktopMediaPicker::Params& params);
+
+  DoneCallback callback_;
+  views::BubbleDialogModelHost* dialog_model_host_for_testing_;
+
+  DISALLOW_COPY_AND_ASSIGN(GetCurrentBrowsingContextMediaDialog);
+};
+
+#endif  // CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_H_
diff --git a/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog_unittest.cc b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog_unittest.cc
new file mode 100644
index 0000000..ffaedd7
--- /dev/null
+++ b/chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog_unittest.cc
@@ -0,0 +1,292 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog.h"
+
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/run_loop.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/task/post_task.h"
+#include "build/build_config.h"
+#include "chrome/browser/media/webrtc/desktop_media_picker_manager.h"
+#include "chrome/grit/generated_resources.h"
+#include "chrome/test/base/browser_with_test_window_test.h"
+#include "components/web_modal/test_web_contents_modal_dialog_host.h"
+#include "components/web_modal/test_web_contents_modal_dialog_manager_delegate.h"
+#include "components/web_modal/web_contents_modal_dialog_manager.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "ipc/ipc_message.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/ui_base_switches.h"
+#include "ui/views/controls/button/checkbox.h"
+#include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
+
+namespace {
+#if defined(OS_MAC)
+constexpr ui::KeyboardCode kAcceptKey = ui::VKEY_SPACE;
+#else
+constexpr ui::KeyboardCode kAcceptKey = ui::VKEY_RETURN;
+#endif
+}  // namespace
+
+namespace views {
+
+class MockDialogObserver : public DesktopMediaPickerManager::DialogObserver {
+ public:
+  MOCK_METHOD(void, OnDialogOpened, (), (override));
+  MOCK_METHOD(void, OnDialogClosed, (), (override));
+};
+
+class MockWebContentsDelegate : public content::WebContentsDelegate {};
+
+class GetCurrentBrowsingContextMediaDialogTest
+    : public BrowserWithTestWindowTest {
+ public:
+  void CustomSetUp(bool request_audio,
+                   bool approve_audio_by_default,
+                   bool is_closed_called) {
+#if defined(OS_MAC)
+    // These tests create actual child Widgets, which normally have a closure
+    // animation on Mac; inhibit it here to avoid the tests flakily hanging.
+    base::CommandLine::ForCurrentProcess()->AppendSwitch(
+        switches::kDisableModalAnimations);
+#endif
+    DesktopMediaPickerManager::Get()->AddObserver(&mock_dialog_observer_);
+    AddTab(browser(), GURL(url::kAboutBlankURL));
+
+    web_contents_ = browser()->tab_strip_model()->DetachWebContentsAt(0);
+    web_contents_->SetDelegate(&web_delegate_);
+
+    // Creates the parent widget which is needed for creating child widgets.
+    CreateParentWidget();
+    parent_widget_->SetVisibilityChangedAnimationsEnabled(false);
+    parent_widget_->Activate();
+
+    // Creates and sets the dialog host.
+    dialog_host_ = std::make_unique<web_modal::TestWebContentsModalDialogHost>(
+        parent_widget_->GetNativeView());
+    dialog_host_->set_max_dialog_size(gfx::Size(500, 500));
+    manager_delegate_.set_web_contents_modal_dialog_host(dialog_host_.get());
+
+    // Sets delegate for web_contents_.
+    web_modal::WebContentsModalDialogManager::CreateForWebContents(
+        web_contents_.get());
+    auto* manager = web_modal::WebContentsModalDialogManager::FromWebContents(
+        web_contents_.get());
+    manager->SetDelegate(&manager_delegate_);
+
+    DesktopMediaPicker::Params dialog_params;
+    // Sets the parameters for the confirmation dialog.
+    dialog_params.web_contents = web_contents_.get();
+    dialog_params.context = GetContext();
+    dialog_params.parent = parent_widget_->GetNativeWindow();
+    dialog_params.app_name = base::ASCIIToUTF16("OriginApp");
+    dialog_params.target_name = base::ASCIIToUTF16("TargetApp");
+    dialog_params.request_audio = request_audio;
+    dialog_params.approve_audio_by_default = approve_audio_by_default;
+
+    EXPECT_CALL(mock_dialog_observer_, OnDialogOpened());
+    if (is_closed_called) {
+      EXPECT_CALL(mock_dialog_observer_, OnDialogClosed());
+    }
+
+    dialog_.Show(
+        dialog_params, {},
+        base::BindOnce(&GetCurrentBrowsingContextMediaDialogTest::OnDialogDone,
+                       base::Unretained(this)));
+
+    render_process_id_ = web_contents_->GetMainFrame()->GetProcess()->GetID();
+    render_frame_id_ = web_contents_->GetMainFrame()->GetRoutingID();
+  }
+
+  void TearDown() override {
+    DesktopMediaPickerManager::Get()->RemoveObserver(&mock_dialog_observer_);
+    parent_widget_.reset();
+    web_contents_.reset();
+    BrowserWithTestWindowTest::TearDown();
+  }
+
+  base::Optional<content::DesktopMediaID> WaitForDialogDone() {
+    run_loop_.Run();
+    return dialog_id_;
+  }
+
+  void DoubleTapShareButton() {
+    ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
+    details.set_tap_count(2);
+    ui::GestureEvent double_tap(/*x=*/10, /*y=*/10, /*flags=*/0,
+                                base::TimeTicks(), details);
+    dialog_.GetHostForTesting()->GetOkButton()->OnGestureEvent(&double_tap);
+  }
+
+  void SimulateKeyPress(ui::KeyboardCode key) {
+    ui::KeyEvent event(ui::ET_KEY_PRESSED, key, ui::EF_NONE);
+    dialog_.GetHostForTesting()->GetWidget()->OnKeyEvent(&event);
+  }
+
+  void OnDialogDone(content::DesktopMediaID dialog_id) {
+    dialog_id_ = dialog_id;
+    run_loop_.Quit();
+  }
+
+  void CreateParentWidget() {
+    Widget::InitParams widget_params(Widget::InitParams::TYPE_WINDOW);
+    widget_params.context = GetContext();
+    widget_params.bounds = gfx::Rect(200, 80, 200, 80);
+    widget_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+    parent_widget_ = std::make_unique<Widget>();
+    parent_widget_->Init(std::move(widget_params));
+  }
+
+ protected:
+  base::Optional<content::DesktopMediaID> dialog_id_;
+  int render_process_id_ = MSG_ROUTING_NONE;
+  int render_frame_id_ = MSG_ROUTING_NONE;
+  std::unique_ptr<content::WebContents> web_contents_;
+  // dialog_ is responsible for creating the confirmation dialog and is
+  // used to access the host for testing.
+  GetCurrentBrowsingContextMediaDialog dialog_;
+  MockDialogObserver mock_dialog_observer_;
+  MockWebContentsDelegate web_delegate_;
+  std::unique_ptr<web_modal::TestWebContentsModalDialogHost> dialog_host_;
+  web_modal::TestWebContentsModalDialogManagerDelegate manager_delegate_;
+  std::unique_ptr<Widget> parent_widget_;
+  base::RunLoop run_loop_;
+};
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, CancelButtonAlwaysEnabled) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/false);
+  EXPECT_TRUE(dialog_.GetHostForTesting()->IsDialogButtonEnabled(
+      ui::DIALOG_BUTTON_CANCEL));
+}
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, ShareButtonAlwaysEnabled) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/false);
+  EXPECT_TRUE(
+      dialog_.GetHostForTesting()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
+}
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, DefaultAudioSelection) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  kResultId.audio_share = true;
+  dialog_.GetHostForTesting()->AcceptDialog();
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       DoneCallbackCalledWhenWindowClosed) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  dialog_.GetHostForTesting()->GetWidget()->Close();
+  EXPECT_EQ(content::DesktopMediaID(), WaitForDialogDone());
+}
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       DoneCallbackCalledWhenWindowClosedWithoutCheckboxTicked) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/false,
+              /*is_closed_called=*/true);
+  dialog_.GetHostForTesting()->CancelDialog();
+  EXPECT_EQ(content::DesktopMediaID(), WaitForDialogDone());
+}
+
+// Verifies that audio share information is recorded if the checkbox
+// is checked.
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       DoneCallbackCalledWithAudioShare) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  kResultId.audio_share = true;
+  dialog_.GetHostForTesting()->AcceptDialog();
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+// Verifies that audio share information is recorded if there is no checkbox.
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       DoneCallbackCalledWithNoAudioShare) {
+  CustomSetUp(/*request_audio=*/false, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  dialog_.GetHostForTesting()->AcceptDialog();
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+// Verifies that audio share information is recorded if the checkbox
+// is not checked.
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       DoneCallbackCalledWithAudioShareFalse) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/false,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  dialog_.GetHostForTesting()->AcceptDialog();
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+#if !defined(OS_CHROMEOS)
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, PressingDefaultButtonCancels) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  SimulateKeyPress(kAcceptKey);
+  EXPECT_EQ(content::DesktopMediaID(), WaitForDialogDone());
+}
+#endif
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, ShareButtonAccepts) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  kResultId.audio_share = true;
+  dialog_.GetHostForTesting()->GetOkButton()->OnKeyPressed(
+      ui::KeyEvent(ui::ET_KEY_PRESSED, kAcceptKey, 0));
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, DoubleTapOnShare) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/true);
+  content::DesktopMediaID kResultId(
+      content::DesktopMediaID::TYPE_WEB_CONTENTS, 0,
+      content::WebContentsMediaCaptureId(render_process_id_, render_frame_id_));
+  kResultId.audio_share = true;
+  DoubleTapShareButton();
+  EXPECT_EQ(kResultId, WaitForDialogDone());
+}
+
+// Validates that the cancel button is initially focused and enabled.
+TEST_F(GetCurrentBrowsingContextMediaDialogTest, InitiallyFocusesCancel) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/false);
+  EXPECT_EQ(dialog_.GetHostForTesting()->GetCancelButton(),
+            dialog_.GetHostForTesting()->GetInitiallyFocusedView());
+}
+
+// Validate that the title of the confirmation box shows the correct text.
+TEST_F(GetCurrentBrowsingContextMediaDialogTest,
+       ConfirmationBoxShowsCorrectTitle) {
+  CustomSetUp(/*request_audio=*/true, /*approve_audio_by_default=*/true,
+              /*is_closed_called=*/false);
+  EXPECT_EQ(dialog_.GetHostForTesting()->GetWindowTitle(),
+            l10n_util::GetStringUTF16(
+                IDS_GET_CURRENT_BROWSING_CONTEXT_MEDIA_DIALOG_TITLE));
+}
+
+}  // namespace views
diff --git a/chrome/browser/ui/webui/chrome_web_contents_handler.cc b/chrome/browser/ui/webui/chrome_web_contents_handler.cc
index 41c795e..6a398159 100644
--- a/chrome/browser/ui/webui/chrome_web_contents_handler.cc
+++ b/chrome/browser/ui/webui/chrome_web_contents_handler.cc
@@ -89,12 +89,10 @@
   Browser* browser = chrome::FindTabbedBrowser(profile, false);
   const bool browser_created = !browser;
   if (!browser) {
-    // TODO(https://crbug.com/1141608): Remove when root cause is found.
+    // The request can be triggered by Captive portal when browser is not ready
+    // (https://crbug.com/1141608).
     if (Browser::GetBrowserCreationStatusForProfile(profile) !=
         Browser::BrowserCreationStatus::kOk) {
-      NOTREACHED() << "Browser creation status: "
-                   << static_cast<int>(
-                          Browser::GetBrowserCreationStatusForProfile(profile));
       return;
     }
     browser = Browser::Create(
diff --git a/chrome/browser/ui/webui/device_log_ui.cc b/chrome/browser/ui/webui/device_log_ui.cc
index 3e12d41..1e83f02c 100644
--- a/chrome/browser/ui/webui/device_log_ui.cc
+++ b/chrome/browser/ui/webui/device_log_ui.cc
@@ -90,6 +90,7 @@
       {"logTypePrinterText", IDS_DEVICE_LOG_TYPE_PRINTER},
       {"logTypeFidoText", IDS_DEVICE_LOG_TYPE_FIDO},
       {"logTypeSerialText", IDS_DEVICE_LOG_TYPE_SERIAL},
+      {"logTypeCameraText", IDS_DEVICE_LOG_TYPE_CAMERA},
       {"logEntryFormat", IDS_DEVICE_LOG_ENTRY},
   };
   AddLocalizedStringsBulk(html, kStrings);
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 99fb2d2..12b2a39e 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -59,6 +59,7 @@
 #include "ui/base/theme_provider.h"
 #include "ui/base/webui/jstemplate_builder.h"
 #include "ui/base/webui/web_ui_util.h"
+#include "ui/chromeos/devicetype_utils.h"
 #include "ui/gfx/animation/animation.h"
 #include "ui/gfx/color_utils.h"
 #include "ui/native_theme/native_theme.h"
@@ -428,11 +429,11 @@
       const std::string enterprise_domain_manager =
           connector->GetEnterpriseDomainManager();
       enterprise_info = l10n_util::GetStringFUTF16(
-          IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
+          IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
           base::UTF8ToUTF16(enterprise_domain_manager));
     } else if (connector->IsActiveDirectoryManaged()) {
-      enterprise_info =
-          l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED);
+      enterprise_info = l10n_util::GetStringFUTF16(
+          IDS_ASH_ENTERPRISE_DEVICE_MANAGED, ui::GetChromeOSDeviceName());
     } else {
       NOTREACHED() << "Unknown management type";
     }
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
index d93a43e4..d13dabe 100644
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1269,10 +1269,6 @@
   static constexpr webui::LocalizedString kLocalizedStrings[] = {
       {"privacyPageTitle", IDS_SETTINGS_PRIVACY},
       {"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE},
-      // TODO(crbug.com/1116608): This seemingly unrelated string resource is
-      // used because it already has a localized version available in M85, so
-      // we can ship this label in M85 on short notice.
-      {"discardedPerSiteSetting", IDS_POLICY_LABEL_IGNORED},
       {"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK},
       {"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE},
       // TODO(crbug.com/1062607): This string is no longer used. Remove.
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc
index 502f1c9b..92130df29 100644
--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
@@ -457,8 +457,7 @@
     const ContentSetting& setting,
     const std::string& provider_name,
     bool incognito,
-    bool is_embargoed,
-    bool is_discarded) {
+    bool is_embargoed) {
   auto exception = std::make_unique<base::DictionaryValue>();
   exception->SetString(kOrigin, pattern.ToString());
   exception->SetString(kDisplayName, display_name);
@@ -475,7 +474,6 @@
   exception->SetString(kSource, provider_name);
   exception->SetBoolean(kIncognito, incognito);
   exception->SetBoolean(kIsEmbargoed, is_embargoed);
-  exception->SetBoolean(kIsDiscarded, is_discarded);
   return exception;
 }
 
@@ -544,11 +542,6 @@
 
   map->GetSettingsForOneType(type, &all_settings);
 
-  // Will return only regular settings for a regular profile and only incognito
-  // settings for an incognito Profile.
-  ContentSettingsForOneType discarded_settings;
-  map->GetDiscardedSettingsForOneType(type, &discarded_settings);
-
   // Group settings by primary_pattern.
   AllPatternsSettings all_patterns_settings;
   for (const auto& setting : all_settings) {
@@ -672,15 +665,6 @@
     for (auto& exception : one_provider_exceptions)
       exceptions->Append(std::move(exception));
   }
-
-  for (auto& discarded_rule : discarded_settings) {
-    exceptions->Append(GetExceptionForPage(
-        discarded_rule.primary_pattern, discarded_rule.secondary_pattern,
-        GetDisplayNameForPattern(discarded_rule.primary_pattern,
-                                 extension_registry),
-        discarded_rule.GetContentSetting(), discarded_rule.source, incognito,
-        false /*is_embargoed*/, true /*is_discarded*/));
-  }
 }
 
 void GetContentCategorySetting(const HostContentSettingsMap* map,
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.h b/chrome/browser/ui/webui/settings/site_settings_helper.h
index afd7814..58bf4fb 100644
--- a/chrome/browser/ui/webui/settings/site_settings_helper.h
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.h
@@ -68,7 +68,6 @@
 constexpr char kSource[] = "source";
 constexpr char kType[] = "type";
 constexpr char kIsEmbargoed[] = "isEmbargoed";
-constexpr char kIsDiscarded[] = "isDiscarded";
 
 enum class SiteSettingSource {
   kAllowlist,
@@ -131,8 +130,7 @@
     const ContentSetting& setting,
     const std::string& provider_name,
     bool incognito,
-    bool is_embargoed = false,
-    bool is_discarded = false);
+    bool is_embargoed = false);
 
 // Helper function to construct a dictionary for a hosted app exception.
 void AddExceptionForHostedApp(const std::string& url_pattern,
diff --git a/chrome/browser/vr/ui_host/vr_ui_host_impl.cc b/chrome/browser/vr/ui_host/vr_ui_host_impl.cc
index 0bda4c0..d129f3b 100644
--- a/chrome/browser/vr/ui_host/vr_ui_host_impl.cc
+++ b/chrome/browser/vr/ui_host/vr_ui_host_impl.cc
@@ -324,8 +324,8 @@
 
   is_external_prompt_showing_in_headset_ = true;
   external_prompt_timeout_task_.Reset(
-      base::BindRepeating(&VRUiHostImpl::RemoveHeadsetNotificationPrompt,
-                          weak_ptr_factory_.GetWeakPtr()));
+      base::BindOnce(&VRUiHostImpl::RemoveHeadsetNotificationPrompt,
+                     weak_ptr_factory_.GetWeakPtr()));
   main_thread_task_runner_->PostDelayedTask(
       FROM_HERE, external_prompt_timeout_task_.callback(),
       kPermissionPromptTimeout);
@@ -382,7 +382,7 @@
 }
 
 void VRUiHostImpl::PollCapturingState() {
-  poll_capturing_state_task_.Reset(base::BindRepeating(
+  poll_capturing_state_task_.Reset(base::BindOnce(
       &VRUiHostImpl::PollCapturingState, base::Unretained(this)));
   main_thread_task_runner_->PostDelayedTask(
       FROM_HERE, poll_capturing_state_task_.callback(),
diff --git a/chrome/browser/vr/ui_host/vr_ui_host_impl.h b/chrome/browser/vr/ui_host/vr_ui_host_impl.h
index df478d3..4835c1f 100644
--- a/chrome/browser/vr/ui_host/vr_ui_host_impl.h
+++ b/chrome/browser/vr/ui_host/vr_ui_host_impl.h
@@ -99,7 +99,7 @@
   permissions::PermissionRequestManager* permission_request_manager_ = nullptr;
   scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
 
-  base::CancelableClosure external_prompt_timeout_task_;
+  base::CancelableOnceClosure external_prompt_timeout_task_;
   bool is_external_prompt_showing_in_headset_ = false;
 
   CapturingStateModel active_capturing_;
@@ -114,7 +114,7 @@
   bool frames_throttled_ = false;
 
   mojo::Remote<device::mojom::GeolocationConfig> geolocation_config_;
-  base::CancelableClosure poll_capturing_state_task_;
+  base::CancelableOnceClosure poll_capturing_state_task_;
 
   THREAD_CHECKER(thread_checker_);
 
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt
index dc4ba1e4..c7b38b00 100644
--- a/chrome/build/linux.pgo.txt
+++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@
-chrome-linux-master-1606262372-53701711e1f3f7b0d49627ad74cc045279aff3ad.profdata
+chrome-linux-master-1606305050-8edbd758527486c76db2fc42225801a21c253468.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt
index 00c2c01f3..c052b33a 100644
--- a/chrome/build/mac.pgo.txt
+++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@
-chrome-mac-master-1606262372-c28fabe0f518396be3e19b31d10fd57f4542b836.profdata
+chrome-mac-master-1606305050-ea6ce0091e94442cf03fb928da3568602c7b69e6.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt
index 459b252..0329116 100644
--- a/chrome/build/win64.pgo.txt
+++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@
-chrome-win64-master-1606240669-a966a0de7533a2c29e2a147761a10e8425d1cfe7.profdata
+chrome-win64-master-1606283471-0c692a03b66417a93fe8e91b8a0c4f515aaad0a9.profdata
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
index 6430af8..89ce501 100644
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -656,6 +656,11 @@
                                       base::FEATURE_ENABLED_BY_DEFAULT};
 #endif
 
+// Keep a client-side log of when websites access permission-gated capabilities
+// to allow the user to audit usage.
+const base::Feature kPermissionAuditing{"PermissionAuditing",
+                                        base::FEATURE_DISABLED_BY_DEFAULT};
+
 // Enables using the prediction service for permission prompts.
 const base::Feature kPermissionPredictions{"PermissionPredictions",
                                            base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h
index 375ab89d..71a8ec1 100644
--- a/chrome/common/chrome_features.h
+++ b/chrome/common/chrome_features.h
@@ -437,6 +437,9 @@
 #endif
 
 COMPONENT_EXPORT(CHROME_FEATURES)
+extern const base::Feature kPermissionAuditing;
+
+COMPONENT_EXPORT(CHROME_FEATURES)
 extern const base::Feature kPermissionPredictions;
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index 95a580d..1284519 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -286,8 +286,6 @@
 const char kWhoIsMyAdministratorHelpURL[] =
     "https://support.google.com/chrome?p=your_administrator";
 
-const char kChromeFlashRoadmapURL[] = "https://www.chromium.org/flash-roadmap/";
-
 #if defined(OS_ANDROID)
 const char kAndroidAppScheme[] = "android-app";
 #endif
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index ec2c7b60..790f555 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -248,9 +248,6 @@
 // Help center URL for who the account administrator is.
 extern const char kWhoIsMyAdministratorHelpURL[];
 
-// Link to the flash roadmap
-extern const char kChromeFlashRoadmapURL[];
-
 #if defined(OS_ANDROID)
 extern const char kAndroidAppScheme[];
 #endif
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 6d95018..b81e009c 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -469,6 +469,7 @@
     ]
 
     deps += [
+      "//build:chromeos_buildflags",
       "//chrome/browser/web_applications:web_applications_on_extensions_test_support",
       "//chrome/browser/web_applications:web_applications_test_support",
     ]
@@ -2164,6 +2165,7 @@
       }
 
       deps += [
+        "//build:chromeos_buildflags",
         "//chrome/browser/devtools:test_support",
         "//chrome/common/extensions/api",
         "//chrome/services/media_gallery_util/public/cpp:browser_tests",
@@ -6007,6 +6009,7 @@
       "../browser/ui/views/confirm_bubble_views_unittest.cc",
       "../browser/ui/views/content_setting_bubble_contents_unittest.cc",
       "../browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc",
+      "../browser/ui/views/desktop_capture/get_current_browsing_context_media_dialog_unittest.cc",
       "../browser/ui/views/device_chooser_content_view_unittest.cc",
       "../browser/ui/views/download/download_in_progress_dialog_view_unittest.cc",
       "../browser/ui/views/download/download_shelf_view_unittest.cc",
@@ -7008,6 +7011,7 @@
     deps = [
       ":test_support",
       "//base",
+      "//build:chromeos_buildflags",
       "//components/bookmarks/browser:test_support",
       "//components/invalidation/impl",
       "//components/invalidation/impl:test_support",
@@ -7135,6 +7139,7 @@
       ":sync_integration_test_support",
       ":test_support",
       ":test_support_ui",
+      "//build:chromeos_buildflags",
       "//chrome:packed_resources",
       "//chrome:resources",
       "//chrome:strings",
diff --git a/chrome/test/data/pdf/annotations_feature_enabled_test.js b/chrome/test/data/pdf/annotations_feature_enabled_test.js
index 3171fa5..d90d95a 100644
--- a/chrome/test/data/pdf/annotations_feature_enabled_test.js
+++ b/chrome/test/data/pdf/annotations_feature_enabled_test.js
@@ -67,9 +67,12 @@
       const expectationTop = updateEnabled ?
           Math.min(2.25, expectation.top - 21) :
           expectation.top;
+      const expectationBottom = updateEnabled ?
+          Math.max(-412.5, expectation.bottom + 18) :
+          expectation.bottom;
       chrome.test.assertEq(expectationTop, actual.top);
       chrome.test.assertEq(expectation.left, actual.left);
-      chrome.test.assertEq(expectation.bottom, actual.bottom);
+      chrome.test.assertEq(expectationBottom, actual.bottom);
       chrome.test.assertEq(expectation.right, actual.right);
     }
     chrome.test.succeed();
diff --git a/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js
index 92dcfbd..f6e391ab 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js
@@ -4,7 +4,7 @@
 
 import 'chrome://diagnostics/cpu_card.js';
 
-import {CpuUsage, RoutineName, SystemDataProviderInterface, SystemInfo} from 'chrome://diagnostics/diagnostics_types.js';
+import {CpuUsage, RoutineType, SystemDataProviderInterface, SystemInfo} from 'chrome://diagnostics/diagnostics_types.js';
 import {fakeCpuUsage, fakeSystemInfo} from 'chrome://diagnostics/fake_data.js';
 import {FakeSystemDataProvider} from 'chrome://diagnostics/fake_system_data_provider.js';
 import {getSystemDataProvider, setSystemDataProviderForTesting} from 'chrome://diagnostics/mojo_interface_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js b/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js
index a8a59e5..9013cee 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import {RoutineName, RoutineRunner, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
+import {RoutineRunner, RoutineType, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
 import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js';
 import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js';
 
@@ -25,38 +25,36 @@
    * promise must be forced to resolve either by chaining it with additional
    * promises or returning it from the test.
    *
-   * @param {!RoutineName} expectedName
+   * @param {!RoutineType} expectedType
    * @param {!StandardRoutineResult} expectedResult
    * @return {!Promise}
    */
-  function runRoutineAndAssertStandardResult(expectedName, expectedResult) {
+  function runRoutineAndAssertStandardResult(expectedType, expectedResult) {
     let resolver = new PromiseResolver();
 
-    /** @type {!RoutineRunner} */
-    const routineRunnerRemote = {
+    const routineRunnerRemote = /** @type {!RoutineRunner} */ ({
       onRoutineResult: (resultInfo) => {
-        assertEquals(expectedName, resultInfo.name);
+        assertEquals(expectedType, resultInfo.type);
 
         if (resultInfo.result.hasOwnProperty('simpleResult')) {
           assertEquals(expectedResult, resultInfo.result.simpleResult);
 
-          // Can't have both simpleResult and batteryRateResult
-          assertFalse(resultInfo.result.hasOwnProperty('batteryRateResult'));
+          // Can't have both simpleResult and powerResult
+          assertFalse(resultInfo.result.hasOwnProperty('powerResult'));
         }
 
-        if (resultInfo.result.hasOwnProperty('batteryRateResult')) {
-          assertEquals(
-              expectedResult, resultInfo.result.batteryRateResult.result);
+        if (resultInfo.result.hasOwnProperty('powerResult')) {
+          assertEquals(expectedResult, resultInfo.result.powerResult.result);
 
-          // Can't have both simpleResult and batteryRateResult
+          // Can't have both simpleResult and powerResult
           assertFalse(resultInfo.result.hasOwnProperty('simpleResult'));
         }
 
         resolver.resolve();
       }
-    };
+    });
 
-    return controller.runRoutine(expectedName, routineRunnerRemote).then(() => {
+    return controller.runRoutine(expectedType, routineRunnerRemote).then(() => {
       return resolver.promise;
     });
   }
@@ -66,12 +64,12 @@
    * promise must be forced to resolve either by chaining it with additional
    * promises or returning it from the test.
    *
-   * @param {!RoutineName} expectedName
+   * @param {!RoutineType} expectedType
    * @param {!StandardRoutineResult} expectedResult
    * @return {!Promise}
    */
   function runRoutineAndAssertStandardResultManualResolve(
-      expectedName, expectedResult) {
+      expectedType, expectedResult) {
     let resolver = new PromiseResolver();
 
     // Nothing should be running yet.
@@ -80,21 +78,21 @@
     // Use this to detect if the routine resolved too early.
     let wasRun = false;
 
-    /** @type {!RoutineRunner} */
-    const routineRunnerRemote = {
+
+    const routineRunnerRemote = /** @type {!RoutineRunner} */ ({
       onRoutineResult: (resultInfo) => {
         assertTrue(controller.isRoutineInProgressForTesting());
         assertFalse(wasRun);
-        assertEquals(expectedName, resultInfo.name);
+        assertEquals(expectedType, resultInfo.type);
         assertEquals(expectedResult, resultInfo.result.simpleResult);
 
         // Mark that the test completed.
         wasRun = true;
         resolver.resolve();
       }
-    };
+    });
 
-    controller.runRoutine(expectedName, routineRunnerRemote).then(() => {
+    controller.runRoutine(expectedType, routineRunnerRemote).then(() => {
       assertTrue(wasRun);
       assertFalse(controller.isRoutineInProgressForTesting());
     });
@@ -116,68 +114,78 @@
   test('NonExistantTest', () => {
     // A routine that hasn't had a fake result set will return kErrorExecuting.
     return runRoutineAndAssertStandardResult(
-        RoutineName.kCpuStress, StandardRoutineResult.kErrorExecuting);
+        chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kExecutionError);
   });
 
   test('ExpectedResultPass', () => {
-    const routineName = RoutineName.kCpuStress;
-    const expectedResult = StandardRoutineResult.kTestPassed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuStress;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
-    return runRoutineAndAssertStandardResult(routineName, expectedResult);
+    return runRoutineAndAssertStandardResult(routineType, expectedResult);
   });
 
   test('ExpectedResultFail', () => {
-    const routineName = RoutineName.kCpuStress;
-    const expectedResult = StandardRoutineResult.kTestFailed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuStress;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
-    return runRoutineAndAssertStandardResult(routineName, expectedResult);
+    return runRoutineAndAssertStandardResult(routineType, expectedResult);
   });
 
-  test('ExpectedBatteryRateResultPass', () => {
-    const routineName = RoutineName.kCharge;
-    const expectedResult = StandardRoutineResult.kTestPassed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+  test('ExpectedPowerResultPass', () => {
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuCache;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
-    return runRoutineAndAssertStandardResult(routineName, expectedResult);
+    return runRoutineAndAssertStandardResult(routineType, expectedResult);
   });
 
-  test('ExpectedBatteryRateResultFail', () => {
-    const routineName = RoutineName.kCharge;
-    const expectedResult = StandardRoutineResult.kTestFailed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+  test('ExpectedPowerResultFail', () => {
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuCache;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
-    return runRoutineAndAssertStandardResult(routineName, expectedResult);
+    return runRoutineAndAssertStandardResult(routineType, expectedResult);
   });
 
   test('ExpectedResultPassManualResolve', () => {
-    const routineName = RoutineName.kCpuStress;
-    const expectedResult = StandardRoutineResult.kTestPassed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuStress;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
     // Tests will only resolve when done manually.
     controller.setDelayTimeInMillisecondsForTesting(-1);
 
     return runRoutineAndAssertStandardResultManualResolve(
-        routineName, expectedResult);
+        routineType, expectedResult);
   });
 
   test('ExpectedResultFailManualResolve', () => {
-    const routineName = RoutineName.kCpuStress;
-    const expectedResult = StandardRoutineResult.kTestFailed;
-    controller.setFakeStandardRoutineResult(routineName, expectedResult);
+    const routineType = chromeos.diagnostics.mojom.RoutineType.kCpuStress;
+    const expectedResult =
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed;
+    controller.setFakeStandardRoutineResult(routineType, expectedResult);
 
     // Tests will only resolve when done manually.
     controller.setDelayTimeInMillisecondsForTesting(-1);
 
     return runRoutineAndAssertStandardResultManualResolve(
-        routineName, expectedResult);
+        routineType, expectedResult);
   });
 
   test('GetSupportedRoutines', () => {
-    /** @type {!Array<!RoutineName>} */
-    const expected = [RoutineName.kCpuStress, RoutineName.kCpuCache];
+    /** @type {!Array<!RoutineType>} */
+    const expected = [
+      chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache
+    ];
 
     controller.setFakeSupportedRoutines(expected);
     return controller.getSupportedRoutines().then((result) => {
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js
index 0ddae8b..eefba361 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import {BatteryRateRoutineResult, RoutineName, RoutineResultInfo, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
+import {PowerRoutineResult, RoutineResultInfo, RoutineType, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
 import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js';
 import {ExecutionProgress, ResultStatusItem, RoutineListExecutor} from 'chrome://diagnostics/routine_list_executor.js';
 
@@ -33,38 +33,40 @@
    */
   function runRoutinesAndAssertResults(routines) {
     let expectedCallbacks = [];
-    let routineNames = [];
+    let routineTypes = [];
     routines.forEach((routine) => {
       // Set the result into the fake.
       assertNotEquals(undefined, routine);
       assertNotEquals(undefined, routine.result);
 
-      // simpleResult or batteryRateResult must exist.
+      // simpleResult or powerResult must exist.
       assertTrue(
           routine.result.hasOwnProperty('simpleResult') ||
-          routine.result.hasOwnProperty('batteryRateResult'));
+          routine.result.hasOwnProperty('powerResult'));
 
       if (routine.result.hasOwnProperty('simpleResult')) {
         controller.setFakeStandardRoutineResult(
-            routine.name, /** @type {!StandardRoutineResult} */
+            /** @type {!RoutineType} */ (routine.type),
+            /** @type {!StandardRoutineResult} */
             (routine.result.simpleResult));
       } else {
-        assertTrue(routine.result.batteryRateResult.hasOwnProperty('result'));
-        controller.setFakeBatteryRateRoutineResult(
-            routine.name, /** @type {!BatteryRateRoutineResult} */
-            (routine.result.batteryRateResult));
+        assertTrue(routine.result.powerResult.hasOwnProperty('simpleResult'));
+        controller.setFakePowerRoutineResult(
+            /** @type {!RoutineType} */ (routine.type),
+            /** @type {!PowerRoutineResult} */
+            (routine.result.powerResult));
       }
 
       // Build the list of routines to run.
-      routineNames.push(routine.name);
+      routineTypes.push(routine.type);
 
       // Add the "running" callback to the list.
-      let status = new ResultStatusItem(routine.name);
+      let status = new ResultStatusItem(routine.type);
       status.progress = ExecutionProgress.kRunning;
       expectedCallbacks.push(status);
 
       // Add the "completed" callback to the list.
-      status = new ResultStatusItem(routine.name);
+      status = new ResultStatusItem(routine.type);
       status.progress = ExecutionProgress.kCompleted;
       status.result = routine.result;
       expectedCallbacks.push(status);
@@ -81,15 +83,21 @@
       if (status.progress === ExecutionProgress.kRunning) {
         assertEquals(null, status.result);
       } else {
-        assertEquals(
-            expectedCallbacks[upto].result.simpleResult,
-            status.result.simpleResult);
+        if (expectedCallbacks[upto].result.hasOwnProperty('simpleResult')) {
+          assertEquals(
+              expectedCallbacks[upto].result.simpleResult,
+              status.result.simpleResult);
+        } else {
+          assertEquals(
+              expectedCallbacks[upto].result.powerResult.simpleResult,
+              status.result.powerResult.simpleResult);
+        }
       }
 
       upto++;
     };
 
-    return executor.runRoutines(routineNames, statusCallback).then(() => {
+    return executor.runRoutines(routineTypes, statusCallback).then(() => {
       // Ensure that all the callbacks were sent.
       assertEquals(expectedCallbacks.length, upto);
     });
@@ -98,8 +106,11 @@
   test('SingleTest', () => {
     /** @type {!Array<!RoutineResultInfo>} */
     const routines = [{
-      name: RoutineName.kCpuStress,
-      result: {simpleResult: StandardRoutineResult.kTestFailed}
+      type: chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+      result: {
+        simpleResult:
+            chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed
+      }
     }];
     return runRoutinesAndAssertResults(routines);
   });
@@ -108,26 +119,39 @@
     /** @type {!Array<!RoutineResultInfo>} */
     const routines = [
       {
-        name: RoutineName.kCpuStress,
-        result: {simpleResult: StandardRoutineResult.kTestPassed}
-      },
-      {
-        name: RoutineName.kCpuCache,
-        result: {simpleResult: StandardRoutineResult.kTestFailed}
-      },
-      {
-        name: RoutineName.kFloatingPoint,
-        result: {simpleResult: StandardRoutineResult.kTestPassed}
-      },
-      {
-        name: RoutineName.kPrimeSearch,
-        result: {simpleResult: StandardRoutineResult.kTestFailed}
-      },
-      {
-        name: RoutineName.kCharge,
+        type: chromeos.diagnostics.mojom.RoutineType.kCpuStress,
         result: {
-          batteryRateResult: {
-            result: StandardRoutineResult.kTestFailed,
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+        }
+      },
+      {
+        type: chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+        result: {
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed
+        }
+      },
+      {
+        type: chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
+        result: {
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+        }
+      },
+      {
+        type: chromeos.diagnostics.mojom.RoutineType.kCpuPrime,
+        result: {
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed
+        }
+      },
+      {
+        type: chromeos.diagnostics.mojom.RoutineType.kBatteryCharge,
+        result: {
+          powerResult: {
+            simpleResult:
+                chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed,
             isCharging: true,
             percentDelta: 10,
             timeDeltaSeconds: 10
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js
index d13bf42..fd60841 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js
@@ -4,7 +4,7 @@
 
 import 'chrome://diagnostics/routine_result_entry.js';
 
-import {RoutineName, RoutineResult, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
+import {RoutineResult, RoutineType, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
 import {ExecutionProgress, ResultStatusItem} from 'chrome://diagnostics/routine_list_executor.js';
 import {BadgeType} from 'chrome://diagnostics/text_badge.js';
 import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
@@ -62,7 +62,7 @@
 
   /**
    * Creates a result status item without a final result.
-   * @param {!RoutineName} routine
+   * @param {!RoutineType} routine
    * @param {!ExecutionProgress} progress
    * @return {!ResultStatusItem}
    */
@@ -74,7 +74,7 @@
 
   /**
    * Creates a completed result status item with a result.
-   * @param {!RoutineName} routine
+   * @param {!RoutineType} routine
    * @param {!RoutineResult} result
    * @return {!ResultStatusItem}
    */
@@ -115,7 +115,8 @@
 
   test('NotStartedTest', () => {
     const item = createIncompleteStatus(
-        RoutineName.kCpuStress, ExecutionProgress.kNotStarted);
+        chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+        ExecutionProgress.kNotStarted);
     return initializeEntryWithItem(item).then(() => {
       assertEquals(
           getNameText(),
@@ -131,7 +132,8 @@
 
   test('RunningTest', () => {
     const item = createIncompleteStatus(
-        RoutineName.kCpuStress, ExecutionProgress.kRunning);
+        chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+        ExecutionProgress.kRunning);
     return initializeEntryWithItem(item).then(() => {
       assertEquals(
           getNameText(),
@@ -147,8 +149,10 @@
 
   test('PassedTest', () => {
     const item = createCompletedStatus(
-        RoutineName.kCpuStress, /** @type {!RoutineResult} */ ({
-          simpleResult: StandardRoutineResult.kTestPassed
+        chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+        /** @type {!RoutineResult} */ ({
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
         }));
     return initializeEntryWithItem(item).then(() => {
       assertEquals(
@@ -165,8 +169,10 @@
 
   test('FailedTest', () => {
     const item = createCompletedStatus(
-        RoutineName.kCpuStress, /** @type {!RoutineResult} */ ({
-          simpleResult: StandardRoutineResult.kTestFailed
+        chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+        /** @type {!RoutineResult} */ ({
+          simpleResult:
+              chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed
         }));
     return initializeEntryWithItem(item).then(() => {
       assertEquals(
@@ -181,11 +187,13 @@
     });
   });
 
-  test('BatteryTest', () => {
+  test('PowerTest', () => {
     const item = createCompletedStatus(
-        RoutineName.kCharge, /** @type {!RoutineResult} */ ({
-          batteryRateResult: {
-            result: StandardRoutineResult.kTestPassed,
+        chromeos.diagnostics.mojom.RoutineType.kBatteryCharge,
+        /** @type {!RoutineResult} */ ({
+          powerResult: {
+            simpleResult:
+                chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed,
             isCharging: true,
             percentDelta: 10,
             timeDeltaSeconds: 10
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js
index 95ff047..622cab3 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js
@@ -4,7 +4,7 @@
 
 import 'chrome://diagnostics/routine_result_list.js';
 
-import {RoutineName, RoutineResult, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
+import {RoutineResult, RoutineType, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
 import {ExecutionProgress, ResultStatusItem} from 'chrome://diagnostics/routine_list_executor.js';
 
 import {assertDeepEquals, assertEquals, assertFalse, assertNotEquals, assertTrue} from '../../chai_assert.js';
@@ -29,7 +29,7 @@
 
   /**
    * Initializes the routine-result-list and sets the list of routines.
-   * @param {!Array<!RoutineName>} routines
+   * @param {!Array<!RoutineType>} routines
    * @return {!Promise}
    */
   function initializeRoutineResultList(routines) {
@@ -95,10 +95,10 @@
   });
 
   test('InitializedRoutines', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     return initializeRoutineResultList(routines).then(() => {
@@ -113,10 +113,10 @@
   });
 
   test('InitializeThenClearRoutines', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     return initializeRoutineResultList(routines)
@@ -131,10 +131,10 @@
   });
 
   test('VerifyStatusUpdates', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     return initializeRoutineResultList(routines).then(() => {
@@ -160,8 +160,10 @@
             // Move the first routine to completed state.
             status = new ResultStatusItem(routines[0]);
             status.progress = ExecutionProgress.kCompleted;
-            status.result = /** @type {!RoutineResult} */ (
-                {simpleResult: StandardRoutineResult.kTestPassed});
+            status.result = /** @type {!RoutineResult} */ ({
+              simpleResult:
+                  chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+            });
             routineResultListElement.onStatusUpdate(status);
 
             return flushTasks();
@@ -172,7 +174,7 @@
                 ExecutionProgress.kCompleted, getEntries()[0].item.progress);
             assertNotEquals(null, getEntries()[0].item.result);
             assertEquals(
-                StandardRoutineResult.kTestPassed,
+                chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed,
                 getEntries()[0].item.result.simpleResult);
 
             status = new ResultStatusItem(routines[1]);
@@ -190,8 +192,10 @@
             // Move the second routine to completed state.
             status = new ResultStatusItem(routines[1]);
             status.progress = ExecutionProgress.kCompleted;
-            status.result = /** @type {!RoutineResult} */ (
-                {simpleResult: StandardRoutineResult.kTestPassed});
+            status.result = /** @type {!RoutineResult} */ ({
+              simpleResult:
+                  chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+            });
             routineResultListElement.onStatusUpdate(status);
 
             return flushTasks();
@@ -202,7 +206,7 @@
                 ExecutionProgress.kCompleted, getEntries()[1].item.progress);
             assertNotEquals(null, getEntries()[1].item.result);
             assertEquals(
-                StandardRoutineResult.kTestPassed,
+                chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed,
                 getEntries()[0].item.result.simpleResult);
 
             return flushTasks();
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js
index d1235e1b..2943d728d 100644
--- a/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js
+++ b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js
@@ -5,8 +5,8 @@
 import 'chrome://diagnostics/routine_result_entry.js';
 import 'chrome://diagnostics/routine_section.js';
 
-import {RoutineName, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
-import {fakeBatteryRoutineResults, fakeRoutineResults} from 'chrome://diagnostics/fake_data.js';
+import {RoutineType, StandardRoutineResult} from 'chrome://diagnostics/diagnostics_types.js';
+import {fakePowerRoutineResults, fakeRoutineResults} from 'chrome://diagnostics/fake_data.js';
 import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js';
 import {setSystemRoutineControllerForTesting} from 'chrome://diagnostics/mojo_interface_provider.js';
 import {ExecutionProgress} from 'chrome://diagnostics/routine_list_executor.js';
@@ -35,7 +35,7 @@
 
     // Enable all routines by default.
     routineController.setFakeSupportedRoutines(
-        [...fakeRoutineResults.keys(), ...fakeBatteryRoutineResults.keys()]);
+        [...fakeRoutineResults.keys(), ...fakePowerRoutineResults.keys()]);
 
     setSystemRoutineControllerForTesting(routineController);
   });
@@ -49,7 +49,7 @@
 
   /**
    * Initializes the element and sets the routines.
-   * @param {!Array<!RoutineName>} routines
+   * @param {!Array<!RoutineType>} routines
    */
   function initializeRoutineSection(routines) {
     assertFalse(!!routineSectionElement);
@@ -166,10 +166,10 @@
   });
 
   test('ClickButtonDisablesButton', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     return initializeRoutineSection(routines)
@@ -185,10 +185,10 @@
   });
 
   test('ResultListToggleButton', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     // TODO(joonbug): Use visibility assert over testing .hidden attr.
@@ -221,10 +221,10 @@
   });
 
   test('ClickButtonInitializesResultList', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
     ];
 
     return initializeRoutineSection(routines)
@@ -284,17 +284,20 @@
   });
 
   test('ResultListFiltersBySupported', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kCpuCache,
-      RoutineName.kMemory,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kMemory,
     ];
 
     routineController.setFakeStandardRoutineResult(
-        RoutineName.kMemory, StandardRoutineResult.kTestPassed);
+        chromeos.diagnostics.mojom.RoutineType.kMemory,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed);
     routineController.setFakeStandardRoutineResult(
-        RoutineName.kCpuCache, StandardRoutineResult.kTestPassed);
-    routineController.setFakeSupportedRoutines([RoutineName.kMemory]);
+        chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed);
+    routineController.setFakeSupportedRoutines(
+        [chromeos.diagnostics.mojom.RoutineType.kMemory]);
 
     return initializeRoutineSection(routines)
         .then(() => {
@@ -303,7 +306,9 @@
         .then(() => {
           const entries = getEntries();
           assertEquals(1, entries.length);
-          assertEquals(RoutineName.kMemory, entries[0].item.routine);
+          assertEquals(
+              chromeos.diagnostics.mojom.RoutineType.kMemory,
+              entries[0].item.routine);
           // Resolve the running test.
           return routineController.resolveRoutineForTesting();
         })
@@ -313,18 +318,21 @@
         .then(() => {
           const entries = getEntries();
           assertEquals(1, entries.length);
-          assertEquals(RoutineName.kMemory, entries[0].item.routine);
+          assertEquals(
+              chromeos.diagnostics.mojom.RoutineType.kMemory,
+              entries[0].item.routine);
         });
   });
 
   test('ResultListStatusSuccess', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kMemory,
+      chromeos.diagnostics.mojom.RoutineType.kMemory,
     ];
 
     routineController.setFakeStandardRoutineResult(
-        RoutineName.kMemory, StandardRoutineResult.kTestPassed);
+        chromeos.diagnostics.mojom.RoutineType.kMemory,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed);
 
     return initializeRoutineSection(routines)
         .then(() => {
@@ -365,16 +373,18 @@
   });
 
   test('ResultListStatusFail', () => {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     const routines = [
-      RoutineName.kFloatingPoint,
-      RoutineName.kCpuCache,
+      chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
+      chromeos.diagnostics.mojom.RoutineType.kCpuCache,
     ];
 
     routineController.setFakeStandardRoutineResult(
-        RoutineName.kFloatingPoint, StandardRoutineResult.kTestFailed);
+        chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed);
     routineController.setFakeStandardRoutineResult(
-        RoutineName.kCpuCache, StandardRoutineResult.kTestPassed);
+        chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+        chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed);
 
     return initializeRoutineSection(routines)
         .then(() => {
diff --git a/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js b/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js
index 27123b2b..ea094e43 100644
--- a/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js
+++ b/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js
@@ -326,9 +326,9 @@
 });
 
 // TODO(crbug.com/929455): When the bug is fixed, merge
-// SiteListProperties into SiteList
-TEST_F('CrSettingsSiteListV3Test', 'SiteListProperties', function() {
-  runMochaSuite('SiteListProperties');
+// SiteListEmbargoedOrigin into SiteList
+TEST_F('CrSettingsSiteListV3Test', 'SiteListEmbargoedOrigin', function() {
+  runMochaSuite('SiteListEmbargoedOrigin');
 });
 
 TEST_F('CrSettingsSiteListV3Test', 'EditExceptionDialog', function() {
diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js
index bbf8c9d0..f9cb9c201 100644
--- a/chrome/test/data/webui/settings/site_list_tests.js
+++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -100,7 +100,6 @@
  */
 let prefsEmbargo;
 
-
 /**
  * Creates all the test |SiteSettingsPref|s that are needed for the tests in
  * this file. They are populated after test setup in order to access the
@@ -279,7 +278,7 @@
   ]);
 }
 
-suite('SiteListProperties', function() {
+suite('SiteListEmbargoedOrigin', function() {
   /**
    * A site list element created before each test.
    * @type {!SiteListElement}
@@ -1031,7 +1030,6 @@
       embeddingOrigin: SITE_EXCEPTION_WILDCARD,
       isEmbargoed: false,
       incognito: false,
-      isDiscarded: false,
       setting: ContentSetting.BLOCK,
       enforcement: null,
       controlledBy: chrome.settingsPrivate.ControlledBy.USER_POLICY,
diff --git a/chrome/test/data/webui/settings/test_util.js b/chrome/test/data/webui/settings/test_util.js
index 5cbbc00..0fbca30d 100644
--- a/chrome/test/data/webui/settings/test_util.js
+++ b/chrome/test/data/webui/settings/test_util.js
@@ -58,7 +58,6 @@
         incognito: false,
         origin: origin,
         displayName: '',
-        isDiscarded: false,
         setting: ContentSetting.ALLOW,
         source: SiteSettingSource.PREFERENCE,
       },
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn
index b0baf6b..a744994 100644
--- a/chromeos/BUILD.gn
+++ b/chromeos/BUILD.gn
@@ -301,12 +301,6 @@
       "crostini.Restart.buster_amd64_stable",
       "crostini.Restart.buster_arm_stable",
 
-      # crbug.com/1141944
-      "crostini.LaunchBrowser.stretch_amd64_stable",
-      "crostini.LaunchBrowser.stretch_arm_stable",
-      "crostini.LaunchBrowser.buster_amd64_stable",
-      "crostini.LaunchBrowser.buster_arm_stable",
-
       # crbug.com/1098810
       "security.SELinuxFilesSystem",
 
diff --git a/chromeos/chromeos_strings.grd b/chromeos/chromeos_strings.grd
index 5176da6..984a536 100644
--- a/chromeos/chromeos_strings.grd
+++ b/chromeos/chromeos_strings.grd
@@ -182,11 +182,11 @@
       </message>
 
       <!-- Status tray enterprise management. -->
-      <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY" desc="Text for notifications showing that this device is enterpise managed. Used when the organization's domain name is available.">
-        This device is managed by <ph name="DOMAIN">$1<ex>acmecorp.com</ex></ph>.
+      <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY" desc="Text for notifications showing that this device is enterprise managed. Used when the manager is available. MANAGER can be a domain or an email address.">
+        This <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> is managed by <ph name="MANAGER">$2<ex>acmecorp.com</ex></ph>.
       </message>
-      <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED" desc="Text for notifications showing that this device is enterprise managed. Used when the organization's domain name is not available (e.g. Active Directory).">
-        This device is enterprise managed
+      <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED" desc="Text for notifications showing that this device is enterprise managed. Used when the manager is not available (e.g. Active Directory).">
+        This <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> is enterprise managed
       </message>
       <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_SHORT" desc="Short text showing that the device is enterprise managed.">
         Managed
diff --git a/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED.png.sha1 b/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED.png.sha1
new file mode 100644
index 0000000..2e4316aa
--- /dev/null
+++ b/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED.png.sha1
@@ -0,0 +1 @@
+1a81d2e43bb8fb22e6c061917fea0bb76c089e51
\ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY.png.sha1 b/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY.png.sha1
new file mode 100644
index 0000000..215bdbb
--- /dev/null
+++ b/chromeos/chromeos_strings_grd/IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY.png.sha1
@@ -0,0 +1 @@
+de650a83c22f3ace1b727c015a93d2f95b5731b2
\ No newline at end of file
diff --git a/chromeos/components/diagnostics_ui/resources/battery_status_card.js b/chromeos/components/diagnostics_ui/resources/battery_status_card.js
index d21c9e6..7d3598d 100644
--- a/chromeos/components/diagnostics_ui/resources/battery_status_card.js
+++ b/chromeos/components/diagnostics_ui/resources/battery_status_card.js
@@ -15,7 +15,7 @@
 import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
 
-import {BatteryChargeStatus, BatteryHealth, BatteryInfo, RoutineName, SystemDataProviderInterface} from './diagnostics_types.js'
+import {BatteryChargeStatus, BatteryHealth, BatteryInfo, RoutineType, SystemDataProviderInterface} from './diagnostics_types.js'
 import {getSystemDataProvider} from './mojo_interface_provider.js';
 import {mojoString16ToString} from './mojo_utils.js';
 
@@ -65,13 +65,13 @@
       type: Object,
     },
 
-    /** @private {!Array<!RoutineName>} */
+    /** @private {!Array<!RoutineType>} */
     routines_: {
       type: Array,
       value: () => {
         return [
-          RoutineName.kCharge,
-          RoutineName.kDischarge,
+          chromeos.diagnostics.mojom.RoutineType.kBatteryCharge,
+          chromeos.diagnostics.mojom.RoutineType.kBatteryDischarge,
         ];
       }
     },
diff --git a/chromeos/components/diagnostics_ui/resources/cpu_card.js b/chromeos/components/diagnostics_ui/resources/cpu_card.js
index f778ff2..9294ae8 100644
--- a/chromeos/components/diagnostics_ui/resources/cpu_card.js
+++ b/chromeos/components/diagnostics_ui/resources/cpu_card.js
@@ -14,7 +14,7 @@
 import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
 import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
-import {CpuUsage, RoutineName, SystemDataProviderInterface, SystemInfo} from './diagnostics_types.js';
+import {CpuUsage, RoutineType, SystemDataProviderInterface, SystemInfo} from './diagnostics_types.js';
 import {getSystemDataProvider} from './mojo_interface_provider.js';
 
 /**
@@ -40,15 +40,15 @@
   cpuUsageObserverReceiver_: null,
 
   properties: {
-    /** @private {!Array<!RoutineName>} */
+    /** @private {!Array<!RoutineType>} */
     routines_: {
       type: Array,
       value: () => {
         return [
-          RoutineName.kCpuStress,
-          RoutineName.kCpuCache,
-          RoutineName.kFloatingPoint,
-          RoutineName.kPrimeSearch,
+          chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+          chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+          chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
+          chromeos.diagnostics.mojom.RoutineType.kCpuPrime,
         ];
       }
     },
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_types.js b/chromeos/components/diagnostics_ui/resources/diagnostics_types.js
index 0eb58bce..e8c19a0d 100644
--- a/chromeos/components/diagnostics_ui/resources/diagnostics_types.js
+++ b/chromeos/components/diagnostics_ui/resources/diagnostics_types.js
@@ -102,83 +102,42 @@
 
 /**
  * Enumeration of routines.
- * @enum {number}
+ * @typedef {chromeos.diagnostics.mojom.RoutineType}
  */
-export let RoutineName = {
-  kCpuStress: 0,
-  kCpuCache: 1,
-  kFloatingPoint: 2,
-  kPrimeSearch: 3,
-  kMemory: 4,
-  kCharge: 5,
-  kDischarge: 6,
-};
+export let RoutineType;
 
 /**
  * Type alias for StandardRoutineResult.
- * @enum {number}
+ * @typedef {chromeos.diagnostics.mojom.StandardRoutineResult}
  */
-export let StandardRoutineResult = {
-  kTestPassed: 0,
-  kTestFailed: 1,
-  kErrorExecuting: 2,
-  kUnableToRun: 3,
-};
+export let StandardRoutineResult;
 
 /**
- * Type alias for BatteryRateRoutineResult.
- * @typedef {{
- *   result: !StandardRoutineResult,
- *   isCharging: boolean,
- *   percentDelta: number,
- *   timeDeltaSeconds: number,
- * }}
+ * Type alias for PowerRoutineResult.
+ * @typedef {chromeos.diagnostics.mojom.PowerRoutineResult}
  */
-export let BatteryRateRoutineResult;
+export let PowerRoutineResult;
 
 /**
  * Type alias for RoutineResult.
- * @typedef {{
- *   simpleResult: (!StandardRoutineResult|undefined),
- *   batteryRateResult: (!BatteryRateRoutineResult|undefined),
- * }}
+ * @typedef {chromeos.diagnostics.mojom.RoutineResult}
  */
 export let RoutineResult;
 
 /**
  * Type alias for RoutineResultInfo.
- * @typedef {{
- *   name: !RoutineName,
- *   result: !RoutineResult,
- * }}
+ * @typedef {chromeos.diagnostics.mojom.RoutineResultInfo}
  */
 export let RoutineResultInfo;
 
 /**
- * Type of RoutineRunner.onRoutineResult function.
- * @typedef {!function(!RoutineResultInfo)}
- */
-export let RoutineResultFunction;
-
-/**
  * Type alias for RoutineRunner.
- * @typedef {{
- *   onRoutineResult: !RoutineResultFunction,
- * }}
+ * @typedef {chromeos.diagnostics.mojom.RoutineRunnerInterface}
  */
 export let RoutineRunner;
 
 /**
- * Type of SystemRoutineController.RunRoutine function.
- * @typedef {!function(!RoutineName, !RoutineRunner): !Promise}
- */
-export let RunRoutineFunction;
-
-/**
  * Type alias for SystemRoutineControllerInterface.
- * TODO(zentaro): Replace with a real mojo type when implemented.
- * @typedef {{
- *   runRoutine: !RunRoutineFunction,
- * }}
+ * @typedef {chromeos.diagnostics.mojom.SystemRoutineControllerInterface}
  */
 export let SystemRoutineControllerInterface;
diff --git a/chromeos/components/diagnostics_ui/resources/fake_data.js b/chromeos/components/diagnostics_ui/resources/fake_data.js
index 39a26f7..112becd1 100644
--- a/chromeos/components/diagnostics_ui/resources/fake_data.js
+++ b/chromeos/components/diagnostics_ui/resources/fake_data.js
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import { BatteryChargeStatus, BatteryHealth, BatteryInfo, BatteryRateRoutineResult, CpuUsage, ExternalPowerSource, MemoryUsage, RoutineName, StandardRoutineResult, SystemInfo } from './diagnostics_types.js'
-import { stringToMojoString16 } from './mojo_utils.js';
+import {BatteryChargeStatus, BatteryHealth, BatteryInfo, CpuUsage, ExternalPowerSource, MemoryUsage, PowerRoutineResult, RoutineType, StandardRoutineResult, SystemInfo} from './diagnostics_types.js'
+import {stringToMojoString16} from './mojo_utils.js';
 
 /** @type {!Array<!BatteryChargeStatus>} */
 export const fakeBatteryChargeStatus = [
@@ -129,10 +129,10 @@
   cpuModelName: 'BestCpu SoFast 1000',
   cpuThreadsCount: 8,
   cpuMaxClockSpeedKhz: 1000,
-  deviceCapabilities: { hasBattery: true },
+  deviceCapabilities: {hasBattery: true},
   marketingName: 'Coolest Chromebook',
   totalMemoryKib: 128000,
-  versionInfo: { milestoneVersion: 'M99' },
+  versionInfo: {milestoneVersion: 'M99'},
 };
 
 /** @type {!SystemInfo} */
@@ -141,34 +141,49 @@
   cpuModelName: 'BestCpu SoFast 1000',
   cpuThreadsCount: 8,
   cpuMaxClockSpeedKhz: 1000,
-  deviceCapabilities: { hasBattery: false },
+  deviceCapabilities: {hasBattery: false},
   marketingName: 'Coolest Chromebook',
   totalMemoryKib: 128000,
-  versionInfo: { milestoneVersion: 'M99' },
+  versionInfo: {milestoneVersion: 'M99'},
 };
 
-/** @type {!Map<!RoutineName, !StandardRoutineResult>} */
+/** @type {!Map<!RoutineType, !StandardRoutineResult>} */
 export const fakeRoutineResults = new Map([
-  [RoutineName.kCpuStress, StandardRoutineResult.kTestPassed],
-  [RoutineName.kCpuCache, StandardRoutineResult.kTestPassed],
-  [RoutineName.kFloatingPoint, StandardRoutineResult.kTestFailed],
-  [RoutineName.kPrimeSearch, StandardRoutineResult.kErrorExecuting],
-  [RoutineName.kMemory, StandardRoutineResult.kTestPassed],
+  [
+    chromeos.diagnostics.mojom.RoutineType.kCpuStress,
+    chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+  ],
+  [
+    chromeos.diagnostics.mojom.RoutineType.kCpuCache,
+    chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+  ],
+  [
+    chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint,
+    chromeos.diagnostics.mojom.StandardRoutineResult.kTestFailed
+  ],
+  [
+    chromeos.diagnostics.mojom.RoutineType.kCpuPrime,
+    chromeos.diagnostics.mojom.StandardRoutineResult.kExecutionError
+  ],
+  [
+    chromeos.diagnostics.mojom.RoutineType.kMemory,
+    chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed
+  ],
 ]);
 
-/** @type {!Map<!RoutineName, !BatteryRateRoutineResult>} */
-export const fakeBatteryRoutineResults = new Map([
+/** @type {!Map<!RoutineType, !PowerRoutineResult>} */
+export const fakePowerRoutineResults = new Map([
   [
-    RoutineName.kCharge, {
-      result: StandardRoutineResult.kTestPassed,
+    chromeos.diagnostics.mojom.RoutineType.kBatteryCharge, {
+      result: chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed,
       is_charging: true,
       percent_delta: 5,
       time_delta_seconds: 10
     }
   ],
   [
-    RoutineName.kDischarge, {
-      result: StandardRoutineResult.kUnableToRun,
+    chromeos.diagnostics.mojom.RoutineType.kBatteryDischarge, {
+      result: chromeos.diagnostics.mojom.StandardRoutineResult.kUnableToRun,
       is_charging: false,
       percent_delta: 0,
       time_delta_seconds: 0
diff --git a/chromeos/components/diagnostics_ui/resources/fake_system_routine_controller.js b/chromeos/components/diagnostics_ui/resources/fake_system_routine_controller.js
index e1eeb8fe..92d22c8cd 100644
--- a/chromeos/components/diagnostics_ui/resources/fake_system_routine_controller.js
+++ b/chromeos/components/diagnostics_ui/resources/fake_system_routine_controller.js
@@ -5,7 +5,7 @@
 import {assert} from 'chrome://resources/js/assert.m.js';
 import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js';
 
-import {BatteryRateRoutineResult, RoutineName, RoutineResult, RoutineResultInfo, RoutineRunner, StandardRoutineResult} from './diagnostics_types.js';
+import {PowerRoutineResult, RoutineResult, RoutineResultInfo, RoutineRunner, RoutineType, StandardRoutineResult, SystemRoutineControllerInterface} from './diagnostics_types.js';
 import {FakeMethodResolver} from './fake_method_resolver.js';
 
 /**
@@ -13,12 +13,13 @@
  * Implements a fake version of the SystemRoutineController mojo interface.
  */
 
+/** @implements {SystemRoutineControllerInterface} */
 export class FakeSystemRoutineController {
   constructor() {
     /** @private {!FakeMethodResolver} */
     this.methods_ = new FakeMethodResolver();
 
-    /** private !Map<!RoutineName, !RoutineResult> */
+    /** private !Map<!RoutineType, !RoutineResult> */
     this.routineResults_ = new Map();
 
     /**
@@ -42,17 +43,17 @@
     this.remote_ = null;
 
     /**
-     * Holds the name of the routine currently running.
-     * @private {?RoutineName}
+     * Holds the type of the routine currently running.
+     * @private {?RoutineType}
      */
-    this.routineName_ = null;
+    this.routineType_ = null;
 
     this.registerMethods();
   }
 
   /*
    * Implements SystemRoutineController.GetSupportedRoutines
-   * @return {!Promise<!{routines: !Array<!RoutineName>}>}
+   * @return {!Promise<!{routines: !Array<!RoutineType>}>}
    */
   getSupportedRoutines() {
     return this.methods_.resolveMethod('getSupportedRoutines');
@@ -60,7 +61,7 @@
 
   /**
    * Sets the value that will be returned when calling getSupportedRoutines().
-   * @param {!Array<!RoutineName>} routines
+   * @param {!Array<!RoutineType>} routines
    */
   setFakeSupportedRoutines(routines) {
     this.methods_.setResult('getSupportedRoutines', {routines: routines});
@@ -68,14 +69,14 @@
 
   /*
    * Implements SystemRoutineController.RunRoutine.
-   * @param {!RoutineName} routineName
+   * @param {!RoutineType} routineType
    * @param {!RoutineRunner} remoteRunner
    * @return {!Promise}
    */
-  runRoutine(routineName, remoteRunner) {
+  runRoutine(routineType, remoteRunner) {
     this.resolver_ = new PromiseResolver();
     this.remote_ = remoteRunner;
-    this.routineName_ = routineName;
+    this.routineType_ = routineType;
 
     // If there is a positive or zero delay then setup a timer, otherwise
     // the routine will wait until resolveRoutineForTesting() is called.
@@ -97,20 +98,20 @@
 
   /**
    *
-   * @param {!RoutineName} routineName
+   * @param {!RoutineType} routineType
    * @param {!StandardRoutineResult} routineResult
    */
-  setFakeStandardRoutineResult(routineName, routineResult) {
-    this.routineResults_.set(routineName, {simpleResult: routineResult});
+  setFakeStandardRoutineResult(routineType, routineResult) {
+    this.routineResults_.set(routineType, {simpleResult: routineResult});
   }
 
   /**
    *
-   * @param {!RoutineName} routineName
-   * @param {!BatteryRateRoutineResult} routineResult
+   * @param {!RoutineType} routineType
+   * @param {!PowerRoutineResult} routineResult
    */
-  setFakeBatteryRateRoutineResult(routineName, routineResult) {
-    this.routineResults_.set(routineName, {batteryRateResult: routineResult});
+  setFakePowerRoutineResult(routineType, routineResult) {
+    this.routineResults_.set(routineType, {powerResult: routineResult});
   }
 
   /**
@@ -155,21 +156,23 @@
 
   /**
    * Returns the expected result for a running routine.
-   * @return {RoutineResultInfo}
+   * @return {!RoutineResultInfo}
    * @private
    */
   getResultInfo_() {
-    assert(this.routineName_ != null);
-    let result = this.routineResults_.get(this.routineName_);
+    assert(this.routineType_ != null);
+    let result = this.routineResults_.get(this.routineType_);
     if (result == undefined) {
-      result = {simpleResult: StandardRoutineResult.kErrorExecuting};
+      result = {
+        simpleResult:
+            chromeos.diagnostics.mojom.StandardRoutineResult.kExecutionError
+      };
     }
 
-    /** @type {!RoutineResultInfo} */
-    const resultInfo = {
-      name: this.routineName_,
+    const resultInfo = /** @type {!RoutineResultInfo} */ ({
+      type: this.routineType_,
       result: result,
-    };
+    });
 
     return resultInfo;
   }
@@ -184,6 +187,6 @@
     this.resolver_.resolve();
     this.resolver_ = null;
     this.remote_ = null;
-    this.routineName_ = null;
+    this.routineType_ = null;
   }
 }
diff --git a/chromeos/components/diagnostics_ui/resources/memory_card.js b/chromeos/components/diagnostics_ui/resources/memory_card.js
index 5db95f6..5dd2d70 100644
--- a/chromeos/components/diagnostics_ui/resources/memory_card.js
+++ b/chromeos/components/diagnostics_ui/resources/memory_card.js
@@ -14,7 +14,7 @@
 import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
 
-import {MemoryUsage, RoutineName, SystemDataProviderInterface} from './diagnostics_types.js'
+import {MemoryUsage, RoutineType, SystemDataProviderInterface} from './diagnostics_types.js'
 import {getSystemDataProvider} from './mojo_interface_provider.js';
 
 /**
@@ -41,12 +41,12 @@
   memoryUsageObserverReceiver_: null,
 
   properties: {
-    /** @private {!Array<!RoutineName>} */
+    /** @private {!Array<!RoutineType>} */
     routines_: {
       type: Array,
       value: () => {
         return [
-          RoutineName.kMemory,
+          chromeos.diagnostics.mojom.RoutineType.kMemory,
         ];
       }
     },
diff --git a/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js b/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js
index 8aa8ee06..8c01f3f3 100644
--- a/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js
+++ b/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js
@@ -10,8 +10,8 @@
 
 import {assert} from 'chrome://resources/js/assert.m.js';
 
-import {BatteryRateRoutineResult, RoutineName, StandardRoutineResult, SystemDataProviderInterface, SystemInfo, SystemRoutineControllerInterface} from './diagnostics_types.js';
-import {fakeBatteryChargeStatus, fakeBatteryHealth, fakeBatteryInfo, fakeBatteryRoutineResults, fakeCpuUsage, fakeMemoryUsage, fakeRoutineResults, fakeSystemInfo} from './fake_data.js';
+import {PowerRoutineResult, RoutineType, StandardRoutineResult, SystemDataProviderInterface, SystemInfo, SystemRoutineControllerInterface} from './diagnostics_types.js';
+import {fakeBatteryChargeStatus, fakeBatteryHealth, fakeBatteryInfo, fakeCpuUsage, fakeMemoryUsage, fakePowerRoutineResults, fakeRoutineResults, fakeSystemInfo} from './fake_data.js';
 import {FakeSystemDataProvider} from './fake_system_data_provider.js';
 import {FakeSystemRoutineController} from './fake_system_routine_controller.js';
 
@@ -22,61 +22,6 @@
  */
 
 /**
- * Sets up a FakeSystemDataProvider to be used at runtime.
- * TODO(zentaro): Remove once mojo bindings are implemented.
- */
-function setupFakeSystemDataProvider_() {
-  // Create provider.
-  let provider = new FakeSystemDataProvider();
-
-  // Setup fake method data.
-  provider.setFakeBatteryChargeStatus(fakeBatteryChargeStatus);
-  provider.setFakeBatteryHealth(fakeBatteryHealth);
-  provider.setFakeBatteryInfo(fakeBatteryInfo);
-  provider.setFakeCpuUsage(fakeCpuUsage);
-  provider.setFakeMemoryUsage(fakeMemoryUsage);
-  provider.setFakeSystemInfo(fakeSystemInfo);
-
-  // Start the timers to generate some observations.
-  provider.startTriggerIntervals();
-
-  // Set the fake provider.
-  setSystemDataProviderForTesting(provider);
-}
-
-/**
- * Sets up a FakeSystemRoutineController to be used at runtime.
- * TODO(zentaro): Remove once mojo bindings are implemented.
- */
-function setupFakeSystemRoutineController_() {
-  // Create controller.
-  let controller = new FakeSystemRoutineController();
-
-  // Add a small delay while running fake routines.
-  controller.setDelayTimeInMillisecondsForTesting(2000);
-
-  // Add fake results for routines.
-  for (const [routine, result] of fakeRoutineResults.entries()) {
-    controller.setFakeStandardRoutineResult(
-        /** @type{!RoutineName} */ (routine),
-        /** @type{!StandardRoutineResult} */ (result));
-  }
-
-  for (const [routine, result] of fakeBatteryRoutineResults.entries()) {
-    controller.setFakeBatteryRateRoutineResult(
-        /** @type {!RoutineName} */ (routine),
-        /** @type {!BatteryRateRoutineResult} */ (result));
-  }
-
-  // Enable fake set of routines.
-  controller.setFakeSupportedRoutines(
-      [...fakeRoutineResults.keys(), ...fakeBatteryRoutineResults.keys()]);
-
-  // Set the fake controller.
-  setSystemRoutineControllerForTesting(controller);
-}
-
-/**
  * @type {?SystemDataProviderInterface}
  */
 let systemDataProvider = null;
@@ -118,8 +63,8 @@
  */
 export function getSystemRoutineController() {
   if (!systemRoutineController) {
-    // TODO(zentaro): Instantiate a real mojo interface here.
-    setupFakeSystemRoutineController_();
+    systemRoutineController =
+        chromeos.diagnostics.mojom.SystemRoutineController.getRemote();
   }
 
   assert(!!systemRoutineController);
diff --git a/chromeos/components/diagnostics_ui/resources/routine_list_executor.js b/chromeos/components/diagnostics_ui/resources/routine_list_executor.js
index badf689..2ad27908 100644
--- a/chromeos/components/diagnostics_ui/resources/routine_list_executor.js
+++ b/chromeos/components/diagnostics_ui/resources/routine_list_executor.js
@@ -4,7 +4,8 @@
 
 import {assert} from 'chrome://resources/js/assert.m.js';
 import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js';
-import {RoutineName, RoutineResult, RoutineResultInfo, SystemRoutineControllerInterface} from './diagnostics_types.js';
+
+import {RoutineResult, RoutineResultInfo, RoutineRunner, RoutineType, SystemRoutineControllerInterface} from './diagnostics_types.js';
 
 /**
  * Represents the execution progress of a test routine.
@@ -23,7 +24,7 @@
  */
 export class ResultStatusItem {
   constructor(routine) {
-    /** @type {!RoutineName} */
+    /** @type {!RoutineType} */
     this.routine = routine;
 
     /** @type {!ExecutionProgress} */
@@ -48,6 +49,10 @@
   constructor() {
     /** @private {!PromiseResolver} */
     this.resolver_ = new PromiseResolver();
+
+    this.routineRunner = new chromeos.diagnostics.mojom.RoutineRunnerReceiver(
+        /** @type {!chromeos.diagnostics.mojom.RoutineRunnerInterface} */ (
+            this));
   }
 
   /**
@@ -56,11 +61,16 @@
    **/
   onRoutineResult(result) {
     this.resolver_.resolve(result);
+    this.close();
   }
 
   whenComplete() {
     return this.resolver_.promise;
   }
+
+  close() {
+    this.routineRunner.$.close();
+  }
 }
 
 /**
@@ -75,13 +85,16 @@
   constructor(routineController) {
     /** @private {!SystemRoutineControllerInterface} */
     this.routineController_ = routineController;
+
+    /** @private {?ExecutionContext} */
+    this.currentExecutionContext_ = null;
   }
 
   /*
    * Executes a list of routines providing a status callback as each test
    * starts and finishes. The return promise will resolve when all tests are
    * completed.
-   * @param {!Array<!RoutineName>} routines
+   * @param {!Array<!RoutineType>} routines
    * @type {!function(!ResultStatusItem)} statusCallback
    * @param {!Promise}
    */
@@ -98,22 +111,31 @@
         status.progress = ExecutionProgress.kRunning;
         statusCallback(status);
 
+        this.currentExecutionContext_ = new ExecutionContext();
         // Create a new remote and execute the next test.
-        let test = new ExecutionContext();
-        return this.routineController_.runRoutine(name, test).then(() => {
-          // When the test completes, notify the status callback of the
-          // result.
-          return test.whenComplete().then((info) => {
-            assert(info.name === name);
-            const status = new ResultStatusItem(name);
-            status.progress = ExecutionProgress.kCompleted;
-            status.result = info.result;
-            statusCallback(status);
-          });
+        this.routineController_.runRoutine(
+            name,
+            this.currentExecutionContext_.routineRunner.$
+                .bindNewPipeAndPassRemote());
+
+        // When the test completes, notify the status callback of the
+        // result.
+        return this.currentExecutionContext_.whenComplete().then((info) => {
+          assert(info.type === name);
+          const status = new ResultStatusItem(name);
+          status.progress = ExecutionProgress.kCompleted;
+          status.result = info.result;
+          statusCallback(status);
         });
       });
     });
 
     return promise;
   }
+
+  close() {
+    if (this.currentExecutionContext_) {
+      this.currentExecutionContext_.close();
+    }
+  }
 }
diff --git a/chromeos/components/diagnostics_ui/resources/routine_result_entry.html b/chromeos/components/diagnostics_ui/resources/routine_result_entry.html
index d639191..2d248649 100644
--- a/chromeos/components/diagnostics_ui/resources/routine_result_entry.html
+++ b/chromeos/components/diagnostics_ui/resources/routine_result_entry.html
@@ -8,7 +8,7 @@
 
 <div class="entryRow">
   <!-- TODO(zentaro): Create mapping to localized strings. -->
-  <div id="routine">[[routineName_]]</div>
+  <div id="routine">[[routineType_]]</div>
   <text-badge id="status" badge-type="[[getBadgeType_(item.progress, item.result)]]"
   		value="[[getBadgeText_(item.progress, item.result)]]"
   		hidden="[[!isTestStarted_(item.progress)]]">
diff --git a/chromeos/components/diagnostics_ui/resources/routine_result_entry.js b/chromeos/components/diagnostics_ui/resources/routine_result_entry.js
index a0791ec..dcc5afc 100644
--- a/chromeos/components/diagnostics_ui/resources/routine_result_entry.js
+++ b/chromeos/components/diagnostics_ui/resources/routine_result_entry.js
@@ -9,30 +9,31 @@
 import {assert, assertNotReached} from 'chrome://resources/js/assert.m.js';
 import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
-import {RoutineName, RoutineResult, StandardRoutineResult} from './diagnostics_types.js';
+
+import {RoutineResult, RoutineType, StandardRoutineResult} from './diagnostics_types.js';
 import {ExecutionProgress, ResultStatusItem} from './routine_list_executor.js';
 import {BadgeType} from './text_badge.js';
 
 /**
  * Resolves a routine name to its corresponding localized string name.
- * @param {!RoutineName} routineName
+ * @param {!RoutineType} routineType
  * @return {string}
  */
-export function getRoutineName(routineName) {
-  switch (routineName) {
-    case RoutineName.kCharge:
+export function getRoutineType(routineType) {
+  switch (routineType) {
+    case chromeos.diagnostics.mojom.RoutineType.kBatteryCharge:
       return loadTimeData.getString('batteryChargeRoutineText');
-    case RoutineName.kDischarge:
+    case chromeos.diagnostics.mojom.RoutineType.kBatteryDischarge:
       return loadTimeData.getString('batteryDischargeRoutineText');
-    case RoutineName.kCpuCache:
+    case chromeos.diagnostics.mojom.RoutineType.kCpuCache:
       return loadTimeData.getString('cpuCacheRoutineText');
-    case RoutineName.kCpuStress:
+    case chromeos.diagnostics.mojom.RoutineType.kCpuStress:
       return loadTimeData.getString('cpuStressRoutineText');
-    case RoutineName.kFloatingPoint:
+    case chromeos.diagnostics.mojom.RoutineType.kCpuFloatingPoint:
       return loadTimeData.getString('cpuFloatingPointAccuracyRoutineText');
-    case RoutineName.kPrimeSearch:
+    case chromeos.diagnostics.mojom.RoutineType.kCpuPrime:
       return loadTimeData.getString('cpuPrimeSearchRoutineText');
-    case RoutineName.kMemory:
+    case chromeos.diagnostics.mojom.RoutineType.kMemory:
       return loadTimeData.getString('memoryRoutineText');
     default:
       // Values should always be found in the enum.
@@ -57,19 +58,21 @@
     },
 
     /** @private */
-    routineName_: {
+    routineType_: {
       type: String,
       computed: 'getRunningRoutineString_(item.routine)',
     },
   },
+
   /**
    * Get the localized string name for the routine.
-   * @param {!RoutineName} routine
+   * @param {!RoutineType} routine
    * @return {string}
    */
   getRunningRoutineString_(routine) {
-    return loadTimeData.getStringF('routineNameText', getRoutineName(routine));
+    return loadTimeData.getStringF('routineNameText', getRoutineType(routine));
   },
+
   /**
    * @param {!RoutineResult} result
    * @return {!StandardRoutineResult}
@@ -83,9 +86,9 @@
       return /** @type {!StandardRoutineResult} */ (result.simpleResult);
     }
 
-    if (result.hasOwnProperty('batteryRateResult')) {
+    if (result.hasOwnProperty('powerResult')) {
       return /** @type {!StandardRoutineResult} */ (
-          result.batteryRateResult.result);
+          result.powerResult.simpleResult);
     }
 
     assertNotReached();
@@ -102,7 +105,7 @@
 
     if (this.item.result &&
         this.getSimpleResult_(this.item.result) ===
-            StandardRoutineResult.kTestPassed) {
+            chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed) {
       return 'SUCCESS';
     }
 
@@ -120,7 +123,7 @@
 
     if (this.item.result &&
         this.getSimpleResult_(this.item.result) ===
-            StandardRoutineResult.kTestPassed) {
+            chromeos.diagnostics.mojom.StandardRoutineResult.kTestPassed) {
       return BadgeType.SUCCESS;
     }
     return BadgeType.ERROR;
diff --git a/chromeos/components/diagnostics_ui/resources/routine_result_list.js b/chromeos/components/diagnostics_ui/resources/routine_result_list.js
index bc3dff11..f3a94298 100644
--- a/chromeos/components/diagnostics_ui/resources/routine_result_list.js
+++ b/chromeos/components/diagnostics_ui/resources/routine_result_list.js
@@ -8,7 +8,7 @@
 
 import {assert} from 'chrome://resources/js/assert.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
-import {RoutineName} from './diagnostics_types.js';
+import {RoutineType} from './diagnostics_types.js';
 import {ResultStatusItem} from './routine_list_executor.js'
 
 /**
@@ -38,7 +38,7 @@
    * Resets the list and creates a new list with all routines in the unstarted
    * state. Called by the parent RoutineResultSection when the user starts
    * a test run.
-   * @param {!Array<!RoutineName>} routines
+   * @param {!Array<!RoutineType>} routines
    */
   initializeTestRun(routines) {
     this.clearRoutines();
@@ -56,7 +56,7 @@
 
   /**
    * Add a new unstarted routine to the end of the list.
-   * @param {!RoutineName} routine
+   * @param {!RoutineType} routine
    * @private
    */
   addRoutine_(routine) {
diff --git a/chromeos/components/diagnostics_ui/resources/routine_section.js b/chromeos/components/diagnostics_ui/resources/routine_section.js
index 008a0bbf..2af7677b 100644
--- a/chromeos/components/diagnostics_ui/resources/routine_section.js
+++ b/chromeos/components/diagnostics_ui/resources/routine_section.js
@@ -13,10 +13,10 @@
 import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
 import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
 
-import {RoutineName, StandardRoutineResult, SystemRoutineControllerInterface} from './diagnostics_types.js';
+import {RoutineType, StandardRoutineResult, SystemRoutineControllerInterface} from './diagnostics_types.js';
 import {getSystemRoutineController} from './mojo_interface_provider.js';
 import {ExecutionProgress, RoutineListExecutor} from './routine_list_executor.js';
-import {getRoutineName} from './routine_result_entry.js';
+import {getRoutineType} from './routine_result_entry.js';
 import {BadgeType} from './text_badge.js';
 
 /**
@@ -48,7 +48,7 @@
   systemRoutineController_: null,
 
   properties: {
-    /** @type {!Array<!RoutineName>} */
+    /** @type {!Array<!RoutineType>} */
     routines: {
       type: Array,
       value: () => [],
@@ -113,11 +113,12 @@
               filteredRoutines,
               (status) => {
                 this.currentTestName_ = loadTimeData.getStringF(
-                    'routineNameText', getRoutineName(status.routine));
+                    'routineNameText', getRoutineType(status.routine));
 
                 if (status.result &&
                     status.result.simpleResult !==
-                        StandardRoutineResult.kTestPassed) {
+                        chromeos.diagnostics.mojom.StandardRoutineResult
+                            .kTestPassed) {
                   this.hasTestFailure_ = true;
                 }
 
@@ -125,13 +126,22 @@
               })
           .then(() => {
             this.executionStatus_ = ExecutionProgress.kCompleted;
-            this.systemRoutineController_ = null;
             this.isTestRunning = false;
+            this.cleanUp_();
           });
     });
   },
 
   /** @private */
+  cleanUp_() {
+    if (this.executor_) {
+      this.executor_.close();
+      this.executor_ = null;
+    }
+    this.systemRoutineController_ = null;
+  },
+
+  /** @private */
   onToggleReportClicked_() {
     // Toggle report list visibility
     this.isReportListHidden_ = !this.isReportListHidden_;
@@ -183,5 +193,10 @@
   },
 
   /** @override */
+  detached() {
+    this.cleanUp_();
+  },
+
+  /** @override */
   created() {},
 });
diff --git a/chromeos/components/local_search_service/BUILD.gn b/chromeos/components/local_search_service/BUILD.gn
index 92942b7..60c5118 100644
--- a/chromeos/components/local_search_service/BUILD.gn
+++ b/chromeos/components/local_search_service/BUILD.gn
@@ -53,6 +53,21 @@
   ]
 }
 
+source_set("local_search_service_provider") {
+  sources = [
+    "local_search_service_provider_for_testing.cc",
+    "local_search_service_provider_for_testing.h",
+    "oop_local_search_service_provider.cc",
+    "oop_local_search_service_provider.h",
+  ]
+
+  deps = [
+    "//chromeos/components/local_search_service:local_search_service",
+    "//chromeos/components/local_search_service/public/cpp:cpp",
+    "//content/public/browser:browser",
+  ]
+}
+
 source_set("local_search_service_proxy") {
   sources = [
     "index_sync_proxy.cc",
@@ -99,6 +114,7 @@
     "inverted_index_search_unittest.cc",
     "inverted_index_unittest.cc",
     "linear_map_search_unittest.cc",
+    "local_search_service_provider_unittest.cc",
     "local_search_service_sync_proxy_unittest.cc",
     "local_search_service_sync_unittest.cc",
     "local_search_service_unittest.cc",
@@ -109,6 +125,7 @@
 
   deps = [
     ":local_search_service",
+    ":local_search_service_provider",
     ":local_search_service_proxy",
     ":test_support",
     "//base/test:test_support",
diff --git a/chromeos/components/local_search_service/local_search_service_provider_for_testing.cc b/chromeos/components/local_search_service/local_search_service_provider_for_testing.cc
new file mode 100644
index 0000000..0c29647
--- /dev/null
+++ b/chromeos/components/local_search_service/local_search_service_provider_for_testing.cc
@@ -0,0 +1,27 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/components/local_search_service/local_search_service_provider_for_testing.h"
+
+#include <memory>
+
+namespace chromeos {
+namespace local_search_service {
+
+LocalSearchServiceProviderForTestting::LocalSearchServiceProviderForTestting() {
+  LocalSearchServiceProvider::Set(this);
+}
+
+LocalSearchServiceProviderForTestting::
+    ~LocalSearchServiceProviderForTestting() {
+  LocalSearchServiceProvider::Set(nullptr);
+}
+
+void LocalSearchServiceProviderForTestting::BindLocalSearchService(
+    mojo::PendingReceiver<mojom::LocalSearchService> receiver) {
+  service_ = std::make_unique<LocalSearchService>(std::move(receiver));
+}
+
+}  // namespace local_search_service
+}  // namespace chromeos
diff --git a/chromeos/components/local_search_service/local_search_service_provider_for_testing.h b/chromeos/components/local_search_service/local_search_service_provider_for_testing.h
new file mode 100644
index 0000000..aad88bf
--- /dev/null
+++ b/chromeos/components/local_search_service/local_search_service_provider_for_testing.h
@@ -0,0 +1,33 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_LOCAL_SEARCH_SERVICE_PROVIDER_FOR_TESTING_H_
+#define CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_LOCAL_SEARCH_SERVICE_PROVIDER_FOR_TESTING_H_
+
+#include "chromeos/components/local_search_service/local_search_service.h"
+#include "chromeos/components/local_search_service/public/cpp/local_search_service_provider.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+// An implementation that runs LocalSearchService in-process for testing
+// purpose.
+class LocalSearchServiceProviderForTestting
+    : public LocalSearchServiceProvider {
+ public:
+  LocalSearchServiceProviderForTestting();
+  ~LocalSearchServiceProviderForTestting() override;
+
+  // LocalSearchServiceProvider:
+  void BindLocalSearchService(
+      mojo::PendingReceiver<mojom::LocalSearchService> receiver) override;
+
+ private:
+  std::unique_ptr<LocalSearchService> service_;
+};
+
+}  // namespace local_search_service
+}  // namespace chromeos
+
+#endif  // CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_LOCAL_SEARCH_SERVICE_PROVIDER_FOR_TESTING_H_
diff --git a/chromeos/components/local_search_service/local_search_service_provider_unittest.cc b/chromeos/components/local_search_service/local_search_service_provider_unittest.cc
new file mode 100644
index 0000000..8476976
--- /dev/null
+++ b/chromeos/components/local_search_service/local_search_service_provider_unittest.cc
@@ -0,0 +1,67 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/components/local_search_service/local_search_service_provider_for_testing.h"
+
+#include <memory>
+
+#include "base/test/task_environment.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+class LocalSearchServiceProviderTest : public testing::Test {
+ public:
+  void SetUp() override {
+    provider_ = std::make_unique<LocalSearchServiceProviderForTestting>();
+  }
+
+ protected:
+  std::unique_ptr<LocalSearchServiceProvider> provider_;
+  base::test::TaskEnvironment task_environment_{
+      base::test::TaskEnvironment::MainThreadType::DEFAULT,
+      base::test::TaskEnvironment::ThreadPoolExecutionMode::QUEUED};
+};
+
+TEST_F(LocalSearchServiceProviderTest, SetUpAndRun) {
+  auto* provider = LocalSearchServiceProvider::Get();
+  mojo::Remote<mojom::LocalSearchService> service;
+  provider->BindLocalSearchService(service.BindNewPipeAndPassReceiver());
+  mojo::Remote<mojom::Index> index_remote;
+
+  // BindIndex
+  bool callback_done = false;
+  std::string error = "";
+  service->BindIndex(IndexId::kCrosSettings, Backend::kLinearMap,
+                     index_remote.BindNewPipeAndPassReceiver(),
+                     mojo::NullRemote(),
+                     base::BindOnce(
+                         [](bool* callback_done, std::string* error,
+                            const base::Optional<std::string>& error_callback) {
+                           *callback_done = true;
+                           if (error_callback)
+                             *error = error_callback.value();
+                         },
+                         &callback_done, &error));
+  task_environment_.RunUntilIdle();
+  ASSERT_TRUE(callback_done);
+  EXPECT_EQ(error, "");
+
+  // GetSize
+  callback_done = false;
+  uint32_t num_items = 0;
+  index_remote->GetSize(base::BindOnce(
+      [](bool* callback_done, uint32_t* num_items, uint64_t size) {
+        *callback_done = true;
+        *num_items = size;
+      },
+      &callback_done, &num_items));
+  task_environment_.RunUntilIdle();
+  ASSERT_TRUE(callback_done);
+  EXPECT_EQ(num_items, 0u);
+}
+
+}  // namespace local_search_service
+}  // namespace chromeos
diff --git a/chromeos/components/local_search_service/oop_local_search_service_provider.cc b/chromeos/components/local_search_service/oop_local_search_service_provider.cc
new file mode 100644
index 0000000..a1dfbfa
--- /dev/null
+++ b/chromeos/components/local_search_service/oop_local_search_service_provider.cc
@@ -0,0 +1,28 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/components/local_search_service/oop_local_search_service_provider.h"
+#include "content/public/browser/service_process_host.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+OopLocalSearchServiceProvider::OopLocalSearchServiceProvider() {
+  LocalSearchServiceProvider::Set(this);
+}
+
+OopLocalSearchServiceProvider::~OopLocalSearchServiceProvider() {
+  LocalSearchServiceProvider::Set(nullptr);
+}
+
+void OopLocalSearchServiceProvider::BindLocalSearchService(
+    mojo::PendingReceiver<mojom::LocalSearchService> receiver) {
+  content::ServiceProcessHost::Launch(
+      std::move(receiver), content::ServiceProcessHost::Options()
+                               .WithDisplayName("Local Search Service")
+                               .Pass());
+}
+
+}  // namespace local_search_service
+}  // namespace chromeos
diff --git a/chromeos/components/local_search_service/oop_local_search_service_provider.h b/chromeos/components/local_search_service/oop_local_search_service_provider.h
new file mode 100644
index 0000000..8addc4d
--- /dev/null
+++ b/chromeos/components/local_search_service/oop_local_search_service_provider.h
@@ -0,0 +1,28 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_OOP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
+#define CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_OOP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
+
+#include "chromeos/components/local_search_service/public/cpp/local_search_service_provider.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+// An implementation that runs LocalSearchService in the LSS service
+// process.
+class OopLocalSearchServiceProvider : public LocalSearchServiceProvider {
+ public:
+  OopLocalSearchServiceProvider();
+  ~OopLocalSearchServiceProvider() override;
+
+  // LocalSearchServiceProvider:
+  void BindLocalSearchService(
+      mojo::PendingReceiver<mojom::LocalSearchService> receiver) override;
+};
+
+}  // namespace local_search_service
+}  // namespace chromeos
+
+#endif  // CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_OOP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
diff --git a/chromeos/components/local_search_service/public/cpp/BUILD.gn b/chromeos/components/local_search_service/public/cpp/BUILD.gn
new file mode 100644
index 0000000..c816ad3
--- /dev/null
+++ b/chromeos/components/local_search_service/public/cpp/BUILD.gn
@@ -0,0 +1,17 @@
+# Copyright 2020 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos")
+
+source_set("cpp") {
+  sources = [
+    "local_search_service_provider.cc",
+    "local_search_service_provider.h",
+  ]
+
+  deps = [
+    "//chromeos/components/local_search_service:local_search_service",
+    "//chromeos/components/local_search_service/public/mojom",
+  ]
+}
diff --git a/chromeos/components/local_search_service/public/cpp/local_search_service_provider.cc b/chromeos/components/local_search_service/public/cpp/local_search_service_provider.cc
new file mode 100644
index 0000000..557afd9
--- /dev/null
+++ b/chromeos/components/local_search_service/public/cpp/local_search_service_provider.cc
@@ -0,0 +1,27 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/components/local_search_service/public/cpp/local_search_service_provider.h"
+
+#include "chromeos/components/local_search_service/local_search_service.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+namespace {
+
+LocalSearchServiceProvider* g_provider = nullptr;
+
+}  // namespace
+
+void LocalSearchServiceProvider::Set(LocalSearchServiceProvider* provider) {
+  g_provider = provider;
+}
+
+LocalSearchServiceProvider* LocalSearchServiceProvider::Get() {
+  return g_provider;
+}
+
+}  // namespace local_search_service
+}  // namespace chromeos
diff --git a/chromeos/components/local_search_service/public/cpp/local_search_service_provider.h b/chromeos/components/local_search_service/public/cpp/local_search_service_provider.h
new file mode 100644
index 0000000..42f4c8b
--- /dev/null
+++ b/chromeos/components/local_search_service/public/cpp/local_search_service_provider.h
@@ -0,0 +1,38 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_PUBLIC_CPP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
+#define CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_PUBLIC_CPP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
+
+#include "chromeos/components/local_search_service/public/mojom/local_search_service.mojom.h"
+#include "mojo/public/cpp/bindings/remote_set.h"
+
+namespace chromeos {
+namespace local_search_service {
+
+// LocalSearchServiceProvider creates an instance of LocalSearchService
+// and runs in LSS service process or in process (depending on the
+// implementation).
+class LocalSearchServiceProvider {
+ public:
+  virtual ~LocalSearchServiceProvider() {}
+
+  // Sets the global LocalSearchServiceProvider instance.
+  // Specifically, there will be a global |g_provider| in this class' .cpp file
+  // and in the anonymous namespace. The Set function will set |g_provider| to
+  // the input |provider|.
+  // This function must be called before the service is requested.
+  static void Set(LocalSearchServiceProvider* provider);
+  static LocalSearchServiceProvider* Get();
+
+  // Binds |receiver| to an instance of the LocalSearchService.
+  // Each call to this method will request a new instance of the service.
+  virtual void BindLocalSearchService(
+      mojo::PendingReceiver<mojom::LocalSearchService> receiver) = 0;
+};
+
+}  // namespace local_search_service
+}  // namespace chromeos
+
+#endif  // CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_PUBLIC_CPP_LOCAL_SEARCH_SERVICE_PROVIDER_H_
diff --git a/chromeos/dbus/power/fake_power_manager_client.cc b/chromeos/dbus/power/fake_power_manager_client.cc
index 45b95aa..fdd69db 100644
--- a/chromeos/dbus/power/fake_power_manager_client.cc
+++ b/chromeos/dbus/power/fake_power_manager_client.cc
@@ -175,6 +175,8 @@
                                 weak_ptr_factory_.GetWeakPtr()));
 }
 
+void FakePowerManagerClient::RequestThermalState() {}
+
 void FakePowerManagerClient::RequestSuspend() {}
 
 void FakePowerManagerClient::RequestRestart(
diff --git a/chromeos/dbus/power/fake_power_manager_client.h b/chromeos/dbus/power/fake_power_manager_client.h
index 4b0007e..fa011dc2 100644
--- a/chromeos/dbus/power/fake_power_manager_client.h
+++ b/chromeos/dbus/power/fake_power_manager_client.h
@@ -102,6 +102,7 @@
   const base::Optional<power_manager::PowerSupplyProperties>& GetLastStatus()
       override;
   void RequestStatusUpdate() override;
+  void RequestThermalState() override;
   void RequestSuspend() override;
   void RequestRestart(power_manager::RequestRestartReason reason,
                       const std::string& description) override;
diff --git a/chromeos/dbus/power/power_manager_client.cc b/chromeos/dbus/power/power_manager_client.cc
index 0542b8a..9ded4ca6 100644
--- a/chromeos/dbus/power/power_manager_client.cc
+++ b/chromeos/dbus/power/power_manager_client.cc
@@ -18,8 +18,8 @@
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/observer_list.h"
+#include "base/power_monitor/power_monitor.h"
 #include "base/power_monitor/power_monitor_device_source.h"
-#include "base/power_monitor/power_observer.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "base/strings/stringprintf.h"
@@ -238,6 +238,7 @@
 
     RegisterSuspendDelays();
     RequestStatusUpdate();
+    RequestThermalState();
     CheckAmbientColorSupport();
   }
 
@@ -348,6 +349,16 @@
             weak_ptr_factory_.GetWeakPtr()));
   }
 
+  void RequestThermalState() override {
+    POWER_LOG(USER) << "RequestThermalState";
+    dbus::MethodCall method_call(power_manager::kPowerManagerInterface,
+                                 power_manager::kGetThermalStateMethod);
+    power_manager_proxy_->CallMethod(
+        &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+        base::BindOnce(&PowerManagerClientImpl::OnGetCurrentThermalStateMethod,
+                       weak_ptr_factory_.GetWeakPtr()));
+  }
+
   void RequestSuspend() override {
     POWER_LOG(USER) << "RequestSuspend";
     SimpleMethodCallToPowerManager(power_manager::kRequestSuspendMethod);
@@ -745,6 +756,29 @@
     }
   }
 
+  void OnGetCurrentThermalStateMethod(dbus::Response* response) {
+    if (!response) {
+      POWER_LOG(ERROR) << "Error calling "
+                       << power_manager::kGetThermalStateMethod;
+      return;
+    }
+
+    dbus::MessageReader reader(response);
+    power_manager::ThermalEvent protobuf;
+    if (!reader.PopArrayOfBytesAsProto(&protobuf)) {
+      POWER_LOG(ERROR) << "Unable to decode "
+                       << power_manager::kGetThermalStateMethod << " response";
+      return;
+    }
+
+    POWER_LOG(USER) << "Got " << power_manager::kGetThermalStateMethod
+                    << " response:"
+                    << " thermal_state=" << protobuf.thermal_state()
+                    << " timestamp=" << protobuf.timestamp();
+    base::PowerMonitorDeviceSource::ThermalEventReceived(
+        GetThermalStateFromProtoEnum(protobuf.thermal_state()));
+  }
+
   void OnGetPowerSupplyPropertiesMethod(dbus::Response* response) {
     // This is the last callback to run after all the initialization in |Init|.
     // Notify all observers that the initialization is complete.
diff --git a/chromeos/dbus/power/power_manager_client.h b/chromeos/dbus/power/power_manager_client.h
index eaf93bf..70225cf 100644
--- a/chromeos/dbus/power/power_manager_client.h
+++ b/chromeos/dbus/power/power_manager_client.h
@@ -17,6 +17,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
+#include "base/power_monitor/power_observer.h"
 #include "base/time/time.h"
 #include "chromeos/dbus/dbus_method_call_status.h"
 #include "chromeos/dbus/power_manager/policy.pb.h"
@@ -229,6 +230,9 @@
   // will be called asynchronously.
   virtual void RequestStatusUpdate() = 0;
 
+  // Requests the current thermal state.
+  virtual void RequestThermalState() = 0;
+
   // Requests suspend of the system.
   virtual void RequestSuspend() = 0;
 
diff --git a/chromeos/dbus/power/power_manager_client_unittest.cc b/chromeos/dbus/power/power_manager_client_unittest.cc
index a4df1af..2ab77da 100644
--- a/chromeos/dbus/power/power_manager_client_unittest.cc
+++ b/chromeos/dbus/power/power_manager_client_unittest.cc
@@ -270,6 +270,10 @@
                      _, _))
         .WillRepeatedly(
             Invoke(this, &PowerManagerClientTest::RegisterSuspendDelay));
+    // Init should request the current thermal state
+    EXPECT_CALL(
+        *proxy_,
+        DoCallMethod(HasMember(power_manager::kGetThermalStateMethod), _, _));
     // Init should also request a fresh power status.
     EXPECT_CALL(
         *proxy_,
diff --git a/chromeos/lacros/lacros_chrome_service_impl.cc b/chromeos/lacros/lacros_chrome_service_impl.cc
index a9f3797..89c5c408 100644
--- a/chromeos/lacros/lacros_chrome_service_impl.cc
+++ b/chromeos/lacros/lacros_chrome_service_impl.cc
@@ -363,20 +363,6 @@
                        ToMojo(delegate_->GetChromeVersion())));
   }
 
-  if (IsAccountManagerAvailable()) {
-    mojo::PendingReceiver<crosapi::mojom::AccountManager>
-        account_manager_receiver =
-            account_manager_remote_.BindNewPipeAndPassReceiver();
-    never_blocking_sequence_->PostTask(
-        FROM_HERE,
-        base::BindOnce(
-            &LacrosChromeServiceNeverBlockingState::BindAccountManagerReceiver,
-            weak_sequenced_state_, std::move(account_manager_receiver)));
-  } else {
-    LOG(WARNING) << "Connected to an older version of ash. Account consistency "
-                    "will not be available";
-  }
-
   if (IsFileManagerAvailable()) {
     mojo::PendingReceiver<crosapi::mojom::FileManager> pending_receiver =
         file_manager_remote_.BindNewPipeAndPassReceiver();
@@ -434,6 +420,16 @@
              AshChromeService::MethodMinVersions::kBindAccountManagerMinVersion;
 }
 
+void LacrosChromeServiceImpl::BindAccountManagerReceiver(
+    mojo::PendingReceiver<crosapi::mojom::AccountManager> pending_receiver) {
+  DCHECK(IsAccountManagerAvailable());
+  never_blocking_sequence_->PostTask(
+      FROM_HERE,
+      base::BindOnce(
+          &LacrosChromeServiceNeverBlockingState::BindAccountManagerReceiver,
+          weak_sequenced_state_, std::move(pending_receiver)));
+}
+
 bool LacrosChromeServiceImpl::IsFileManagerAvailable() {
   base::Optional<uint32_t> version = AshChromeServiceVersion();
   return version &&
diff --git a/chromeos/lacros/lacros_chrome_service_impl.h b/chromeos/lacros/lacros_chrome_service_impl.h
index 9aa79ac..c7c1494 100644
--- a/chromeos/lacros/lacros_chrome_service_impl.h
+++ b/chromeos/lacros/lacros_chrome_service_impl.h
@@ -162,17 +162,6 @@
       mojo::PendingReceiver<media_session::mojom::MediaControllerManager>
           remote);
 
-  // account_manager_remote() can only be used if this method returns true.
-  bool IsAccountManagerAvailable();
-
-  // This must be called on the affine sequence. It exposes a remote that can
-  // be used to interact with accounts in Chrome OS Account Manager.
-  mojo::Remote<crosapi::mojom::AccountManager>& account_manager_remote() {
-    DCHECK_CALLED_ON_VALID_SEQUENCE(affine_sequence_checker_);
-    DCHECK(IsAccountManagerAvailable());
-    return account_manager_remote_;
-  }
-
   // file_manager_remote() can only be used if this method returns true.
   bool IsFileManagerAvailable();
 
@@ -197,6 +186,13 @@
   void BindScreenManagerReceiver(
       mojo::PendingReceiver<crosapi::mojom::ScreenManager> pending_receiver);
 
+  // BindAccountManagerReceiver() can only be used if this method returns true.
+  bool IsAccountManagerAvailable();
+
+  // This may be called on any thread.
+  void BindAccountManagerReceiver(
+      mojo::PendingReceiver<crosapi::mojom::AccountManager> pending_receiver);
+
   // OnLacrosStartup method of AshChromeService crosapi can only be called
   // if this method returns true.
   bool IsOnLacrosStartupAvailable();
@@ -251,7 +247,6 @@
   mojo::Remote<device::mojom::HidManager> hid_manager_remote_;
   mojo::Remote<crosapi::mojom::Feedback> feedback_remote_;
   mojo::Remote<crosapi::mojom::KeystoreService> keystore_service_remote_;
-  mojo::Remote<crosapi::mojom::AccountManager> account_manager_remote_;
   mojo::Remote<crosapi::mojom::FileManager> file_manager_remote_;
 
   // This member is instantiated on the affine sequence alongside the
diff --git a/chromeos/profiles/orderfile.newest.txt b/chromeos/profiles/orderfile.newest.txt
index 5f3f8f8..43e8514 100644
--- a/chromeos/profiles/orderfile.newest.txt
+++ b/chromeos/profiles/orderfile.newest.txt
@@ -1 +1 @@
-chromeos-chrome-orderfile-field-88-4305.0-1604314829-benchmark-88.0.4312.0-r1.orderfile.xz
+chromeos-chrome-orderfile-field-88-4314.0-1605523684-benchmark-88.0.4324.12-r1.orderfile.xz
diff --git a/components/autofill/core/browser/geo/subkey_requester.cc b/components/autofill/core/browser/geo/subkey_requester.cc
index 0eb5da27..11c8fda 100644
--- a/components/autofill/core/browser/geo/subkey_requester.cc
+++ b/components/autofill/core/browser/geo/subkey_requester.cc
@@ -38,8 +38,8 @@
         address_validator_(address_validator),
         on_subkeys_received_(std::move(on_subkeys_received)),
         has_responded_(false),
-        on_timeout_(base::BindRepeating(&SubKeyRequest::OnRulesLoaded,
-                                        base::Unretained(this))) {
+        on_timeout_(base::BindOnce(&SubKeyRequest::OnRulesLoaded,
+                                   base::Unretained(this))) {
     base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, on_timeout_.callback(),
         base::TimeDelta::FromSeconds(timeout_seconds));
@@ -74,7 +74,7 @@
   SubKeyReceiverCallback on_subkeys_received_;
 
   bool has_responded_;
-  base::CancelableCallback<void()> on_timeout_;
+  base::CancelableOnceClosure on_timeout_;
 
   DISALLOW_COPY_AND_ASSIGN(SubKeyRequest);
 };
diff --git a/components/autofill_assistant/browser/service/service_request_sender_impl.cc b/components/autofill_assistant/browser/service/service_request_sender_impl.cc
index fdff213..f147669d 100644
--- a/components/autofill_assistant/browser/service/service_request_sender_impl.cc
+++ b/components/autofill_assistant/browser/service/service_request_sender_impl.cc
@@ -48,6 +48,8 @@
   if (loader->ResponseInfo() && loader->ResponseInfo()->headers) {
     response_code = loader->ResponseInfo()->headers->response_code();
   }
+  VLOG(3) << "Received response: status=" << response_code << ", "
+          << response_str.length() << " bytes";
   std::move(callback).Run(response_code, response_str);
 }
 
diff --git a/components/content_settings/core/browser/BUILD.gn b/components/content_settings/core/browser/BUILD.gn
index 2ce3bb2..2955ab54 100644
--- a/components/content_settings/core/browser/BUILD.gn
+++ b/components/content_settings/core/browser/BUILD.gn
@@ -28,7 +28,6 @@
     "content_settings_pref.h",
     "content_settings_pref_provider.cc",
     "content_settings_pref_provider.h",
-    "content_settings_provider.cc",
     "content_settings_provider.h",
     "content_settings_registry.cc",
     "content_settings_registry.h",
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.cc b/components/content_settings/core/browser/content_settings_policy_provider.cc
index d14878c..383e27f 100644
--- a/components/content_settings/core/browser/content_settings_policy_provider.cc
+++ b/components/content_settings/core/browser/content_settings_policy_provider.cc
@@ -24,8 +24,6 @@
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/pref_service.h"
 
-namespace content_settings {
-
 namespace {
 
 struct PrefsForManagedContentSettingsMapEntry {
@@ -88,31 +86,10 @@
          ContentSettingsType::INSECURE_PRIVATE_NETWORK, CONTENT_SETTING_ALLOW},
 };
 
-class VectorRuleIterator : public RuleIterator {
- public:
-  VectorRuleIterator(const std::vector<Rule>::const_iterator& begin,
-                     const std::vector<Rule>::const_iterator& end)
-      : current_rule(begin), end_rule(end) {}
-
-  ~VectorRuleIterator() override {}
-
-  bool HasNext() const override { return current_rule != end_rule; }
-
-  Rule Next() override {
-    Rule rule(current_rule->primary_pattern, current_rule->secondary_pattern,
-              current_rule->value.Clone(), current_rule->expiration,
-              current_rule->session_model);
-    current_rule++;
-    return rule;
-  }
-
- private:
-  std::vector<Rule>::const_iterator current_rule;
-  std::vector<Rule>::const_iterator end_rule;
-};
-
 }  // namespace
 
+namespace content_settings {
+
 // The preferences used to manage the default policy value for
 // ContentSettingsTypes.
 struct PolicyProvider::PrefsForManagedDefaultMapEntry {
@@ -322,17 +299,6 @@
   return value_map_.GetRuleIterator(content_type, &lock_);
 }
 
-std::unique_ptr<RuleIterator> PolicyProvider::GetDiscardedRuleIterator(
-    ContentSettingsType content_type,
-    bool incognito) const {
-  auto it = discarded_rules_value_map_.find(content_type);
-  if (it == discarded_rules_value_map_.end()) {
-    return std::make_unique<EmptyRuleIterator>(EmptyRuleIterator());
-  }
-  return std::make_unique<VectorRuleIterator>(it->second.begin(),
-                                              it->second.end());
-}
-
 void PolicyProvider::GetContentSettingsFromPreferences(
     OriginIdentifierValueMap* value_map) {
   for (size_t i = 0; i < base::size(kPrefsForManagedContentSettingsMap); ++i) {
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.h b/components/content_settings/core/browser/content_settings_policy_provider.h
index 52a7f33..fe9233c 100644
--- a/components/content_settings/core/browser/content_settings_policy_provider.h
+++ b/components/content_settings/core/browser/content_settings_policy_provider.h
@@ -35,10 +35,6 @@
       ContentSettingsType content_type,
       bool incognito) const override;
 
-  std::unique_ptr<RuleIterator> GetDiscardedRuleIterator(
-      ContentSettingsType content_type,
-      bool incognito) const override;
-
   bool SetWebsiteSetting(
       const ContentSettingsPattern& primary_pattern,
       const ContentSettingsPattern& secondary_pattern,
@@ -75,8 +71,6 @@
 
   OriginIdentifierValueMap value_map_;
 
-  std::map<ContentSettingsType, std::vector<Rule>> discarded_rules_value_map_;
-
   PrefService* prefs_;
 
   PrefChangeRegistrar pref_change_registrar_;
diff --git a/components/content_settings/core/browser/content_settings_provider.cc b/components/content_settings/core/browser/content_settings_provider.cc
deleted file mode 100644
index cbc351b..0000000
--- a/components/content_settings/core/browser/content_settings_provider.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/content_settings/core/browser/content_settings_provider.h"
-
-namespace content_settings {
-std::unique_ptr<RuleIterator> ProviderInterface::GetDiscardedRuleIterator(
-    ContentSettingsType content_type,
-    bool incognito) const {
-  return std::make_unique<EmptyRuleIterator>();
-}
-}  // namespace content_settings
\ No newline at end of file
diff --git a/components/content_settings/core/browser/content_settings_provider.h b/components/content_settings/core/browser/content_settings_provider.h
index 7dfbaef..a87df22 100644
--- a/components/content_settings/core/browser/content_settings_provider.h
+++ b/components/content_settings/core/browser/content_settings_provider.h
@@ -37,15 +37,6 @@
       ContentSettingsType content_type,
       bool incognito) const = 0;
 
-  // Returns a |RuleIterator| over the discarded content setting rules stored
-  // by this provider. If |incognito| is true, the iterator returns only the
-  // content settings which are applicable to the incognito mode. Otherwise,
-  // it returns the content settings which are applicable only to the normal
-  // mode.
-  virtual std::unique_ptr<RuleIterator> GetDiscardedRuleIterator(
-      ContentSettingsType content_type,
-      bool incognito) const;
-
   // Asks the provider to set the website setting for a particular
   // |primary_pattern|, |secondary_pattern|, |content_type| tuple. If the
   // provider accepts the setting it returns true and takes the ownership of the
diff --git a/components/content_settings/core/browser/content_settings_rule.cc b/components/content_settings/core/browser/content_settings_rule.cc
index 20c44d4b..416cbee 100644
--- a/components/content_settings/core/browser/content_settings_rule.cc
+++ b/components/content_settings/core/browser/content_settings_rule.cc
@@ -63,14 +63,4 @@
   return to_return;
 }
 
-EmptyRuleIterator::~EmptyRuleIterator() = default;
-
-bool EmptyRuleIterator::HasNext() const {
-  return false;
-}
-
-Rule EmptyRuleIterator::Next() {
-  return Rule();
-}
-
 }  // namespace content_settings
diff --git a/components/content_settings/core/browser/content_settings_rule.h b/components/content_settings/core/browser/content_settings_rule.h
index c338abe8..016b772 100644
--- a/components/content_settings/core/browser/content_settings_rule.h
+++ b/components/content_settings/core/browser/content_settings_rule.h
@@ -46,16 +46,6 @@
   virtual Rule Next() = 0;
 };
 
-class EmptyRuleIterator : public RuleIterator {
- public:
-  ~EmptyRuleIterator() override;
-
- protected:
-  // RuleIterator:
-  bool HasNext() const override;
-  Rule Next() override;
-};
-
 class ConcatenationIterator : public RuleIterator {
  public:
   // |auto_lock| can be null if no locking is needed.
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 25a386b..863e325 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -420,27 +420,6 @@
   }
 }
 
-void HostContentSettingsMap::GetDiscardedSettingsForOneType(
-    ContentSettingsType content_type,
-    ContentSettingsForOneType* settings) const {
-  DCHECK(settings);
-  UsedContentSettingsProviders();
-
-  for (const auto& provider_pair : content_settings_providers_) {
-    std::unique_ptr<content_settings::RuleIterator> discarded_rule_iterator(
-        provider_pair.second->GetDiscardedRuleIterator(content_type,
-                                                       is_off_the_record_));
-    while (discarded_rule_iterator->HasNext()) {
-      content_settings::Rule discarded_rule = discarded_rule_iterator->Next();
-      settings->emplace_back(
-          discarded_rule.primary_pattern, discarded_rule.secondary_pattern,
-          std::move(discarded_rule.value),
-          kProviderNamesSourceMap[provider_pair.first].provider_name,
-          is_off_the_record_, discarded_rule.expiration);
-    }
-  }
-}
-
 void HostContentSettingsMap::SetDefaultContentSetting(
     ContentSettingsType content_type,
     ContentSetting setting) {
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h
index ad703bf..1aca963f 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -158,13 +158,6 @@
                              base::Optional<content_settings::SessionModel>
                                  session_model = base::nullopt) const;
 
-  // Returns settings that are not applied.
-  // Example: Pattern for flash that are still set through enterprise policy but
-  // won't have any effect because they are deprecated.
-  void GetDiscardedSettingsForOneType(
-      ContentSettingsType content_type,
-      ContentSettingsForOneType* settings) const;
-
   // Sets the default setting for a particular content type. This method must
   // not be invoked on an incognito map.
   //
diff --git a/components/device_event_log/device_event_log.h b/components/device_event_log/device_event_log.h
index 40d22e5..bc5e626 100644
--- a/components/device_event_log/device_event_log.h
+++ b/components/device_event_log/device_event_log.h
@@ -71,6 +71,9 @@
 #define SERIAL_PLOG(level)                         \
   DEVICE_PLOG(::device_event_log::LOG_TYPE_SERIAL, \
               ::device_event_log::LOG_LEVEL_##level)
+#define CAMERA_LOG(level)                         \
+  DEVICE_LOG(::device_event_log::LOG_TYPE_CAMERA, \
+             ::device_event_log::LOG_LEVEL_##level)
 
 #if defined(OS_ANDROID) && defined(OFFICIAL_BUILD)
 // FIDO_LOG is discarded for release Android builds in order to reduce binary
@@ -129,8 +132,10 @@
   LOG_TYPE_FIDO = 8,
   // Serial port related events (i.e. services/device/serial).
   LOG_TYPE_SERIAL = 9,
+  // Camera related events.
+  LOG_TYPE_CAMERA = 10,
   // Used internally, must be the last type (may be changed).
-  LOG_TYPE_UNKNOWN = 10
+  LOG_TYPE_UNKNOWN = 11
 };
 
 // Used to specify the detail level for logging. In GetAsString, used to
diff --git a/components/device_event_log/device_event_log_impl.cc b/components/device_event_log/device_event_log_impl.cc
index 5f4db33..cb915f66 100644
--- a/components/device_event_log/device_event_log_impl.cc
+++ b/components/device_event_log/device_event_log_impl.cc
@@ -38,6 +38,7 @@
 const char* kLogTypePrinterDesc = "Printer";
 const char* kLogTypeFidoDesc = "FIDO";
 const char* kLogTypeSerialDesc = "Serial";
+const char* kLogTypeCameraDesc = "Camera";
 
 enum class ShowTime {
   kNone,
@@ -67,6 +68,8 @@
       return kLogTypeFidoDesc;
     case LOG_TYPE_SERIAL:
       return kLogTypeSerialDesc;
+    case LOG_TYPE_CAMERA:
+      return kLogTypeCameraDesc;
     case LOG_TYPE_UNKNOWN:
       break;
   }
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc
index 58a2052..f9cf11ab 100644
--- a/components/feed/feed_feature_list.cc
+++ b/components/feed/feed_feature_list.cc
@@ -49,6 +49,10 @@
 const base::Feature kInterestFeedNoticeCardAutoDismiss{
     "InterestFeedNoticeCardAutoDismiss", base::FEATURE_DISABLED_BY_DEFAULT};
 
+// Used for A:B testing of a bug fix (crbug.com/1151391).
+const base::Feature kInterestFeedSpinnerAlwaysAnimate{
+    "InterestFeedSpinnerAlwaysAnimate", base::FEATURE_DISABLED_BY_DEFAULT};
+
 const char kDefaultReferrerUrl[] =
     "https://www.googleapis.com/auth/chrome-content-suggestions";
 
diff --git a/components/feed/feed_feature_list.h b/components/feed/feed_feature_list.h
index 744781b..432ba98 100644
--- a/components/feed/feed_feature_list.h
+++ b/components/feed/feed_feature_list.h
@@ -33,6 +33,8 @@
 
 extern const base::Feature kInterestFeedNoticeCardAutoDismiss;
 
+extern const base::Feature kInterestFeedSpinnerAlwaysAnimate;
+
 std::string GetFeedReferrerUrl();
 
 }  // namespace feed
diff --git a/components/media_router/browser/issue_manager.h b/components/media_router/browser/issue_manager.h
index 1358983..8e3d84f5 100644
--- a/components/media_router/browser/issue_manager.h
+++ b/components/media_router/browser/issue_manager.h
@@ -64,9 +64,10 @@
 
  private:
   // Issues tracked internally by the IssueManager.
-  // TODO(imcheng): Rather than holding a base::CancelableClosure, it might be a
-  // bit simpler to use a CancelableTaskTracker and track TaskIds here. This
-  // will require adding support for delayed tasks to CancelableTaskTracker.
+  // TODO(imcheng): Rather than holding a base::CancelableOnceClosure, it might
+  // be a bit simpler to use a CancelableTaskTracker and track TaskIds here.
+  // This will require adding support for delayed tasks to
+  // CancelableTaskTracker.
   struct Entry {
     Entry(const Issue& issue,
           std::unique_ptr<base::CancelableOnceClosure>
diff --git a/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc b/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
index 10cf719..ec62fe1 100644
--- a/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
+++ b/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
@@ -12,6 +12,12 @@
 
 const char kHistogramFirstPaintAfterBackForwardCacheRestore[] =
     "PageLoad.PaintTiming.NavigationToFirstPaint.AfterBackForwardCacheRestore";
+const char kHistogramFirstRequestAnimationFrameAfterBackForwardCacheRestore[] =
+    "PageLoad.PaintTiming.NavigationToFirstPaint.BFCachePolyfillFirst";
+const char kHistogramSecondRequestAnimationFrameAfterBackForwardCacheRestore[] =
+    "PageLoad.PaintTiming.NavigationToFirstPaint.BFCachePolyfillSecond";
+const char kHistogramThirdRequestAnimationFrameAfterBackForwardCacheRestore[] =
+    "PageLoad.PaintTiming.NavigationToFirstPaint.BFCachePolyfillThird";
 const char kHistogramFirstInputDelayAfterBackForwardCacheRestore[] =
     "PageLoad.InteractiveTiming.FirstInputDelay.AfterBackForwardCacheRestore";
 extern const char
@@ -98,6 +104,27 @@
 }
 
 void BackForwardCachePageLoadMetricsObserver::
+    OnRequestAnimationFramesAfterBackForwardCacheRestoreInPage(
+        const page_load_metrics::mojom::BackForwardCacheTiming& timing) {
+  auto request_animation_frames =
+      timing.request_animation_frames_after_back_forward_cache_restore;
+  DCHECK_EQ(request_animation_frames.size(), 3u);
+
+  PAGE_LOAD_HISTOGRAM(
+      internal::
+          kHistogramFirstRequestAnimationFrameAfterBackForwardCacheRestore,
+      request_animation_frames[0]);
+  PAGE_LOAD_HISTOGRAM(
+      internal::
+          kHistogramSecondRequestAnimationFrameAfterBackForwardCacheRestore,
+      request_animation_frames[1]);
+  PAGE_LOAD_HISTOGRAM(
+      internal::
+          kHistogramThirdRequestAnimationFrameAfterBackForwardCacheRestore,
+      request_animation_frames[2]);
+}
+
+void BackForwardCachePageLoadMetricsObserver::
     OnFirstInputAfterBackForwardCacheRestoreInPage(
         const page_load_metrics::mojom::BackForwardCacheTiming& timing,
         size_t index) {
diff --git a/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h b/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h
index 199877c..a708f5cb 100644
--- a/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h
+++ b/components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h
@@ -35,6 +35,8 @@
   void OnFirstPaintAfterBackForwardCacheRestoreInPage(
       const page_load_metrics::mojom::BackForwardCacheTiming& timing,
       size_t index) override;
+  void OnRequestAnimationFramesAfterBackForwardCacheRestoreInPage(
+      const page_load_metrics::mojom::BackForwardCacheTiming& timing) override;
   void OnFirstInputAfterBackForwardCacheRestoreInPage(
       const page_load_metrics::mojom::BackForwardCacheTiming& timing,
       size_t index) override;
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h
index a033809c..c3326d6 100644
--- a/components/page_load_metrics/browser/page_load_metrics_observer.h
+++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -375,6 +375,13 @@
       const mojom::BackForwardCacheTiming& timing,
       size_t index) {}
 
+  // This is called several times on requestAnimationFrame after the page is
+  // restored from the back-forward cache. The number of the calls is hard-
+  // coded as WebPerformance::
+  // kRequestAnimationFramesToRecordAfterBackForwardCacheRestore.
+  virtual void OnRequestAnimationFramesAfterBackForwardCacheRestoreInPage(
+      const mojom::BackForwardCacheTiming& timing) {}
+
   // Unlike other paint callbacks, OnFirstMeaningfulPaintInMainFrameDocument is
   // tracked per document, and is reported for the main frame document only.
   virtual void OnFirstMeaningfulPaintInMainFrameDocument(
diff --git a/components/page_load_metrics/browser/page_load_tracker.cc b/components/page_load_metrics/browser/page_load_tracker.cc
index a10302b..06e69d7f 100644
--- a/components/page_load_metrics/browser/page_load_tracker.cc
+++ b/components/page_load_metrics/browser/page_load_tracker.cc
@@ -141,6 +141,18 @@
                                                                i);
     }
 
+    auto request_animation_frames =
+        new_timings[i]
+            ->request_animation_frames_after_back_forward_cache_restore;
+    if (request_animation_frames.size() == 3 &&
+        (i >= last_timings.size() ||
+         last_timings[i]
+             ->request_animation_frames_after_back_forward_cache_restore
+             .empty())) {
+      observer->OnRequestAnimationFramesAfterBackForwardCacheRestoreInPage(
+          *new_timings[i]);
+    }
+
     auto first_input_delay =
         new_timings[i]->first_input_delay_after_back_forward_cache_restore;
     if (first_input_delay.has_value() &&
diff --git a/components/page_load_metrics/common/page_load_metrics.mojom b/components/page_load_metrics/common/page_load_metrics.mojom
index 59e1863..91f1187 100644
--- a/components/page_load_metrics/common/page_load_metrics.mojom
+++ b/components/page_load_metrics/common/page_load_metrics.mojom
@@ -353,6 +353,10 @@
   // is restored from the back-forward cache.
   mojo_base.mojom.TimeDelta first_paint_after_back_forward_cache_restore;
 
+  // Times on requestAnimationFrame when the page is restored from the back-
+  // forward cache.
+  array<mojo_base.mojom.TimeDelta> request_animation_frames_after_back_forward_cache_restore;
+
   // Queueing Time of the first click, tap, key press, cancellable touchstart,
   // or pointer down followed by a pointer up after the time when the page is
   // restored from the back-forward cache.
diff --git a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc
index 7a363c6..d82de1b69 100644
--- a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc
+++ b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc
@@ -528,6 +528,13 @@
             ->first_paint_after_back_forward_cache_restore =
             ClampDelta(first_paint, navigation_start);
       }
+      for (double raf : restore_timing.request_animation_frames) {
+        if (!raf)
+          break;
+        back_forward_cache_timing
+            ->request_animation_frames_after_back_forward_cache_restore
+            .push_back(ClampDelta(raf, navigation_start));
+      }
       if (first_input_delay.has_value()) {
         back_forward_cache_timing
             ->first_input_delay_after_back_forward_cache_restore =
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index 94ac2169..8084446 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -1015,7 +1015,7 @@
   if (sync_completion) {
     deletions_have_synced_callbacks_.push_back(std::move(sync_completion));
     // Start a timeout for sync, or restart it if it was already running.
-    deletions_have_synced_timeout_.Reset(base::BindRepeating(
+    deletions_have_synced_timeout_.Reset(base::BindOnce(
         &PasswordStore::NotifyDeletionsHaveSynced, this, /*success=*/false));
     background_task_runner_->PostDelayedTask(
         FROM_HERE, deletions_have_synced_timeout_.callback(),
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h
index ea7f15a..aacd0f0 100644
--- a/components/password_manager/core/browser/password_store.h
+++ b/components/password_manager/core/browser/password_store.h
@@ -893,7 +893,7 @@
   // background thread, but the callbacks must be run on the main thread!
   std::vector<base::OnceCallback<void(bool)>> deletions_have_synced_callbacks_;
   // Timeout closure that runs if sync takes too long to propagate deletions.
-  base::CancelableClosure deletions_have_synced_timeout_;
+  base::CancelableOnceClosure deletions_have_synced_timeout_;
 
   bool shutdown_called_ = false;
 
diff --git a/components/payments/content/android/BUILD.gn b/components/payments/content/android/BUILD.gn
index 91bfc62..fd453cf 100644
--- a/components/payments/content/android/BUILD.gn
+++ b/components/payments/content/android/BUILD.gn
@@ -153,6 +153,7 @@
     "//base:base_java",
     "//base:jni_java",
     "//components/autofill/android:autofill_java",
+    "//components/embedder_support/android:util_java",
     "//components/page_info/android:java",
     "//components/payments/mojom:mojom_java",
     "//components/url_formatter/android:url_formatter_java",
diff --git a/components/payments/content/android/DEPS b/components/payments/content/android/DEPS
index 9edb460..34406efc 100644
--- a/components/payments/content/android/DEPS
+++ b/components/payments/content/android/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/embedder_support/android",
   "+components/payments/content/android/jni_headers",
   "+mojo/public/java",
   "+services/network/public/cpp",
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/BrowserPaymentRequest.java b/components/payments/content/android/java/src/org/chromium/components/payments/BrowserPaymentRequest.java
index 1a643df..28ed87a0 100644
--- a/components/payments/content/android/java/src/org/chromium/components/payments/BrowserPaymentRequest.java
+++ b/components/payments/content/android/java/src/org/chromium/components/payments/BrowserPaymentRequest.java
@@ -105,7 +105,7 @@
      * Called when the PaymentRequestSpec is validated.
      * @param spec The validated PaymentRequestSpec.
      */
-    default void onSpecValidated(PaymentRequestSpec spec) {}
+    void onSpecValidated(PaymentRequestSpec spec);
 
     /**
      * Adds the PaymentAppFactory(s) specified by the implementers to the given PaymentAppService.
@@ -121,9 +121,7 @@
      * @return Whether at least one payment app (including basic-card payment app) is available
      *         (excluding the pending apps).
      */
-    default boolean hasAvailableApps() {
-        return false;
-    }
+    boolean hasAvailableApps();
 
     /**
      * Shows the payment apps selector.
@@ -135,16 +133,14 @@
      * @return The error of the showing if any; null if success.
      */
     @Nullable
-    default String showAppSelector(boolean isShowWaitingForUpdatedDetails, PaymentItem total,
-            PaymentOptions paymentOptions, boolean isUserGestureShow) {
-        return null;
-    }
+    String showAppSelector(boolean isShowWaitingForUpdatedDetails, PaymentItem total,
+            PaymentOptions paymentOptions, boolean isUserGestureShow);
 
     /**
      * Notifies the payment UI service of the payment apps pending to be handled
      * @param pendingApps The payment apps that are pending to be handled.
      */
-    default void notifyPaymentUiOfPendingApps(List<PaymentApp> pendingApps) {}
+    void notifyPaymentUiOfPendingApps(List<PaymentApp> pendingApps);
 
     /**
      * Skips the app selector UI whether it is currently opened or not, and if applicable, invokes a
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentRequestService.java b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentRequestService.java
index 5a3b214..db79b539 100644
--- a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentRequestService.java
+++ b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentRequestService.java
@@ -13,6 +13,7 @@
 import org.chromium.base.LocaleUtils;
 import org.chromium.base.Log;
 import org.chromium.components.autofill.EditableOption;
+import org.chromium.components.embedder_support.util.UrlConstants;
 import org.chromium.components.page_info.CertificateChainHelper;
 import org.chromium.components.payments.BrowserPaymentRequest.Factory;
 import org.chromium.components.url_formatter.UrlFormatter;
@@ -45,6 +46,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * {@link PaymentRequestService}, {@link MojoPaymentRequestGateKeeper} and
@@ -327,8 +329,17 @@
             return null;
         }
 
+        for (PaymentMethodData datum : methodData) {
+            if (datum == null || TextUtils.isEmpty(datum.supportedMethod)) {
+                abortBeforeInstantiation(client, journeyLogger,
+                        ErrorStrings.INVALID_PAYMENT_METHODS_OR_DATA,
+                        AbortReason.INVALID_DATA_FROM_RENDERER);
+                return null;
+            }
+        }
+
         // details has default value, so could never be null, according to payment_request.idl.
-        if (details == null) {
+        if (details == null || details.id == null || details.total == null) {
             abortBeforeInstantiation(client, journeyLogger, ErrorStrings.INVALID_PAYMENT_DETAILS,
                     AbortReason.INVALID_DATA_FROM_RENDERER);
             return null;
@@ -506,7 +517,8 @@
         mQueryForQuota = new HashMap<>(methodData);
         mBrowserPaymentRequest.modifyQueryForQuotaCreatedIfNeeded(mQueryForQuota, mPaymentOptions);
 
-        if (!PaymentValidator.validatePaymentDetails(details)) {
+        if (details == null || details.id == null || details.total == null
+                || !PaymentValidator.validatePaymentDetails(details)) {
             mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
             disconnectFromClientWithDebugMessage(
                     ErrorStrings.INVALID_PAYMENT_DETAILS, PaymentErrorReason.USER_CANCEL);
@@ -907,6 +919,7 @@
         if (methodDataList.length == 0) return null;
         Map<String, PaymentMethodData> result = new ArrayMap<>();
         for (PaymentMethodData methodData : methodDataList) {
+            if (methodData == null) return null;
             String methodName = methodData.supportedMethod;
             if (TextUtils.isEmpty(methodName)) return null;
             result.put(methodName, methodData);
@@ -976,6 +989,83 @@
         return mBrowserPaymentRequest.triggerPaymentAppUiSkipIfApplicable(mIsUserGestureShow);
     }
 
+    /**
+     * @param options The payment options specified in the payment request.
+     * @param allApps All available payment apps.
+     * @return true when there is exactly one available payment app which can provide all requested
+     * information including shipping address and payer's contact information whenever needed.
+     */
+    private static boolean onlySingleAppCanProvideAllRequiredInformation(
+            PaymentOptions options, List<PaymentApp> allApps) {
+        if (!PaymentOptionsUtils.requestAnyInformation(options)) {
+            return allApps.size() == 1 && !((PaymentApp) allApps.get(0)).isAutofillInstrument();
+        }
+
+        boolean anAppCanProvideAllInfo = false;
+        for (int i = 0; i < allApps.size(); i++) {
+            PaymentApp app = (PaymentApp) allApps.get(i);
+            if ((!options.requestShipping || app.handlesShippingAddress())
+                    && (!options.requestPayerName || app.handlesPayerName())
+                    && (!options.requestPayerPhone || app.handlesPayerPhone())
+                    && (!options.requestPayerEmail || app.handlesPayerEmail())) {
+                // There is more than one available app that can provide all merchant requested
+                // information information.
+                if (anAppCanProvideAllInfo) return false;
+
+                anAppCanProvideAllInfo = true;
+            }
+        }
+        return anAppCanProvideAllInfo;
+    }
+
+    /**
+     * @param methods The payment methods supported by the payment request.
+     * @return True when at least one url payment method identifier is specified in payment
+     *         request.
+     */
+    private static boolean isUrlPaymentMethodIdentifiersSupported(Set<String> methods) {
+        for (String methodName : methods) {
+            if (methodName.startsWith(UrlConstants.HTTPS_URL_PREFIX)
+                    || methodName.startsWith(UrlConstants.HTTP_URL_PREFIX)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @param isUserGestureShow Whether the PaymentRequest.show() is triggered by user gesture.
+     * @param skipUiForNonUrlPaymentMethodIdentifiers True when skip UI is available for non-url
+     *         based payment method identifiers (e.g., basic-card).
+     * @param options The payment options specified in the payment request.
+     * @param paymentMethods The payment methods supported by this request.
+     * @param selectedApp The selected payment apps.
+     * @param allApps All available payment apps.
+     * @return Whether the browser payment sheet should be skipped directly into the payment app.
+     */
+    public static boolean shouldSkipShowingPaymentRequestUi(boolean isUserGestureShow,
+            boolean skipUiForNonUrlPaymentMethodIdentifiers, PaymentOptions options,
+            Set<String> paymentMethods, PaymentApp selectedApp, List<PaymentApp> allApps) {
+        boolean urlPaymentMethodIdentifiersSupported =
+                isUrlPaymentMethodIdentifiersSupported(paymentMethods);
+
+        // If there is only a single payment app which can provide all merchant requested
+        // information, we can safely go directly to the payment app instead of showing Payment
+        // Request UI.
+        return PaymentFeatureList.isEnabled(PaymentFeatureList.WEB_PAYMENTS_SINGLE_APP_UI_SKIP)
+                // Only allowing payment apps that own their own UIs.
+                // This excludes AutofillPaymentInstrument as its UI is rendered inline in
+                // the payment request UI, thus can't be skipped.
+                && (urlPaymentMethodIdentifiersSupported || skipUiForNonUrlPaymentMethodIdentifiers)
+                && allApps.size() >= 1
+                && onlySingleAppCanProvideAllRequiredInformation(options, allApps)
+                // Skip to payment app only if it can be pre-selected.
+                && selectedApp != null
+                // Skip to payment app only if user gesture is provided when it is required to
+                // skip-UI.
+                && (isUserGestureShow || !selectedApp.isUserGestureRequiredToSkipUi());
+    }
+
     // Implements PaymentDetailsConverter.MethodChecker:
     @Override
     public boolean isInvokedInstrumentValidForPaymentMethodIdentifier(
@@ -1038,7 +1128,9 @@
             return;
         }
 
-        if (!PaymentValidator.validatePaymentDetails(details)
+        // ID cannot be updated. Updating the total is optional.
+        if (details == null || details.id != null
+                || !PaymentValidator.validatePaymentDetails(details)
                 || !mBrowserPaymentRequest.parseAndValidateDetailsFurtherIfNeeded(details)) {
             mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
             disconnectFromClientWithDebugMessage(
diff --git a/components/payments/content/android/java_templates/ErrorStrings.java.tmpl b/components/payments/content/android/java_templates/ErrorStrings.java.tmpl
index 5e9409e..5c58f25 100644
--- a/components/payments/content/android/java_templates/ErrorStrings.java.tmpl
+++ b/components/payments/content/android/java_templates/ErrorStrings.java.tmpl
@@ -18,10 +18,6 @@
 
     public static final String INVALID_PAYMENT_METHODS_OR_DATA = "Invalid payment methods or data.";
 
-    public static final String INVALID_PAYMENT_DETAILS = "Invalid payment details.";
-
-    public static final String INVALID_PAYMENT_OPTIONS = "Invalid payment options.";
-
     public static final String INVALID_VALIDATION_ERRORS = "Invalid payment validation errors.";
 
     public static final String TAB_OVERVIEW_MODE =
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc
index c5c8598..31229b1 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -174,15 +174,21 @@
     return;
   }
 
-  std::string error;
-  if (!ValidatePaymentDetails(ConvertPaymentDetails(details), &error)) {
-    log_.Error(error);
+  if (!details || !details->id || !details->total) {
+    log_.Error(errors::kInvalidPaymentDetails);
     TerminateConnection();
     return;
   }
 
-  if (!details->total) {
-    log_.Error(errors::kTotalRequired);
+  if (!options) {
+    log_.Error(errors::kInvalidPaymentOptions);
+    TerminateConnection();
+    return;
+  }
+
+  std::string error;
+  if (!ValidatePaymentDetails(ConvertPaymentDetails(details), &error)) {
+    log_.Error(error);
     TerminateConnection();
     return;
   }
@@ -371,6 +377,13 @@
     return;
   }
 
+  // ID cannot be updated. Updating the total is optional.
+  if (!details || details->id) {
+    log_.Error(errors::kInvalidPaymentDetails);
+    TerminateConnection();
+    return;
+  }
+
   std::string error;
   if (!ValidatePaymentDetails(ConvertPaymentDetails(details), &error)) {
     log_.Error(error);
diff --git a/components/payments/core/error_strings.cc b/components/payments/core/error_strings.cc
index 87c8330..c1a54fd 100644
--- a/components/payments/core/error_strings.cc
+++ b/components/payments/core/error_strings.cc
@@ -37,6 +37,8 @@
 const char kStrictBasicCardShowReject[] = "User does not have valid information on file.";
 const char kTotalRequired[] = "Total required.";
 const char kUserCancelled[] = "User closed the Payment Request UI.";
+const char kInvalidPaymentDetails[] = "Invalid payment details.";
+const char kInvalidPaymentOptions[] = "Invalid payment options.";
 // clang-format on
 }  // namespace errors
 }  // namespace payments
diff --git a/components/payments/core/error_strings.h b/components/payments/core/error_strings.h
index 063a401..3b2b426e 100644
--- a/components/payments/core/error_strings.h
+++ b/components/payments/core/error_strings.h
@@ -101,6 +101,13 @@
 // Used when user dismissed the Payment Request dialog.
 extern const char kUserCancelled[];
 
+// Used when the renderer does not provide valid payment details, such as a null
+// struct or missing ID or total.
+extern const char kInvalidPaymentDetails[];
+
+// Used when the renderer does not provide valid options, such as a null struct.
+extern const char kInvalidPaymentOptions[];
+
 }  // namespace errors
 }  // namespace payments
 
diff --git a/components/permissions/BUILD.gn b/components/permissions/BUILD.gn
index 10c8d34..4861029 100644
--- a/components/permissions/BUILD.gn
+++ b/components/permissions/BUILD.gn
@@ -27,6 +27,8 @@
     "notification_permission_ui_selector.h",
     "permission_auditing_database.cc",
     "permission_auditing_database.h",
+    "permission_auditing_service.cc",
+    "permission_auditing_service.h",
     "permission_context_base.cc",
     "permission_context_base.h",
     "permission_decision_auto_blocker.cc",
@@ -145,6 +147,7 @@
     "chooser_context_base_unittest.cc",
     "contexts/geolocation_permission_context_unittest.cc",
     "permission_auditing_database_unittest.cc",
+    "permission_auditing_service_unittest.cc",
     "permission_context_base_unittest.cc",
     "permission_decision_auto_blocker_unittest.cc",
     "permission_manager_unittest.cc",
diff --git a/components/permissions/permission_auditing_database.cc b/components/permissions/permission_auditing_database.cc
index 585e2f1..ea3cab9 100644
--- a/components/permissions/permission_auditing_database.cc
+++ b/components/permissions/permission_auditing_database.cc
@@ -53,6 +53,7 @@
 PermissionAuditingDatabase::~PermissionAuditingDatabase() = default;
 
 bool PermissionAuditingDatabase::Init(const base::FilePath& path) {
+  db_.set_histogram_tag("Permission Auditing Logs");
   if (!db_.Open(path)) {
     return false;
   }
diff --git a/components/permissions/permission_auditing_database.h b/components/permissions/permission_auditing_database.h
index 8295790c..113f20b 100644
--- a/components/permissions/permission_auditing_database.h
+++ b/components/permissions/permission_auditing_database.h
@@ -47,7 +47,7 @@
 
   // Appends a new permission usage `session` of the given permission `type` on
   // a given `origin`. The `session` must be valid according to IsValid().
-  // Operation will fail in case if a session with the same primary key, that
+  // Operation will fail if a session with the same primary key, that
   // is, origin, type, and usage start time, already exists in the database.
   // Returns if the operation was successful.
   bool StorePermissionUsage(const PermissionUsageSession& session);
diff --git a/components/permissions/permission_auditing_service.cc b/components/permissions/permission_auditing_service.cc
new file mode 100644
index 0000000..3f8120b
--- /dev/null
+++ b/components/permissions/permission_auditing_service.cc
@@ -0,0 +1,130 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/permissions/permission_auditing_service.h"
+
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/files/file_util.h"
+#include "components/permissions/permission_auditing_database.h"
+
+namespace {
+
+// Specifies the permissions usage session lifetime. Each session older
+// than this value is to be deleted.
+constexpr base::TimeDelta kUsageSessionMaxAge = base::TimeDelta::FromDays(90);
+
+// Specifies the time period between the regular sessions deletions.
+constexpr base::TimeDelta kUsageSessionCullingInterval =
+    base::TimeDelta::FromMinutes(30);
+
+}  // namespace
+
+namespace permissions {
+
+PermissionAuditingService::PermissionAuditingService(
+    scoped_refptr<base::SequencedTaskRunner> backend_task_runner)
+    : backend_task_runner_(backend_task_runner) {}
+
+PermissionAuditingService::~PermissionAuditingService() {
+  if (db_) {
+    backend_task_runner_->DeleteSoon(FROM_HERE, db_);
+    db_ = nullptr;
+  }
+}
+
+void PermissionAuditingService::Init(const base::FilePath& database_path) {
+  DCHECK(!db_);
+  db_ = new PermissionAuditingDatabase();
+  backend_task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(base::IgnoreResult(&PermissionAuditingDatabase::Init),
+                     base::Unretained(db_), database_path));
+}
+
+void PermissionAuditingService::StartPeriodicCullingOfExpiredSessions() {
+  timer_.Start(
+      FROM_HERE, kUsageSessionCullingInterval,
+      base::BindRepeating(&PermissionAuditingService::ExpireOldSessions,
+                          this->AsWeakPtr()));
+}
+
+void PermissionAuditingService::StorePermissionUsage(
+    const PermissionUsageSession& session) {
+  DCHECK(db_);
+  backend_task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(
+          base::IgnoreResult(&PermissionAuditingDatabase::StorePermissionUsage),
+          base::Unretained(db_), session));
+}
+
+void PermissionAuditingService::GetPermissionUsageHistory(
+    ContentSettingsType type,
+    const url::Origin& origin,
+    base::Time start_time,
+    PermissionUsageHistoryCallback result_callback) {
+  DCHECK(db_);
+  backend_task_runner_->PostTaskAndReplyWithResult(
+      FROM_HERE,
+      base::BindOnce(&PermissionAuditingDatabase::GetPermissionUsageHistory,
+                     base::Unretained(db_), type, origin, start_time),
+      std::move(result_callback));
+}
+
+void PermissionAuditingService::GetLastPermissionUsageTime(
+    ContentSettingsType type,
+    const url::Origin& origin,
+    LastPermissionUsageTimeCallback result_callback) {
+  DCHECK(db_);
+  backend_task_runner_->PostTaskAndReplyWithResult(
+      FROM_HERE,
+      base::BindOnce(&PermissionAuditingDatabase::GetLastPermissionUsageTime,
+                     base::Unretained(db_), type, origin),
+      std::move(result_callback));
+}
+
+void PermissionAuditingService::UpdateEndTime(ContentSettingsType type,
+                                              const url::Origin& origin,
+                                              base::Time start_time,
+                                              base::Time new_end_time) {
+  DCHECK(db_);
+  backend_task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(
+          base::IgnoreResult(&PermissionAuditingDatabase::UpdateEndTime),
+          base::Unretained(db_), type, origin, start_time, new_end_time));
+}
+
+void PermissionAuditingService::DeleteSessionsBetween(base::Time start,
+                                                      base::Time end) {
+  DCHECK(db_);
+  backend_task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(base::IgnoreResult(
+                         &PermissionAuditingDatabase::DeleteSessionsBetween),
+                     base::Unretained(db_), start, end));
+}
+
+void PermissionAuditingService::ExpireOldSessions() {
+  DCHECK(db_);
+  backend_task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(base::IgnoreResult(
+                         &PermissionAuditingDatabase::DeleteSessionsBetween),
+                     base::Unretained(db_), base::Time(),
+                     base::Time::Now() - kUsageSessionMaxAge));
+}
+
+// static
+base::TimeDelta PermissionAuditingService::GetUsageSessionMaxAge() {
+  return kUsageSessionMaxAge;
+}
+
+// static
+base::TimeDelta PermissionAuditingService::GetUsageSessionCullingInterval() {
+  return kUsageSessionCullingInterval;
+}
+
+}  // namespace permissions
diff --git a/components/permissions/permission_auditing_service.h b/components/permissions/permission_auditing_service.h
new file mode 100644
index 0000000..71934c4
--- /dev/null
+++ b/components/permissions/permission_auditing_service.h
@@ -0,0 +1,113 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_PERMISSIONS_PERMISSION_AUDITING_SERVICE_H_
+#define COMPONENTS_PERMISSIONS_PERMISSION_AUDITING_SERVICE_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/scoped_refptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/sequenced_task_runner.h"
+#include "base/timer/timer.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+#include "components/keyed_service/core/keyed_service.h"
+#include "url/origin.h"
+
+namespace base {
+class FilePath;
+class Time;
+class TimeDelta;
+}  // namespace base
+
+namespace permissions {
+
+class PermissionAuditingDatabase;
+struct PermissionUsageSession;
+
+// Keeps a client-side log of when websites use permission-gated capabilities to
+// allow the user to audit usage.
+//
+// For each combination of permission type and origin, the history is
+// stored on disk as a series of PermissionUsageSessions. Sessions expire
+// at the latest after 3 months, or when browsing data or history is cleared.
+class PermissionAuditingService
+    : public KeyedService,
+      public base::SupportsWeakPtr<PermissionAuditingService> {
+ public:
+  typedef base::OnceCallback<void(std::vector<PermissionUsageSession>)>
+      PermissionUsageHistoryCallback;
+
+  typedef base::OnceCallback<void(base::Optional<base::Time>)>
+      LastPermissionUsageTimeCallback;
+
+  explicit PermissionAuditingService(
+      scoped_refptr<base::SequencedTaskRunner> backend_task_runner);
+
+  ~PermissionAuditingService() override;
+
+  // Initializes Permission Auditing database in `database_path`.
+  void Init(const base::FilePath& database_path);
+
+  // Starts the periodic deletions of outdated sessions.
+  void StartPeriodicCullingOfExpiredSessions();
+
+  // Appends a new permission usage `session` of the given permission `type` on
+  // a given `origin`. `session` must be valid according to IsValid().
+  // Operation will fail if a session with the same primary key, that is,
+  // origin, type, and usage start time, already exists.
+  void StorePermissionUsage(const PermissionUsageSession& session);
+
+  // Returns the detailed history stored for the permission `type` on a given
+  // `origin` from the specified `start_time` inclusive. The `origin` must not
+  // be opaque. History is provided via `result_callback`. History isn't ordered
+  // in any way.
+  void GetPermissionUsageHistory(
+      ContentSettingsType type,
+      const url::Origin& origin,
+      base::Time start_time,
+      PermissionUsageHistoryCallback result_callback);
+
+  // Returns when the given permission `type` was last used on a given `origin`.
+  // The `origin` must not be opaque. Time is provided via `result_callback`.
+  void GetLastPermissionUsageTime(
+      ContentSettingsType type,
+      const url::Origin& origin,
+      LastPermissionUsageTimeCallback result_callback);
+
+  // Updates the usage end time for a specific usage session. The session is
+  // identified by the primary key {`type`, `origin`, `start_time`}, and must
+  // already exist. `start_time` and `new_end_time` must be not null, and
+  // `start_time` must be less than or equal to `new_end_time`.
+  void UpdateEndTime(ContentSettingsType type,
+                     const url::Origin& origin,
+                     base::Time start_time,
+                     base::Time new_end_time);
+
+  // Deletes permission usage sessions, which started or ended in the given
+  // time range inclusive. A null `start_time` or `end_time` time is treated as
+  // -inf and +inf, respectively.
+  void DeleteSessionsBetween(base::Time start, base::Time end);
+
+  // Returns sessions maximum lifetime.
+  static base::TimeDelta GetUsageSessionMaxAge();
+
+  // Returns the time delta between two consequent expiration iterations.
+  static base::TimeDelta GetUsageSessionCullingInterval();
+
+ private:
+  void ExpireOldSessions();
+
+  scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
+
+  // Lives on the |backend_task_runner_|, and must only be accessed on that
+  // sequence. It is safe to assume the database is alive as long as |db_| is
+  // non-null.
+  PermissionAuditingDatabase* db_ = nullptr;
+
+  base::RepeatingTimer timer_;
+};
+
+}  // namespace permissions
+
+#endif  // COMPONENTS_PERMISSIONS_PERMISSION_AUDITING_SERVICE_H_
diff --git a/components/permissions/permission_auditing_service_unittest.cc b/components/permissions/permission_auditing_service_unittest.cc
new file mode 100644
index 0000000..96af4bb
--- /dev/null
+++ b/components/permissions/permission_auditing_service_unittest.cc
@@ -0,0 +1,252 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/permissions/permission_auditing_service.h"
+
+#include <memory>
+#include <vector>
+
+#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
+#include "base/run_loop.h"
+#include "base/stl_util.h"
+#include "base/strings/stringprintf.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
+#include "base/test/bind.h"
+#include "base/test/task_environment.h"
+#include "base/time/clock.h"
+#include "components/permissions/permission_usage_session.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace permissions {
+
+using ::testing::ElementsAre;
+using ::testing::IsEmpty;
+using ::testing::UnorderedElementsAre;
+
+namespace {
+
+constexpr base::Time kTestTimes[] = {
+    base::Time() + base::TimeDelta::FromDays(1),
+    base::Time() + base::TimeDelta::FromDays(2),
+    base::Time() + base::TimeDelta::FromDays(3)};
+
+constexpr ContentSettingsType kTestTypes[] = {
+    ContentSettingsType::MEDIASTREAM_MIC,
+    ContentSettingsType::MEDIASTREAM_CAMERA};
+
+constexpr const char* kTestOrigins[] = {
+    "https://foo1.com", "https://foo2.com", "https://foo3.com",
+    "https://foo4.com", "https://foo5.com",
+};
+
+PermissionUsageSession BuildUsageSession(base::Time usage_start_time,
+                                         base::Time usage_end_time) {
+  return {.origin = url::Origin::Create(GURL(kTestOrigins[0])),
+          .type = kTestTypes[0],
+          .usage_start = usage_start_time,
+          .usage_end = usage_end_time,
+          .had_user_activation = false,
+          .was_foreground = false,
+          .had_focus = false};
+}
+
+PermissionUsageSession BuildUsageSession(ContentSettingsType type,
+                                         const url::Origin& origin) {
+  return {.origin = origin,
+          .type = type,
+          .usage_start = kTestTimes[0],
+          .usage_end = kTestTimes[1],
+          .had_user_activation = false,
+          .was_foreground = false,
+          .had_focus = false};
+}
+
+}  // namespace
+
+class PermissionAuditingServiceTest : public testing::Test {
+ public:
+  PermissionAuditingServiceTest() = default;
+
+ protected:
+  PermissionAuditingService& service() { return *service_.get(); }
+
+  base::test::TaskEnvironment& task_environment() { return task_environment_; }
+
+  void SetUp() override {
+    backend_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner(
+        {base::MayBlock(), base::TaskPriority::USER_VISIBLE});
+    service_ =
+        std::make_unique<PermissionAuditingService>(backend_task_runner_);
+    ASSERT_TRUE(temp_directory_.CreateUniqueTempDir());
+    base::FilePath database_path = temp_directory_.GetPath().Append(
+        FILE_PATH_LITERAL("test_permission_auditing_database"));
+    service_->Init(database_path);
+    service_->StartPeriodicCullingOfExpiredSessions();
+  }
+
+  void TearDown() override {
+    // Ensure the database is destroyed on the |backend_task_runner_|.
+    service_.reset();
+    task_environment_.RunUntilIdle();
+  }
+
+  std::vector<PermissionUsageSession> GetPermissionUsageHistory(
+      ContentSettingsType type,
+      const url::Origin& origin,
+      base::Time start_time) {
+    base::RunLoop run_loop;
+    std::vector<PermissionUsageSession> history;
+    service().GetPermissionUsageHistory(
+        type, origin, start_time,
+        base::BindLambdaForTesting(
+            [&](std::vector<PermissionUsageSession> sessions) {
+              history = std::move(sessions);
+              run_loop.QuitWhenIdle();
+            }));
+    run_loop.Run();
+    return history;
+  }
+
+  base::Time GetLastPermissionUsageTime(ContentSettingsType type,
+                                        const url::Origin& origin) {
+    base::RunLoop run_loop;
+    base::Time last_usage_time;
+    service().GetLastPermissionUsageTime(
+        type, origin,
+        base::BindLambdaForTesting([&](base::Optional<base::Time> time) {
+          last_usage_time = time.value_or(base::Time());
+          run_loop.QuitWhenIdle();
+        }));
+    run_loop.Run();
+    return last_usage_time;
+  }
+
+ private:
+  base::ScopedTempDir temp_directory_;
+
+  std::unique_ptr<PermissionAuditingService> service_;
+
+  base::test::TaskEnvironment task_environment_{
+      base::test::TaskEnvironment::TimeSource::MOCK_TIME};
+
+  scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
+};
+
+TEST_F(PermissionAuditingServiceTest, StorePermissionUsage) {
+  std::vector<url::Origin> origins(base::size(kTestOrigins));
+  std::vector<PermissionUsageSession> sessions(base::size(kTestOrigins));
+  for (size_t i = 0; i < base::size(kTestOrigins); ++i) {
+    origins[i] = url::Origin::Create(GURL(kTestOrigins[i]));
+    sessions[i] = BuildUsageSession(kTestTypes[i % 2], origins[i]);
+    service().StorePermissionUsage(sessions[i]);
+  }
+  for (size_t i = 0; i < base::size(kTestOrigins); ++i) {
+    EXPECT_THAT(
+        GetPermissionUsageHistory(kTestTypes[i % 2], origins[i], base::Time()),
+        ElementsAre(sessions[i]));
+  }
+}
+
+TEST_F(PermissionAuditingServiceTest, GetLastPermissionUsageTime) {
+  std::vector<url::Origin> origins(base::size(kTestOrigins));
+  for (size_t i = 0; i < base::size(kTestOrigins); ++i) {
+    origins[i] = url::Origin::Create(GURL(kTestOrigins[i]));
+    service().StorePermissionUsage(
+        BuildUsageSession(kTestTypes[0], origins[i]));
+    task_environment().FastForwardBy(base::TimeDelta());
+    EXPECT_EQ(GetLastPermissionUsageTime(kTestTypes[0], origins[i]),
+              kTestTimes[1]);
+  }
+}
+
+TEST_F(PermissionAuditingServiceTest, UpdateEndTime) {
+  std::vector<url::Origin> origins(base::size(kTestOrigins));
+  for (size_t i = 0; i < base::size(kTestOrigins); ++i) {
+    origins[i] = url::Origin::Create(GURL(kTestOrigins[i]));
+    service().StorePermissionUsage(
+        BuildUsageSession(kTestTypes[1], origins[i]));
+  }
+  for (const auto& origin : origins) {
+    service().UpdateEndTime(kTestTypes[1], origin, kTestTimes[0],
+                            kTestTimes[2]);
+    EXPECT_EQ(GetLastPermissionUsageTime(kTestTypes[1], origin), kTestTimes[2]);
+  }
+}
+
+TEST_F(PermissionAuditingServiceTest, DeleteSessionsBetween) {
+  auto session1 = BuildUsageSession(kTestTimes[0], kTestTimes[1]);
+  auto session2 = BuildUsageSession(kTestTimes[1], kTestTimes[2]);
+  auto origin = url::Origin::Create(GURL(kTestOrigins[0]));
+  auto type = session1.type;
+  session1.origin = origin;
+  session2.origin = origin;
+  auto store_sessions = [&]() {
+    service().StorePermissionUsage(session1);
+    service().StorePermissionUsage(session2);
+    task_environment().FastForwardBy(base::TimeDelta());
+  };
+  auto history = [&]() -> std::vector<PermissionUsageSession> {
+    return GetPermissionUsageHistory(type, origin, base::Time());
+  };
+  store_sessions();
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2));
+  service().DeleteSessionsBetween(kTestTimes[0], kTestTimes[1]);
+  ASSERT_THAT(history(), IsEmpty());
+
+  store_sessions();
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2));
+  service().DeleteSessionsBetween(kTestTimes[1], kTestTimes[2]);
+  ASSERT_THAT(history(), IsEmpty());
+
+  store_sessions();
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2));
+  service().DeleteSessionsBetween(kTestTimes[0], kTestTimes[2]);
+  ASSERT_THAT(history(), IsEmpty());
+
+  store_sessions();
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2));
+  service().DeleteSessionsBetween(kTestTimes[0], kTestTimes[0]);
+  ASSERT_THAT(history(), ElementsAre(session2));
+  service().DeleteSessionsBetween(kTestTimes[1], kTestTimes[1]);
+  ASSERT_THAT(history(), IsEmpty());
+
+  store_sessions();
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2));
+  service().DeleteSessionsBetween(kTestTimes[2], kTestTimes[2]);
+  ASSERT_THAT(history(), ElementsAre(session1));
+  service().DeleteSessionsBetween(kTestTimes[1], kTestTimes[1]);
+  ASSERT_THAT(history(), IsEmpty());
+}
+
+TEST_F(PermissionAuditingServiceTest, OldSessionsAreExpired) {
+  auto delay = service().GetUsageSessionCullingInterval();
+  auto time1 = base::Time::Now() - service().GetUsageSessionMaxAge() + delay;
+  auto time2 = time1 + 2 * delay;
+  auto time3 = time2 + 2 * delay;
+  auto session1 = BuildUsageSession(time1, time1);
+  auto session2 = BuildUsageSession(time2, time2);
+  auto session3 = BuildUsageSession(time3, time3);
+  service().StorePermissionUsage(session1);
+  service().StorePermissionUsage(session2);
+  service().StorePermissionUsage(session3);
+  auto history = [&]() -> std::vector<PermissionUsageSession> {
+    return GetPermissionUsageHistory(kTestTypes[0],
+                                     url::Origin::Create(GURL(kTestOrigins[0])),
+                                     base::Time());
+  };
+
+  ASSERT_THAT(history(), UnorderedElementsAre(session1, session2, session3));
+  task_environment().FastForwardBy(2 * delay);
+  ASSERT_THAT(history(), UnorderedElementsAre(session2, session3));
+  task_environment().FastForwardBy(2 * delay);
+  ASSERT_THAT(history(), ElementsAre(session3));
+  task_environment().FastForwardBy(2 * delay);
+  EXPECT_THAT(history(), IsEmpty());
+}
+
+}  // namespace permissions
diff --git a/components/permissions/permission_manager_unittest.cc b/components/permissions/permission_manager_unittest.cc
index 76d37a5..ce6ba4d6 100644
--- a/components/permissions/permission_manager_unittest.cc
+++ b/components/permissions/permission_manager_unittest.cc
@@ -201,13 +201,15 @@
                                      blink::mojom::FeaturePolicyFeature feature,
                                      const std::vector<std::string>& origins) {
     content::RenderFrameHost* current = *rfh;
-    SimulateNavigation(&current, current->GetLastCommittedURL());
+    auto navigation = content::NavigationSimulator::CreateRendererInitiated(
+        current->GetLastCommittedURL(), current);
     std::vector<url::Origin> parsed_origins;
     for (const std::string& origin : origins)
       parsed_origins.push_back(url::Origin::Create(GURL(origin)));
-    content::RenderFrameHostTester::For(current)->SimulateFeaturePolicyHeader(
-        feature, parsed_origins);
-    *rfh = current;
+    navigation->SetFeaturePolicyHeader(
+        {{feature, parsed_origins, false, false}});
+    navigation->Commit();
+    *rfh = navigation->GetFinalRenderFrameHost();
   }
 
   content::RenderFrameHost* AddChildRFH(
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json
index b67d1b22..7ec02e43 100644
--- a/components/policy/resources/policy_templates.json
+++ b/components/policy/resources/policy_templates.json
@@ -16405,7 +16405,7 @@
       'id': 353,
       'caption': '''Set how often user has to enter password to use quick unlock''',
       'tags': [],
-      'desc': '''Setting the policy controls how often the lock screen requests the password for quick unlock. Each time the lock screen appears, if the last password entry occured before the time window specified by the value chosen, quick unlock won't be available. If users stay on the lock screen past this amount of time, a password is requested next time they enter the wrong code or re-enter the lock screen, whichever comes first.
+      'desc': '''Setting the policy controls how often the lock screen requests the password for quick unlock. Each time the lock screen appears, if the last password entry occurred before the time window specified by the value chosen, quick unlock won't be available. If users stay on the lock screen past this amount of time, a password is requested next time they enter the wrong code or re-enter the lock screen, whichever comes first.
 
       Leaving the policy unset means users using quick unlock enter their password on the lock screen daily.''',
     },
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index cc147db..94be8ef 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -820,7 +820,10 @@
       const blink::WebString& fallback_name,
       const blink::FramePolicy& frame_policy,
       const blink::WebFrameOwnerProperties& frame_owner_properties,
-      blink::mojom::FrameOwnerElementType owner_type) override;
+      blink::mojom::FrameOwnerElementType owner_type,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override;
   void FrameDetached() override;
   std::unique_ptr<blink::WebURLLoaderFactory> CreateURLLoaderFactory() override;
 
@@ -1013,7 +1016,10 @@
     const blink::WebString& fallback_name,
     const blink::FramePolicy& frame_policy,
     const blink::WebFrameOwnerProperties& frame_owner_properties,
-    blink::mojom::FrameOwnerElementType frame_owner_type) {
+    blink::mojom::FrameOwnerElementType frame_owner_type,
+    blink::CrossVariantMojoAssociatedReceiver<
+        blink::mojom::PolicyContainerHostInterfaceBase>
+        policy_container_host_receiver) {
   // This is called when printing a selection and when this selection contains
   // an iframe. This is not supported yet. An empty rectangle will be displayed
   // instead.
diff --git a/components/search/repeatable_queries/repeatable_queries_service_unittest.cc b/components/search/repeatable_queries/repeatable_queries_service_unittest.cc
index bd64cff..7208f24 100644
--- a/components/search/repeatable_queries/repeatable_queries_service_unittest.cc
+++ b/components/search/repeatable_queries/repeatable_queries_service_unittest.cc
@@ -338,7 +338,13 @@
   service_->RemoveObserver(this);
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedIn) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedIn DISABLED_SignedIn
+#else
+#define MAYBE_SignedIn SignedIn
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedIn) {
   SignIn();
   test_url_loader_factory()->AddResponse(service()->GetRequestURL().spec(),
                                          GoodServerResponse());
@@ -357,7 +363,13 @@
   EXPECT_EQ(expected_server_queries, service()->repeatable_queries());
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedIn_BadResponse) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedIn_BadResponse DISABLED_SignedIn_BadResponse
+#else
+#define MAYBE_SignedIn_BadResponse SignedIn_BadResponse
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedIn_BadResponse) {
   SignIn();
   test_url_loader_factory()->AddResponse(service()->GetRequestURL().spec(),
                                          GoodServerResponse());
@@ -391,8 +403,8 @@
   EXPECT_TRUE(service()->repeatable_queries().empty());
 }
 
-// TODO(crbug.com/1151909) Test fails on iOS device
-#if defined(OS_IOS) && !TARGET_IPHONE_SIMULATOR
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
 #define MAYBE_SignedIn_ErrorResponse DISABLED_SignedIn_ErrorResponse
 #else
 #define MAYBE_SignedIn_ErrorResponse SignedIn_ErrorResponse
@@ -424,8 +436,8 @@
   EXPECT_EQ(expected_server_queries, service()->repeatable_queries());
 }
 
-// TODO(crbug.com/1151909) Test fails on iOS device
-#if defined(OS_IOS) && !TARGET_IPHONE_SIMULATOR
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
 #define MAYBE_SignedIn_DefaultSearchProviderChanged \
   DISABLED_SignedIn_DefaultSearchProviderChanged
 #else
@@ -458,7 +470,13 @@
   EXPECT_TRUE(service()->repeatable_queries().empty());
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedIn_SigninStatusChanged) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedIn_SigninStatusChanged DISABLED_SignedIn_SigninStatusChanged
+#else
+#define MAYBE_SignedIn_SigninStatusChanged SignedIn_SigninStatusChanged
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedIn_SigninStatusChanged) {
   base::HistogramTester histogram_tester;
 
   SignIn();
@@ -511,7 +529,13 @@
       RepeatableQueriesService::kExtractedCountHistogram, 2, 1);
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedIn_Deletion) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedIn_Deletion DISABLED_SignedIn_Deletion
+#else
+#define MAYBE_SignedIn_Deletion SignedIn_Deletion
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedIn_Deletion) {
   SignIn();
   test_url_loader_factory()->AddResponse(service()->GetRequestURL().spec(),
                                          GoodServerResponse());
@@ -563,7 +587,7 @@
   EXPECT_EQ(expected_server_queries, service()->repeatable_queries());
 }
 
-// TODO(crbug.com/1150909) Test fails on iOS simulators
+// TODO(crbug.com/1151909) Test fails on iOS simulators
 #if defined(OS_IOS)
 #define MAYBE_SignedOut_DefaultSearchProviderChanged \
   DISABLED_SignedOut_DefaultSearchProviderChanged
@@ -609,7 +633,14 @@
   EXPECT_TRUE(service()->repeatable_queries().empty());
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedOut_SigninStatusChanged) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedOut_SigninStatusChanged \
+  DISABLED_SignedOut_SigninStatusChanged
+#else
+#define MAYBE_SignedOut_SigninStatusChanged SignedOut_SigninStatusChanged
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedOut_SigninStatusChanged) {
   int original_query_age =
       history::kAutocompleteDuplicateVisitIntervalThreshold.InSeconds() + 3;
   FillURLDatabase({
@@ -652,7 +683,13 @@
   EXPECT_EQ(expected_server_queries, service()->repeatable_queries());
 }
 
-TEST_F(RepeatableQueriesServiceTest, SignedOut_Deletion) {
+// TODO(crbug.com/1151909) Test fails on iOS
+#if defined(OS_IOS)
+#define MAYBE_SignedOut_Deletion DISABLED_SignedOut_Deletion
+#else
+#define MAYBE_SignedOut_Deletion SignedOut_Deletion
+#endif
+TEST_F(RepeatableQueriesServiceTest, MAYBE_SignedOut_Deletion) {
   FillURLDatabase({{default_search_provider(), "local query 1",
                     /*age_in_seconds=*/1},
                    {default_search_provider(), "local query 2",
diff --git a/components/signin/public/identity_manager/BUILD.gn b/components/signin/public/identity_manager/BUILD.gn
index 66149ee..7dc2f0c 100644
--- a/components/signin/public/identity_manager/BUILD.gn
+++ b/components/signin/public/identity_manager/BUILD.gn
@@ -130,6 +130,10 @@
   if (is_ios) {
     deps += [ "//components/signin/public/identity_manager/ios:test_support" ]
   }
+
+  if (is_chromeos_lacros) {
+    deps += [ "//components/account_manager_core" ]
+  }
 }
 
 source_set("test_support") {
@@ -160,4 +164,8 @@
     "//components/sync_preferences:test_support",
     "//testing/gtest",
   ]
+
+  if (is_chromeos_lacros) {
+    deps += [ "//components/account_manager_core" ]
+  }
 }
diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn
index e07af07..7bba5178 100644
--- a/components/sync/BUILD.gn
+++ b/components/sync/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
 import("//testing/test.gni")
 
@@ -496,6 +497,7 @@
     ":test_support_nigori",
     "//base",
     "//base/test:test_support",
+    "//build:chromeos_buildflags",
     "//components/gcm_driver:test_support",
     "//components/invalidation/impl",
     "//components/os_crypt",
@@ -540,7 +542,7 @@
     ]
   }
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     deps += [ "//chromeos/constants" ]
   }
 }
diff --git a/components/sync/base/BUILD.gn b/components/sync/base/BUILD.gn
index 3d6549525..77620c56 100644
--- a/components/sync/base/BUILD.gn
+++ b/components/sync/base/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
 
 declare_args() {
@@ -81,6 +82,7 @@
   ]
   deps = [
     "//base:i18n",
+    "//build:chromeos_buildflags",
     "//components/os_crypt",
     "//components/pref_registry",
     "//components/prefs",
@@ -92,7 +94,7 @@
     "//ui/base",
   ]
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     deps += [ "//chromeos/constants" ]
   }
 
diff --git a/components/sync/base/pref_names.cc b/components/sync/base/pref_names.cc
index dff4396..ee38150 100644
--- a/components/sync/base/pref_names.cc
+++ b/components/sync/base/pref_names.cc
@@ -4,6 +4,8 @@
 
 #include "components/sync/base/pref_names.h"
 
+#include "build/chromeos_buildflags.h"
+
 namespace syncer {
 
 namespace prefs {
@@ -27,7 +29,7 @@
 // (kSyncBookmarks, kSyncPasswords, etc.) can all be ignored.
 const char kSyncKeepEverythingSynced[] = "sync.keep_everything_synced";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Boolean pref that records whether OS sync preferences were migrated due to
 // SplitSettingsSync rollout.
 const char kOsSyncPrefsMigrated[] = "sync.os_sync_prefs_migrated";
@@ -45,7 +47,7 @@
 // OS user selectable types.
 const char kSyncOsApps[] = "sync.os_apps";
 const char kSyncOsPreferences[] = "sync.os_preferences";
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Booleans specifying whether the user has selected to sync the following
 // user selectable types.
diff --git a/components/sync/base/pref_names.h b/components/sync/base/pref_names.h
index e451390..8d0c8a1a 100644
--- a/components/sync/base/pref_names.h
+++ b/components/sync/base/pref_names.h
@@ -6,6 +6,7 @@
 #define COMPONENTS_SYNC_BASE_PREF_NAMES_H_
 
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 
 namespace syncer {
 
@@ -17,13 +18,13 @@
 extern const char kSyncFirstSetupComplete[];
 extern const char kSyncKeepEverythingSynced[];
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 extern const char kOsSyncPrefsMigrated[];
 extern const char kOsSyncFeatureEnabled[];
 extern const char kSyncAllOsTypes[];
 extern const char kSyncOsApps[];
 extern const char kSyncOsPreferences[];
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 extern const char kSyncApps[];
 extern const char kSyncAutofill[];
diff --git a/components/sync/base/sync_prefs.cc b/components/sync/base/sync_prefs.cc
index 735bc450..1513ec73 100644
--- a/components/sync/base/sync_prefs.cc
+++ b/components/sync/base/sync_prefs.cc
@@ -16,6 +16,7 @@
 #include "base/rand_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/pref_service.h"
 #include "components/sync/base/pref_names.h"
@@ -156,7 +157,7 @@
   for (UserSelectableType type : UserSelectableTypeSet::All()) {
     RegisterTypeSelectedPref(registry, type);
   }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   registry->RegisterBooleanPref(prefs::kOsSyncPrefsMigrated, false);
   registry->RegisterBooleanPref(prefs::kOsSyncFeatureEnabled, false);
   registry->RegisterBooleanPref(prefs::kSyncAllOsTypes, true);
@@ -345,7 +346,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool SyncPrefs::IsSyncAllOsTypesEnabled() const {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   return pref_service_->GetBoolean(prefs::kSyncAllOsTypes);
@@ -405,7 +406,7 @@
   NOTREACHED();
   return nullptr;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 bool SyncPrefs::IsManaged() const {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/components/sync/base/sync_prefs.h b/components/sync/base/sync_prefs.h
index 1e2dd2e8..61841a6 100644
--- a/components/sync/base/sync_prefs.h
+++ b/components/sync/base/sync_prefs.h
@@ -18,6 +18,7 @@
 #include "base/sequence_checker.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/pref_member.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/user_selectable_type.h"
@@ -113,7 +114,7 @@
                         UserSelectableTypeSet registered_types,
                         UserSelectableTypeSet selected_types);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Chrome OS provides a separate settings UI surface for sync of OS types,
   // including a separate "Sync All" toggle for OS types.
   bool IsSyncAllOsTypesEnabled() const;
diff --git a/components/sync/base/sync_prefs_unittest.cc b/components/sync/base/sync_prefs_unittest.cc
index a1b7ec9..ca5712e 100644
--- a/components/sync/base/sync_prefs_unittest.cc
+++ b/components/sync/base/sync_prefs_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/task_environment.h"
 #include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/pref_notifier_impl.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/pref_value_store.h"
@@ -112,7 +113,7 @@
   sync_prefs_->RemoveSyncPrefObserver(&mock_sync_pref_observer);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncPrefsTest, SetSelectedOsTypesTriggersPreferredDataTypesPrefChange) {
   StrictMock<MockSyncPrefObserver> mock_sync_pref_observer;
   EXPECT_CALL(mock_sync_pref_observer, OnPreferredDataTypesPrefChange());
@@ -246,7 +247,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncPrefsTest, IsSyncAllOsTypesEnabled) {
   EXPECT_TRUE(sync_prefs_->IsSyncAllOsTypesEnabled());
 
@@ -299,7 +300,7 @@
     EXPECT_EQ(browser_types, sync_prefs_->GetSelectedTypes());
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Similar to SyncPrefsTest, but does not create a SyncPrefs instance. This lets
 // individual tests set up the "before" state of the PrefService before
diff --git a/components/sync/base/sync_util.cc b/components/sync/base/sync_util.cc
index 5ff55dde..e4ec1cb 100644
--- a/components/sync/base/sync_util.cc
+++ b/components/sync/base/sync_util.cc
@@ -8,6 +8,7 @@
 #include "base/logging.h"
 #include "base/strings/stringize_macros.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/sync_base_switches.h"
 #include "google_apis/gaia/gaia_config.h"
 #include "ui/base/device_form_factor.h"
@@ -18,7 +19,7 @@
 // Returns string that represents system in UserAgent.
 std::string GetSystemString() {
   std::string system;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   system = "CROS ";
 #elif defined(OS_ANDROID)
   if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) {
@@ -34,7 +35,7 @@
   }
 #elif defined(OS_WIN)
   system = "WIN ";
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   system = "LINUX ";
 #elif defined(OS_FREEBSD)
   system = "FREEBSD ";
diff --git a/components/sync/base/user_selectable_type.cc b/components/sync/base/user_selectable_type.cc
index 87f2f4b..b82e5dd8 100644
--- a/components/sync/base/user_selectable_type.cc
+++ b/components/sync/base/user_selectable_type.cc
@@ -8,10 +8,11 @@
 
 #include "base/notreached.h"
 #include "base/optional.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/pref_names.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -46,7 +47,7 @@
     case UserSelectableType::kPreferences: {
       ModelTypeSet model_types = {PREFERENCES, DICTIONARY, PRIORITY_PREFERENCES,
                                   SEARCH_ENGINES};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       // SplitSettingsSync makes Printers a separate OS setting.
       if (!chromeos::features::IsSplitSettingsSyncEnabled())
         model_types.Put(PRINTERS);
@@ -72,7 +73,7 @@
       return {
           kExtensionsTypeName, EXTENSIONS, {EXTENSIONS, EXTENSION_SETTINGS}};
     case UserSelectableType::kApps: {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       // SplitSettingsSync moves apps to Chrome OS settings.
       if (chromeos::features::IsSplitSettingsSyncEnabled()) {
         return {kAppsTypeName, UNSPECIFIED};
@@ -93,7 +94,7 @@
               {PROXY_TABS, SESSIONS, DEPRECATED_FAVICON_IMAGES,
                DEPRECATED_FAVICON_TRACKING, SEND_TAB_TO_SELF}};
     case UserSelectableType::kWifiConfigurations: {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       // SplitSettingsSync moves Wi-Fi configurations to Chrome OS settings.
       if (chromeos::features::IsSplitSettingsSyncEnabled())
         return {kWifiConfigurationsTypeName, UNSPECIFIED};
@@ -107,7 +108,7 @@
   return {nullptr, UNSPECIFIED};
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 constexpr char kOsAppsTypeName[] = "osApps";
 constexpr char kOsPreferencesTypeName[] = "osPreferences";
 constexpr char kOsWifiConfigurationsTypeName[] = "osWifiConfigurations";
@@ -130,7 +131,7 @@
               {WIFI_CONFIGURATIONS}};
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -202,7 +203,7 @@
       ModelTypeHistogramValue(UserSelectableTypeToCanonicalModelType(type)));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 const char* GetUserSelectableOsTypeName(UserSelectableOsType type) {
   return GetUserSelectableOsTypeInfo(type).type_name;
 }
@@ -244,6 +245,6 @@
 ModelType UserSelectableOsTypeToCanonicalModelType(UserSelectableOsType type) {
   return GetUserSelectableOsTypeInfo(type).canonical_model_type;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace syncer
diff --git a/components/sync/base/user_selectable_type.h b/components/sync/base/user_selectable_type.h
index 28a320c..2b918df 100644
--- a/components/sync/base/user_selectable_type.h
+++ b/components/sync/base/user_selectable_type.h
@@ -8,6 +8,7 @@
 #include <string>
 
 #include "base/optional.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/enum_set.h"
 #include "components/sync/base/model_type.h"
 
@@ -48,7 +49,7 @@
   return static_cast<int>(ModelType::NUM_ENTRIES);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Chrome OS provides a separate UI with sync controls for OS data types. Note
 // that wallpaper is a special case due to its reliance on apps, so while it
 // appears in the UI, it is not included in this enum.
@@ -73,7 +74,7 @@
 // Returns the type if the string matches a known OS type.
 base::Optional<UserSelectableOsType> GetUserSelectableOsTypeFromString(
     const std::string& type);
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace syncer
 
diff --git a/components/sync/driver/BUILD.gn b/components/sync/driver/BUILD.gn
index 584158fe..0f91c41 100644
--- a/components/sync/driver/BUILD.gn
+++ b/components/sync/driver/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
 import("//tools/grit/grit_rule.gni")
 
@@ -85,6 +86,7 @@
   ]
   deps = [
     "//base:i18n",
+    "//build:chromeos_buildflags",
     "//components/data_use_measurement/core",
     "//components/invalidation/impl:feature_list",
     "//components/keyed_service/core",
@@ -107,7 +109,7 @@
     ]
   }
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     deps += [ "//chromeos/constants" ]
   }
 
@@ -152,6 +154,7 @@
   public_deps = [ "//components/sync/base:test_support" ]
 
   deps = [
+    "//build:chromeos_buildflags",
     "//components/invalidation/impl:test_support",
     "//components/pref_registry",
     "//components/prefs:test_support",
diff --git a/components/sync/driver/profile_sync_service.cc b/components/sync/driver/profile_sync_service.cc
index 35dcac6..94cb745 100644
--- a/components/sync/driver/profile_sync_service.cc
+++ b/components/sync/driver/profile_sync_service.cc
@@ -21,6 +21,7 @@
 #include "base/rand_util.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/invalidation/public/invalidation_service.h"
 #include "components/signin/public/base/signin_metrics.h"
 #include "components/signin/public/identity_manager/account_info.h"
@@ -49,7 +50,7 @@
 #include "components/version_info/version_info_values.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -1036,7 +1037,7 @@
       // that IsSyncRequested gets set to false, and Sync won't start again on
       // the next browser startup.
       StopAndClear();
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
       // On every platform except ChromeOS, sign out the user after a dashboard
       // clear.
       if (!IsLocalSyncEnabled()) {
diff --git a/components/sync/driver/profile_sync_service_startup_unittest.cc b/components/sync/driver/profile_sync_service_startup_unittest.cc
index 3e5eab5..c2ac661f 100644
--- a/components/sync/driver/profile_sync_service_startup_unittest.cc
+++ b/components/sync/driver/profile_sync_service_startup_unittest.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "base/test/task_environment.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/pref_service.h"
 #include "components/signin/public/identity_manager/identity_test_environment.h"
 #include "components/sync/base/pref_names.h"
@@ -141,7 +142,7 @@
 
 // ChromeOS does not support sign-in after startup (in particular,
 // IdentityManager::Observer::OnPrimaryAccountSet never gets called).
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) {
   // We've never completed startup.
   ASSERT_FALSE(sync_prefs()->IsFirstSetupComplete());
@@ -222,7 +223,7 @@
 
   EXPECT_CALL(*data_type_manager, Stop(BROWSER_SHUTDOWN));
 }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) {
   // We're already signed in, but don't have a refresh token.
@@ -567,7 +568,7 @@
 
 // ChromeOS does not support sign-in after startup (in particular,
 // IdentityManager::Observer::OnPrimaryAccountSet never gets called).
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ProfileSyncServiceStartupTest, FullStartupSequenceFirstTime) {
   // We've never completed startup.
   ASSERT_FALSE(sync_prefs()->IsFirstSetupComplete());
@@ -660,7 +661,7 @@
             sync_service()->GetTransportState());
   EXPECT_TRUE(sync_service()->IsSyncFeatureActive());
 }
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(ProfileSyncServiceStartupTest, FullStartupSequenceNthTime) {
   // The user is already signed in and has completed Sync setup before.
diff --git a/components/sync/driver/profile_sync_service_unittest.cc b/components/sync/driver/profile_sync_service_unittest.cc
index fbb12f1..9a0ae3c 100644
--- a/components/sync/driver/profile_sync_service_unittest.cc
+++ b/components/sync/driver/profile_sync_service_unittest.cc
@@ -18,6 +18,7 @@
 #include "base/time/time.h"
 #include "base/values.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/policy/core/common/policy_service_impl.h"
 #include "components/prefs/testing_pref_service.h"
 #include "components/signin/public/identity_manager/account_info.h"
@@ -658,7 +659,7 @@
 
 // Certain ProfileSyncService tests don't apply to Chrome OS, for example
 // things that deal with concepts like "signing out".
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ProfileSyncServiceTest, SignOutDisablesSyncTransportAndSyncFeature) {
   // Sign-in and enable sync.
   SignIn();
@@ -749,7 +750,7 @@
   EXPECT_EQ(identity_manager()->GetPrimaryAccountId(),
             identity_provider()->GetActiveAccountId());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(ProfileSyncServiceTest, GetSyncTokenStatus) {
   SignIn();
@@ -962,7 +963,7 @@
 }
 
 // CrOS does not support signout.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ProfileSyncServiceTest, SignOutRevokeAccessToken) {
   CoreAccountId init_account_id;
 
@@ -1277,7 +1278,7 @@
   client_cmd.action = DISABLE_SYNC_ON_CLIENT;
   service()->OnActionableError(client_cmd);
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // ChromeOS does not support signout.
   EXPECT_TRUE(identity_manager()->HasPrimaryAccount());
   EXPECT_EQ(
@@ -1531,7 +1532,7 @@
 }
 
 // CrOS does not support signout.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(ProfileSyncServiceTestWithSyncInvalidationsServiceCreated,
        ShouldDectivateSyncInvalidationsServiceOnSignOut) {
   SignIn();
diff --git a/components/sync/driver/sync_auth_manager_unittest.cc b/components/sync/driver/sync_auth_manager_unittest.cc
index 075f2a8..86a73e0b 100644
--- a/components/sync/driver/sync_auth_manager_unittest.cc
+++ b/components/sync/driver/sync_auth_manager_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/test/scoped_feature_list.h"
 #include "base/test/task_environment.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "components/signin/public/identity_manager/identity_test_environment.h"
 #include "components/signin/public/identity_manager/primary_account_mutator.h"
 #include "components/sync/driver/sync_driver_switches.h"
@@ -93,15 +94,15 @@
       auth_manager->GetActiveAccountInfo().account_info.account_id.empty());
 
 // ChromeOS doesn't support sign-out.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
   identity_env()->ClearPrimaryAccount();
   EXPECT_TRUE(
       auth_manager->GetActiveAccountInfo().account_info.account_id.empty());
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 // ChromeOS doesn't support sign-out.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncAuthManagerTest, ForwardsPrimaryAccountEvents) {
   // Start out already signed in before the SyncAuthManager is created.
   CoreAccountId account_id =
@@ -169,11 +170,11 @@
   EXPECT_TRUE(
       auth_manager->GetActiveAccountInfo().account_info.account_id.empty());
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Unconsented primary accounts (aka secondary accounts) are only supported on
 // Win/Mac/Linux.
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID) && !defined(OS_IOS)
 TEST_F(SyncAuthManagerTest, ForwardsSecondaryAccountEvents) {
   base::MockCallback<AccountStateChangedCallback> account_state_changed;
   base::MockCallback<CredentialsChangedCallback> credentials_changed;
@@ -203,10 +204,11 @@
 
   EXPECT_TRUE(auth_manager->GetActiveAccountInfo().is_primary);
 }
-#endif  // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID) &&
+        // !defined(OS_IOS)
 
 // ChromeOS doesn't support sign-out.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncAuthManagerTest, ClearsAuthErrorOnSignout) {
   // Start out already signed in before the SyncAuthManager is created.
   CoreAccountId account_id =
@@ -236,7 +238,7 @@
   EXPECT_EQ(auth_manager->GetLastAuthError().state(),
             GoogleServiceAuthError::NONE);
 }
-#endif  // !defined(OS_CHROMEOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(SyncAuthManagerTest, DoesNotClearAuthErrorOnSyncDisable) {
   // Start out already signed in before the SyncAuthManager is created.
@@ -778,7 +780,7 @@
 }
 #endif  // !defined(OS_ANDROID) && !defined(OS_IOS)
 
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID) && !defined(OS_IOS)
 // Primary account with no sync consent is not supported on Android and iOS.
 // On crOS the unconsented primary account can't be changed or removed, but can
 // be granted sync consent.
@@ -818,7 +820,8 @@
   EXPECT_TRUE(
       auth_manager->GetActiveAccountInfo().account_info.account_id.empty());
 }
-#endif  // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID) &&
+        // !defined(OS_IOS)
 
 }  // namespace
 
diff --git a/components/sync/driver/sync_internals_util.cc b/components/sync/driver/sync_internals_util.cc
index f9037ea..9ffef43 100644
--- a/components/sync/driver/sync_internals_util.cc
+++ b/components/sync/driver/sync_internals_util.cc
@@ -14,6 +14,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/driver/sync_service.h"
 #include "components/sync/driver/sync_token_status.h"
 #include "components/sync/driver/sync_user_settings.h"
@@ -24,7 +25,7 @@
 #include "components/sync/protocol/proto_enum_conversions.h"
 #include "url/gurl.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -331,7 +332,7 @@
       section_summary->AddStringStat("Transport State");
   Stat<std::string>* disable_reasons =
       section_summary->AddStringStat("Disable Reasons");
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   Stat<std::string>* os_feature_state =
       section_summary->AddStringStat("Chrome OS Sync Feature");
 #endif
@@ -471,14 +472,14 @@
   // Summary.
   transport_state->Set(GetTransportStateString(service->GetTransportState()));
   disable_reasons->Set(GetDisableReasonsString(service->GetDisableReasons()));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (!chromeos::features::IsSplitSettingsSyncEnabled())
     os_feature_state->Set("Flag disabled");
   else if (service->GetUserSettings()->IsOsSyncFeatureEnabled())
     os_feature_state->Set("Enabled");
   else
     os_feature_state->Set("Disabled");
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   feature_enabled->Set(service->IsSyncFeatureEnabled());
   setup_in_progress->Set(service->IsSetupInProgress());
   std::string auth_error_str = service->GetAuthError().ToString();
diff --git a/components/sync/driver/sync_policy_handler.cc b/components/sync/driver/sync_policy_handler.cc
index 8dca00dd..6a518267 100644
--- a/components/sync/driver/sync_policy_handler.cc
+++ b/components/sync/driver/sync_policy_handler.cc
@@ -8,6 +8,7 @@
 
 #include "base/optional.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "components/policy/core/common/policy_map.h"
 #include "components/policy/policy_constants.h"
 #include "components/prefs/pref_value_map.h"
@@ -15,9 +16,9 @@
 #include "components/sync/base/sync_prefs.h"
 #include "components/sync/base/user_selectable_type.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace syncer {
 namespace {
@@ -31,7 +32,7 @@
       prefs->SetValue(pref, base::Value(false));
   }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     // Check for OS types. This includes types that used to be browser types,
     // like "apps" and "preferences".
@@ -43,7 +44,7 @@
         prefs->SetValue(os_pref, base::Value(false));
     }
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 }  // namespace
diff --git a/components/sync/driver/sync_policy_handler_unittest.cc b/components/sync/driver/sync_policy_handler_unittest.cc
index f3817f1..619e4aa5 100644
--- a/components/sync/driver/sync_policy_handler_unittest.cc
+++ b/components/sync/driver/sync_policy_handler_unittest.cc
@@ -7,6 +7,7 @@
 #include <memory>
 
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "components/policy/core/common/policy_map.h"
 #include "components/policy/core/common/policy_types.h"
 #include "components/policy/policy_constants.h"
@@ -14,10 +15,10 @@
 #include "components/sync/base/pref_names.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/test/scoped_feature_list.h"
 #include "chromeos/constants/chromeos_features.h"
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace syncer {
 namespace {
@@ -95,7 +96,7 @@
   EXPECT_TRUE(enabled);
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 class SyncPolicyHandlerOsTest : public testing::Test {
  public:
   SyncPolicyHandlerOsTest() {
@@ -162,7 +163,7 @@
   ASSERT_TRUE(prefs.GetBoolean(prefs::kSyncOsPreferences, &enabled));
   EXPECT_FALSE(enabled);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 }  // namespace syncer
diff --git a/components/sync/driver/sync_user_settings.h b/components/sync/driver/sync_user_settings.h
index c360552..eeb041c 100644
--- a/components/sync/driver/sync_user_settings.h
+++ b/components/sync/driver/sync_user_settings.h
@@ -9,6 +9,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/passphrase_enums.h"
 #include "components/sync/base/user_selectable_type.h"
@@ -67,7 +68,7 @@
   // registered.
   virtual UserSelectableTypeSet GetRegisteredSelectableTypes() const = 0;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // As above, but for Chrome OS-specific data types. These are controlled by
   // toggles in the OS Settings UI.
   virtual bool IsSyncAllOsTypesEnabled() const = 0;
@@ -80,7 +81,7 @@
   // Exists in this interface for easier mocking in tests.
   virtual bool IsOsSyncFeatureEnabled() const = 0;
   virtual void SetOsSyncFeatureEnabled(bool enabled) = 0;
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // Encryption state.
   // Note that all of this state may only be queried or modified if the Sync
diff --git a/components/sync/driver/sync_user_settings_impl.cc b/components/sync/driver/sync_user_settings_impl.cc
index afe12aee..ac1b9b3 100644
--- a/components/sync/driver/sync_user_settings_impl.cc
+++ b/components/sync/driver/sync_user_settings_impl.cc
@@ -6,11 +6,12 @@
 
 #include "base/logging.h"
 #include "base/metrics/histogram_macros.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/sync_prefs.h"
 #include "components/sync/base/user_selectable_type.h"
 #include "components/sync/driver/sync_service_crypto.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -26,7 +27,7 @@
   return preferred_types;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 ModelTypeSet ResolvePreferredOsTypes(UserSelectableOsTypeSet selected_types) {
   ModelTypeSet preferred_types;
   for (UserSelectableOsType type : selected_types) {
@@ -34,7 +35,7 @@
   }
   return preferred_types;
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
@@ -120,7 +121,7 @@
   return registered_types;
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool SyncUserSettingsImpl::IsSyncAllOsTypesEnabled() const {
   DCHECK(chromeos::features::IsSplitSettingsSyncEnabled());
   return prefs_->IsSyncAllOsTypesEnabled();
@@ -163,7 +164,7 @@
   DCHECK(chromeos::features::IsSplitSettingsSyncEnabled());
   prefs_->SetOsSyncFeatureEnabled(enabled);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 bool SyncUserSettingsImpl::IsEncryptEverythingAllowed() const {
   return !preference_provider_ ||
@@ -236,7 +237,7 @@
 ModelTypeSet SyncUserSettingsImpl::GetPreferredDataTypes() const {
   ModelTypeSet types = ResolvePreferredTypes(GetSelectedTypes());
   types.PutAll(AlwaysPreferredUserTypes());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled())
     types.PutAll(ResolvePreferredOsTypes(GetSelectedOsTypes()));
 #endif
diff --git a/components/sync/driver/sync_user_settings_impl.h b/components/sync/driver/sync_user_settings_impl.h
index 8e7889c..100e9d58 100644
--- a/components/sync/driver/sync_user_settings_impl.h
+++ b/components/sync/driver/sync_user_settings_impl.h
@@ -8,6 +8,7 @@
 #include <string>
 
 #include "base/callback.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/model_type.h"
 #include "components/sync/base/user_selectable_type.h"
 #include "components/sync/driver/sync_type_preference_provider.h"
@@ -46,7 +47,7 @@
                         UserSelectableTypeSet types) override;
   UserSelectableTypeSet GetRegisteredSelectableTypes() const override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   bool IsSyncAllOsTypesEnabled() const override;
   UserSelectableOsTypeSet GetSelectedOsTypes() const override;
   void SetSelectedOsTypes(bool sync_all_os_types,
diff --git a/components/sync/driver/sync_user_settings_mock.h b/components/sync/driver/sync_user_settings_mock.h
index ef087d24..4ae5da6e 100644
--- a/components/sync/driver/sync_user_settings_mock.h
+++ b/components/sync/driver/sync_user_settings_mock.h
@@ -8,6 +8,7 @@
 #include <string>
 #include <vector>
 
+#include "build/chromeos_buildflags.h"
 #include "components/sync/driver/sync_user_settings.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
@@ -37,7 +38,7 @@
               (),
               (const override));
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   MOCK_METHOD(bool, IsSyncAllOsTypesEnabled, (), (const override));
   MOCK_METHOD(UserSelectableOsTypeSet,
               GetSelectedOsTypes,
diff --git a/components/sync/driver/sync_user_settings_unittest.cc b/components/sync/driver/sync_user_settings_unittest.cc
index abf7d69..8cfdc793 100644
--- a/components/sync/driver/sync_user_settings_unittest.cc
+++ b/components/sync/driver/sync_user_settings_unittest.cc
@@ -8,6 +8,7 @@
 
 #include "base/callback.h"
 #include "base/callback_helpers.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/testing_pref_service.h"
 #include "components/sync/base/model_type.h"
@@ -18,7 +19,7 @@
 #include "components/sync/engine/configure_reason.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/test/scoped_feature_list.h"
 #include "chromeos/constants/chromeos_features.h"
 #endif
@@ -32,7 +33,7 @@
 
 ModelTypeSet GetUserTypes() {
   ModelTypeSet user_types = UserTypes();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // These types only exist when SplitSettingsSync is enabled.
   if (!chromeos::features::IsSplitSettingsSyncEnabled()) {
     user_types.RemoveAll(
@@ -149,7 +150,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncUserSettingsTest, PreferredTypesSyncAllOsTypes) {
   base::test::ScopedFeatureList feature_list;
   feature_list.InitAndEnableFeature(chromeos::features::kSplitSettingsSync);
@@ -165,7 +166,7 @@
     EXPECT_EQ(GetUserTypes(), GetPreferredUserTypes(*sync_user_settings));
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 TEST_F(SyncUserSettingsTest, PreferredTypesNotKeepEverythingSynced) {
   std::unique_ptr<SyncUserSettingsImpl> sync_user_settings =
@@ -174,7 +175,7 @@
   sync_user_settings->SetSelectedTypes(
       /*sync_everything=*/false,
       /*selected_types=*/UserSelectableTypeSet());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (chromeos::features::IsSplitSettingsSyncEnabled()) {
     // GetPreferredUserTypes() returns ModelTypes, which includes both browser
     // and OS types. However, this test exercises browser UserSelectableTypes,
@@ -182,7 +183,7 @@
     sync_user_settings->SetSelectedOsTypes(/*sync_all_os_types=*/false,
                                            UserSelectableOsTypeSet());
   }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
   // No user selectable types are enabled, so only the "always preferred" types
   // are preferred.
   ASSERT_EQ(AlwaysPreferredUserTypes(),
@@ -201,7 +202,7 @@
   }
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncUserSettingsTest, PreferredTypesNotAllOsTypesSynced) {
   base::test::ScopedFeatureList feature_list;
   feature_list.InitAndEnableFeature(chromeos::features::kSplitSettingsSync);
@@ -230,7 +231,7 @@
               GetPreferredUserTypes(*sync_user_settings));
   }
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Device info should always be enabled.
 TEST_F(SyncUserSettingsTest, DeviceInfo) {
@@ -282,7 +283,7 @@
   EXPECT_TRUE(sync_user_settings->GetPreferredDataTypes().Has(USER_CONSENTS));
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 TEST_F(SyncUserSettingsTest, AlwaysPreferredTypes_ChromeOS) {
   base::test::ScopedFeatureList feature_list;
   feature_list.InitAndEnableFeature(chromeos::features::kSplitSettingsSync);
@@ -347,7 +348,7 @@
   EXPECT_FALSE(settings->GetPreferredDataTypes().Has(ARC_PACKAGE));
   EXPECT_FALSE(settings->GetPreferredDataTypes().Has(WEB_APPS));
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
diff --git a/components/sync/driver/test_sync_user_settings.cc b/components/sync/driver/test_sync_user_settings.cc
index c4db56e..d4cce15 100644
--- a/components/sync/driver/test_sync_user_settings.cc
+++ b/components/sync/driver/test_sync_user_settings.cc
@@ -4,6 +4,7 @@
 
 #include "components/sync/driver/test_sync_user_settings.h"
 
+#include "build/chromeos_buildflags.h"
 #include "components/sync/base/passphrase_enums.h"
 #include "components/sync/base/sync_prefs.h"
 #include "components/sync/base/user_selectable_type.h"
@@ -92,7 +93,7 @@
   return UserSelectableTypeSet::All();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool TestSyncUserSettings::IsSyncAllOsTypesEnabled() const {
   return sync_all_os_types_enabled_;
 }
diff --git a/components/sync/driver/test_sync_user_settings.h b/components/sync/driver/test_sync_user_settings.h
index af78ed3..6834959 100644
--- a/components/sync/driver/test_sync_user_settings.h
+++ b/components/sync/driver/test_sync_user_settings.h
@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "build/chromeos_buildflags.h"
 #include "components/sync/driver/sync_user_settings.h"
 
 namespace syncer {
@@ -35,7 +36,7 @@
                         UserSelectableTypeSet types) override;
   UserSelectableTypeSet GetRegisteredSelectableTypes() const override;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   bool IsSyncAllOsTypesEnabled() const override;
   UserSelectableOsTypeSet GetSelectedOsTypes() const override;
   void SetSelectedOsTypes(bool sync_all_os_types,
@@ -77,7 +78,7 @@
 
   bool first_setup_complete_ = true;
   bool sync_everything_enabled_ = true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   bool os_sync_feature_enabled_ = true;
   bool sync_all_os_types_enabled_ = true;
 #endif
diff --git a/components/sync_device_info/BUILD.gn b/components/sync_device_info/BUILD.gn
index 940c3ee..e159666 100644
--- a/components/sync_device_info/BUILD.gn
+++ b/components/sync_device_info/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
 
 static_library("sync_device_info") {
@@ -39,6 +40,7 @@
     "//components/sync/protocol",
   ]
   deps = [
+    "//build:chromeos_buildflags",
     "//components/keyed_service/core",
     "//components/metrics",
     "//components/prefs",
@@ -72,7 +74,7 @@
     sources += [ "local_device_info_util_win.cc" ]
   }
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     # Required by device_info_util_linux.cc on Chrome OS.
     deps += [ "//chromeos/constants" ]
   }
@@ -112,6 +114,7 @@
     ":test_support",
     "//base",
     "//base/test:test_support",
+    "//build:chromeos_buildflags",
     "//components/prefs:test_support",
     "//components/sync:test_support",
     "//components/sync/invalidations:test_support",
@@ -120,7 +123,7 @@
     "//testing/gtest",
   ]
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     # Required by local_device_info_util_unittest.cc on Chrome OS.
     deps += [ "//chromeos/constants" ]
   }
diff --git a/components/sync_device_info/local_device_info_util.cc b/components/sync_device_info/local_device_info_util.cc
index 0fb4331..ced45d98 100644
--- a/components/sync_device_info/local_device_info_util.cc
+++ b/components/sync_device_info/local_device_info_util.cc
@@ -13,6 +13,7 @@
 #include "base/task/post_task.h"
 #include "base/threading/scoped_blocking_call.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "ui/base/device_form_factor.h"
 
 namespace syncer {
@@ -29,7 +30,7 @@
                          base::ScopedClosureRunner done_closure,
                          base::SysInfo::HardwareInfo hardware_info) {
   name_info_ptr->manufacturer_name = std::move(hardware_info.manufacturer);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // For ChromeOS the returned model values are product code names like Eve. We
   // want to use generic names like Chromebook.
   name_info_ptr->model_name = GetChromeOSDeviceNameFromType();
@@ -50,9 +51,9 @@
 std::string GetPersonalizableDeviceNameInternal();
 
 sync_pb::SyncEnums::DeviceType GetLocalDeviceType() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return sync_pb::SyncEnums_DeviceType_TYPE_CROS;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
   return sync_pb::SyncEnums_DeviceType_TYPE_LINUX;
 #elif defined(OS_ANDROID) || defined(OS_IOS)
   return ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET
diff --git a/components/sync_device_info/local_device_info_util.h b/components/sync_device_info/local_device_info_util.h
index 27f48d5a..1bbeed4 100644
--- a/components/sync_device_info/local_device_info_util.h
+++ b/components/sync_device_info/local_device_info_util.h
@@ -8,6 +8,7 @@
 #include <string>
 
 #include "base/callback_forward.h"
+#include "build/chromeos_buildflags.h"
 #include "components/sync/protocol/sync_enums.pb.h"
 
 namespace syncer {
@@ -29,7 +30,7 @@
 
 sync_pb::SyncEnums::DeviceType GetLocalDeviceType();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 std::string GetChromeOSDeviceNameFromType();
 #endif
 
diff --git a/components/sync_device_info/local_device_info_util_linux.cc b/components/sync_device_info/local_device_info_util_linux.cc
index 5e65c7e7..d99ad4a5 100644
--- a/components/sync_device_info/local_device_info_util_linux.cc
+++ b/components/sync_device_info/local_device_info_util_linux.cc
@@ -8,14 +8,15 @@
 #include <string>
 
 #include "base/linux_util.h"
+#include "build/chromeos_buildflags.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/devicetype.h"
 #endif
 
 namespace syncer {
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 std::string GetChromeOSDeviceNameFromType() {
   switch (chromeos::GetDeviceType()) {
     case chromeos::DeviceType::kChromebase:
@@ -34,7 +35,7 @@
 #endif
 
 std::string GetPersonalizableDeviceNameInternal() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   return GetChromeOSDeviceNameFromType();
 #else
   char hostname[HOST_NAME_MAX];
diff --git a/components/sync_device_info/local_device_info_util_unittest.cc b/components/sync_device_info/local_device_info_util_unittest.cc
index 7a06eb7a..e2e0440 100644
--- a/components/sync_device_info/local_device_info_util_unittest.cc
+++ b/components/sync_device_info/local_device_info_util_unittest.cc
@@ -8,12 +8,13 @@
 
 #include "base/system/sys_info.h"
 #include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/command_line.h"
 #include "chromeos/constants/chromeos_switches.h"
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 namespace syncer {
 namespace {
@@ -25,7 +26,7 @@
   EXPECT_FALSE(client_name.empty());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 
 // Call GetPersonalizableDeviceNameBlocking on ChromeOS where the
 // board type is CHROMEBOOK and make sure the return value is "Chromebook".
@@ -45,7 +46,7 @@
   EXPECT_EQ("Chromebox", client_name);
 }
 
-#endif  // OS_CHROMEOS
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 }  // namespace syncer
diff --git a/components/sync_preferences/BUILD.gn b/components/sync_preferences/BUILD.gn
index 0d4f94d..836a714 100644
--- a/components/sync_preferences/BUILD.gn
+++ b/components/sync_preferences/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
 
 static_library("sync_preferences") {
@@ -19,13 +20,14 @@
 
   deps = [
     "//base",
+    "//build:chromeos_buildflags",
     "//components/policy/core/browser",
     "//components/pref_registry",
     "//components/prefs",
     "//components/sync",
   ]
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     deps += [ "//chromeos/constants" ]
   }
 }
@@ -59,6 +61,7 @@
     ":sync_preferences",
     ":test_support",
     "//base/test:test_support",
+    "//build:chromeos_buildflags",
     "//components/pref_registry",
     "//components/prefs",
     "//components/prefs:test_support",
@@ -67,7 +70,7 @@
     "//testing/gtest",
   ]
 
-  if (is_chromeos) {
+  if (is_chromeos_ash) {
     deps += [ "//chromeos/constants" ]
   }
 }
diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc
index e6ae5ba..394d762b 100644
--- a/components/sync_preferences/pref_model_associator.cc
+++ b/components/sync_preferences/pref_model_associator.cc
@@ -20,6 +20,7 @@
 #include "base/stl_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
+#include "build/chromeos_buildflags.h"
 #include "components/prefs/persistent_pref_store.h"
 #include "components/prefs/pref_service.h"
 #include "components/sync/base/model_type.h"
@@ -44,7 +45,7 @@
       return pref.GetSpecifics().preference();
     case syncer::PRIORITY_PREFERENCES:
       return pref.GetSpecifics().priority_preference().preference();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::OS_PREFERENCES:
       return pref.GetSpecifics().os_preference().preference();
     case syncer::OS_PRIORITY_PREFERENCES:
@@ -64,7 +65,7 @@
     PersistentPrefStore* user_pref_store)
     : type_(type), client_(client), user_pref_store_(user_pref_store) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   DCHECK(type_ == syncer::PREFERENCES ||
          type_ == syncer::PRIORITY_PREFERENCES ||
          type_ == syncer::OS_PREFERENCES ||
@@ -91,7 +92,7 @@
       return specifics->mutable_preference();
     case syncer::PRIORITY_PREFERENCES:
       return specifics->mutable_priority_preference()->mutable_preference();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::OS_PREFERENCES:
       return specifics->mutable_os_preference()->mutable_preference();
     case syncer::OS_PRIORITY_PREFERENCES:
diff --git a/components/sync_preferences/pref_service_syncable.cc b/components/sync_preferences/pref_service_syncable.cc
index 358bf7e..dd40219 100644
--- a/components/sync_preferences/pref_service_syncable.cc
+++ b/components/sync_preferences/pref_service_syncable.cc
@@ -10,6 +10,7 @@
 #include "base/callback.h"
 #include "base/callback_helpers.h"
 #include "base/strings/string_number_conversions.h"
+#include "build/chromeos_buildflags.h"
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/default_pref_store.h"
 #include "components/prefs/in_memory_pref_store.h"
@@ -21,7 +22,7 @@
 #include "components/sync_preferences/pref_service_syncable_observer.h"
 #include "components/sync_preferences/synced_pref_observer.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "chromeos/constants/chromeos_features.h"
 #endif
 
@@ -53,7 +54,7 @@
       priority_pref_sync_associator_(pref_model_associator_client,
                                      syncer::PRIORITY_PREFERENCES,
                                      user_prefs.get()),
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
       os_pref_sync_associator_(pref_model_associator_client,
                                syncer::OS_PREFERENCES,
                                user_prefs.get()),
@@ -64,7 +65,7 @@
       pref_registry_(std::move(pref_registry)) {
   pref_sync_associator_.SetPrefService(this);
   priority_pref_sync_associator_.SetPrefService(this);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   os_pref_sync_associator_.SetPrefService(this);
   os_priority_pref_sync_associator_.SetPrefService(this);
 #endif
@@ -132,7 +133,7 @@
   return priority_pref_sync_associator_.models_associated();
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 bool PrefServiceSyncable::AreOsPrefsSyncing() {
   return os_pref_sync_associator_.models_associated();
 }
@@ -140,7 +141,7 @@
 bool PrefServiceSyncable::AreOsPriorityPrefsSyncing() {
   return os_priority_pref_sync_associator_.models_associated();
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 void PrefServiceSyncable::AddObserver(PrefServiceSyncableObserver* observer) {
   observer_list_.AddObserver(observer);
@@ -158,7 +159,7 @@
       return &pref_sync_associator_;
     case syncer::PRIORITY_PREFERENCES:
       return &priority_pref_sync_associator_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
     case syncer::OS_PREFERENCES:
       return &os_pref_sync_associator_;
     case syncer::OS_PRIORITY_PREFERENCES:
@@ -182,7 +183,7 @@
                                                 SyncedPrefObserver* observer) {
   pref_sync_associator_.AddSyncedPrefObserver(name, observer);
   priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   os_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
   os_priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
 #endif
@@ -193,7 +194,7 @@
     SyncedPrefObserver* observer) {
   pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
   priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   os_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
   os_priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
 #endif
@@ -211,7 +212,7 @@
     priority_pref_sync_associator_.RegisterPref(path);
     return;
   }
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF) {
     if (chromeos::features::IsSplitSettingsSyncEnabled()) {
       // Register the pref under the new ModelType::OS_PREFERENCES.
@@ -248,7 +249,7 @@
 void PrefServiceSyncable::ProcessPrefChange(const std::string& name) {
   pref_sync_associator_.ProcessPrefChange(name);
   priority_pref_sync_associator_.ProcessPrefChange(name);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   os_pref_sync_associator_.ProcessPrefChange(name);
   os_priority_pref_sync_associator_.ProcessPrefChange(name);
 #endif
diff --git a/components/sync_preferences/pref_service_syncable.h b/components/sync_preferences/pref_service_syncable.h
index 30c4667..58e92f3 100644
--- a/components/sync_preferences/pref_service_syncable.h
+++ b/components/sync_preferences/pref_service_syncable.h
@@ -14,6 +14,7 @@
 #include "base/callback_forward.h"
 #include "base/macros.h"
 #include "base/observer_list.h"
+#include "build/chromeos_buildflags.h"
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/pref_service.h"
 #include "components/sync_preferences/pref_model_associator.h"
@@ -71,7 +72,7 @@
   // priority preferences.
   bool IsPrioritySyncing();
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // As above, but for OS preferences.
   bool AreOsPrefsSyncing();
 
@@ -111,7 +112,7 @@
   PrefModelAssociator pref_sync_associator_;
   PrefModelAssociator priority_pref_sync_associator_;
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
   // Associators for Chrome OS system preferences.
   PrefModelAssociator os_pref_sync_associator_;
   PrefModelAssociator os_priority_pref_sync_associator_;
diff --git a/components/sync_preferences/pref_service_syncable_unittest.cc b/components/sync_preferences/pref_service_syncable_unittest.cc
index 2f33f272..e689cba 100644
--- a/components/sync_preferences/pref_service_syncable_unittest.cc
+++ b/components/sync_preferences/pref_service_syncable_unittest.cc
@@ -17,6 +17,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/metrics/histogram_tester.h"
+#include "build/chromeos_buildflags.h"
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/pref_notifier_impl.h"
 #include "components/prefs/scoped_user_pref_update.h"
@@ -35,7 +36,7 @@
 #include "components/sync_preferences/testing_pref_service_syncable.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 #include "base/test/scoped_feature_list.h"
 #include "chromeos/constants/chromeos_features.h"
 #include "testing/gmock/include/gmock/gmock-matchers.h"
@@ -70,7 +71,7 @@
 const char kNonDefaultCharsetValue[] = "foo";
 const char kDefaultCharsetValue[] = "utf-8";
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 constexpr ModelTypeSet kAllPreferenceModelTypes(
     syncer::PREFERENCES,
     syncer::PRIORITY_PREFERENCES,
@@ -81,7 +82,7 @@
   const syncer::SyncChange& sync_change = arg;
   return Matches(model_type)(sync_change.sync_data().GetDataType());
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 class TestSyncProcessorStub : public syncer::SyncChangeProcessor {
  public:
@@ -861,7 +862,7 @@
   EXPECT_TRUE(pref->IsDefaultValue());
 }
 
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
 // The Chrome OS tests exercise pref model association that happens in the
 // constructor of PrefServiceSyncable. The tests must register prefs first,
 // then create the PrefServiceSyncable object. The tests live in this file
@@ -1198,7 +1199,7 @@
 
   prefs_->RemoveSyncedPrefObserver("os_pref", &observer);
 }
-#endif  // defined(OS_CHROMEOS)
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 }  // namespace
 
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
index bbbbda31..29d3d8b2 100644
--- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
+++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -463,6 +463,10 @@
   RunAomTest(FILE_PATH_LITERAL("aom-checked.html"));
 }
 
+IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAomLiveRegion) {
+  RunAomTest(FILE_PATH_LITERAL("aom-live-region.html"));
+}
+
 // TODO(crbug.com/983709): Flaky.
 IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
                        DISABLED_AccessibilityAriaActivedescendant) {
diff --git a/content/browser/appcache/appcache_quota_client.cc b/content/browser/appcache/appcache_quota_client.cc
index f76f74c..e24a20b 100644
--- a/content/browser/appcache/appcache_quota_client.cc
+++ b/content/browser/appcache/appcache_quota_client.cc
@@ -237,8 +237,8 @@
 AppCacheQuotaClient::GetServiceDeleteCallback() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 
-  // Lazily created due to base::CancelableCallback's threading restrictions,
-  // there is no way to detach from the thread created on.
+  // Lazily created due to base::CancelableRepeatingCallback's threading
+  // restrictions, there is no way to detach from the thread created on.
   if (!service_delete_callback_) {
     service_delete_callback_ =
         std::make_unique<net::CancelableCompletionRepeatingCallback>(
diff --git a/content/browser/back_forward_cache_browsertest.cc b/content/browser/back_forward_cache_browsertest.cc
index 13df3f1..ac7e9af68 100644
--- a/content/browser/back_forward_cache_browsertest.cc
+++ b/content/browser/back_forward_cache_browsertest.cc
@@ -8518,11 +8518,9 @@
   }
 }
 
-// Sandboxed documents are not cached because we don't properly restore sandbox
-// flags at the moment.
-// TODO(altimin, carlscab): Remove this after sandbox flags will move to RFH /
-// BrowsingInstanceFrameState.
-IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, SandboxedFramesNotCached) {
+// Check that sandboxed documents are cached and won't lose their sandbox flags
+// after restoration.
+IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, CspSandbox) {
   ASSERT_TRUE(embedded_test_server()->Start());
 
   GURL url_a(
@@ -8533,27 +8531,52 @@
 
   // 1) Navigate to A, which should set CSP.
   EXPECT_TRUE(NavigateToURL(shell(), url_a));
-
-  // Check that CSP was set.
+  RenderFrameHostImpl* rfh_a = current_frame_host();
+  RenderFrameDeletedObserver delete_observer_rfh_a(rfh_a);
   {
     const std::vector<network::mojom::ContentSecurityPolicyHeader>& root_csp =
         current_frame_host()
             ->frame_tree_node()
             ->current_replication_state()
             .accumulated_csp_headers;
-    EXPECT_EQ(1u, root_csp.size());
-    EXPECT_EQ("sandbox", root_csp[0].header_value);
-  }
+    ASSERT_EQ(1u, root_csp.size());
+    ASSERT_EQ("sandbox", root_csp[0].header_value);
+    ASSERT_EQ(network::mojom::WebSandboxFlags::kAll,
+              current_frame_host()->active_sandbox_flags());
+  };
 
-  // 2) Navigate to B.
+  // 2) Navigate to B. Expect the previous RenderFrameHost to enter the bfcache.
   EXPECT_TRUE(NavigateToURL(shell(), url_b));
+  EXPECT_FALSE(delete_observer_rfh_a.deleted());
+  EXPECT_TRUE(rfh_a->IsInBackForwardCache());
+  {
+    const std::vector<network::mojom::ContentSecurityPolicyHeader>& root_csp =
+        current_frame_host()
+            ->frame_tree_node()
+            ->current_replication_state()
+            .accumulated_csp_headers;
+    ASSERT_EQ(0u, root_csp.size());
+    ASSERT_EQ(network::mojom::WebSandboxFlags::kNone,
+              current_frame_host()->active_sandbox_flags());
+  };
 
-  // 3) Navigate back and expect that the page wasn't restored from bfcache.
+  // 3) Navigate back and expect the page to be restored, with the correct
+  // CSP and sandbox flags.
   web_contents()->GetController().GoBack();
   EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
-  ExpectNotRestored(
-      {BackForwardCacheMetrics::NotRestoredReason::kFrameTreeNodeStateReset},
-      FROM_HERE);
+  EXPECT_FALSE(delete_observer_rfh_a.deleted());
+  EXPECT_EQ(current_frame_host(), rfh_a);
+  {
+    const std::vector<network::mojom::ContentSecurityPolicyHeader>& root_csp =
+        current_frame_host()
+            ->frame_tree_node()
+            ->current_replication_state()
+            .accumulated_csp_headers;
+    ASSERT_EQ(1u, root_csp.size());
+    ASSERT_EQ("sandbox", root_csp[0].header_value);
+    ASSERT_EQ(network::mojom::WebSandboxFlags::kAll,
+              current_frame_host()->active_sandbox_flags());
+  };
 }
 
 class BackForwardCacheBrowserTestWithFileSystemAPISupported
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.cc b/content/browser/browsing_data/browsing_data_remover_impl.cc
index 0f89689..4fbef6e 100644
--- a/content/browser/browsing_data/browsing_data_remover_impl.cc
+++ b/content/browser/browsing_data/browsing_data_remover_impl.cc
@@ -245,7 +245,7 @@
 
   // To detect tasks that are causing slow deletions, record running sub tasks
   // after a delay.
-  slow_pending_tasks_closure_.Reset(base::BindRepeating(
+  slow_pending_tasks_closure_.Reset(base::BindOnce(
       &BrowsingDataRemoverImpl::RecordUnfinishedSubTasks, GetWeakPtr()));
   GetUIThreadTaskRunner({})->PostDelayedTask(
       FROM_HERE, slow_pending_tasks_closure_.callback(), kSlowTaskTimeout);
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.h b/content/browser/browsing_data/browsing_data_remover_impl.h
index 3da116a7..64eabd6 100644
--- a/content/browser/browsing_data/browsing_data_remover_impl.h
+++ b/content/browser/browsing_data/browsing_data_remover_impl.h
@@ -230,7 +230,7 @@
 
   // Fires after some time to track slow tasks. Cancelled when all tasks
   // are finished.
-  base::CancelableClosure slow_pending_tasks_closure_;
+  base::CancelableOnceClosure slow_pending_tasks_closure_;
 
   // Observers of the global state and individual tasks.
   base::ObserverList<Observer, true>::Unchecked observer_list_;
diff --git a/content/browser/media/media_devices_permission_checker_unittest.cc b/content/browser/media/media_devices_permission_checker_unittest.cc
index ede7220..1f9784f0 100644
--- a/content/browser/media/media_devices_permission_checker_unittest.cc
+++ b/content/browser/media/media_devices_permission_checker_unittest.cc
@@ -10,6 +10,7 @@
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_delegate.h"
+#include "content/public/test/navigation_simulator.h"
 #include "content/public/test/test_renderer_host.h"
 #include "content/test/test_render_view_host.h"
 #include "content/test/test_web_contents.h"
@@ -49,12 +50,13 @@
   // page to simulate that.
   void RefreshPageAndSetHeaderPolicy(blink::mojom::FeaturePolicyFeature feature,
                                      bool enabled) {
-    NavigateAndCommit(origin_.GetURL());
+    auto navigation = NavigationSimulator::CreateBrowserInitiated(
+        origin_.GetURL(), web_contents());
     std::vector<url::Origin> allowlist;
     if (enabled)
       allowlist.push_back(origin_);
-    RenderFrameHostTester::For(main_rfh())
-        ->SimulateFeaturePolicyHeader(feature, allowlist);
+    navigation->SetFeaturePolicyHeader({{feature, allowlist, false, false}});
+    navigation->Commit();
   }
 
   bool CheckPermission(MediaDeviceType device_type) {
diff --git a/content/browser/portal/portal.cc b/content/browser/portal/portal.cc
index ac35bb5..b741df68 100644
--- a/content/browser/portal/portal.cc
+++ b/content/browser/portal/portal.cc
@@ -140,9 +140,12 @@
       std::move(interface_provider_receiver),
       mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker>()
           .InitWithNewPipeAndPassReceiver(),
-      blink::mojom::TreeScopeType::kDocument, "", "", true,
-      base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
+      // Pass a null receiver for PolicyContainerHost. The PolicyContainerHost
+      // remote is sent to Blink in the CreateRenderView mojo message.
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      "", "", true, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false,
       blink::mojom::FrameOwnerElementType::kPortal);
   outer_node->AddObserver(this);
 
diff --git a/content/browser/renderer_host/back_forward_cache_can_store_document_result.cc b/content/browser/renderer_host/back_forward_cache_can_store_document_result.cc
index d597faad..3f5dc8b 100644
--- a/content/browser/renderer_host/back_forward_cache_can_store_document_result.cc
+++ b/content/browser/renderer_host/back_forward_cache_can_store_document_result.cc
@@ -131,9 +131,6 @@
       return "BackForwardCache is disabled through command line (may include "
              "cases where the embedder disabled it due to, e.g., enterprise "
              "policy)";
-    case Reason::kFrameTreeNodeStateReset:
-      return "document-associated state stored in FrameTreeNode was lost after "
-             "navigating away";
   }
 }
 
diff --git a/content/browser/renderer_host/back_forward_cache_metrics.h b/content/browser/renderer_host/back_forward_cache_metrics.h
index da3f7bc..93d9200 100644
--- a/content/browser/renderer_host/back_forward_cache_metrics.h
+++ b/content/browser/renderer_host/back_forward_cache_metrics.h
@@ -85,8 +85,7 @@
     // BackForwardCache is disabled due to command-line switch (may include
     // cases where the embedder disabled it due to, e.g., enterprise policy).
     kBackForwardCacheDisabledByCommandLine = 35,
-    kFrameTreeNodeStateReset = 36,
-    kMaxValue = kFrameTreeNodeStateReset,
+    kMaxValue = kBackForwardCacheDisabledByCommandLine,
   };
 
   using NotRestoredReasons =
diff --git a/content/browser/renderer_host/frame_tree.cc b/content/browser/renderer_host/frame_tree.cc
index 45dc1aa..82d7b5b7 100644
--- a/content/browser/renderer_host/frame_tree.cc
+++ b/content/browser/renderer_host/frame_tree.cc
@@ -184,6 +184,8 @@
         interface_provider_receiver,
     mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
         browser_interface_broker_receiver,
+    mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+        policy_container_host_receiver,
     blink::mojom::TreeScopeType scope,
     const std::string& frame_name,
     const std::string& frame_unique_name,
@@ -233,6 +235,11 @@
   added_node->current_frame_host()->BindBrowserInterfaceBrokerReceiver(
       std::move(browser_interface_broker_receiver));
 
+  if (policy_container_host_receiver) {
+    added_node->current_frame_host()->policy_container_host()->Bind(
+        std::move(policy_container_host_receiver));
+  }
+
   // The last committed NavigationEntry may have a FrameNavigationEntry with the
   // same |frame_unique_name|, since we don't remove FrameNavigationEntries if
   // their frames are deleted.  If there is a stale one, remove it to avoid
diff --git a/content/browser/renderer_host/frame_tree.h b/content/browser/renderer_host/frame_tree.h
index 69fd224..f6c41071 100644
--- a/content/browser/renderer_host/frame_tree.h
+++ b/content/browser/renderer_host/frame_tree.h
@@ -165,6 +165,8 @@
           interface_provider_receiver,
       mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
           browser_interface_broker_receiver,
+      mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+          policy_container_host_receiver,
       blink::mojom::TreeScopeType scope,
       const std::string& frame_name,
       const std::string& frame_unique_name,
diff --git a/content/browser/renderer_host/frame_tree_node.cc b/content/browser/renderer_host/frame_tree_node.cc
index b72d529..5727736 100644
--- a/content/browser/renderer_host/frame_tree_node.cc
+++ b/content/browser/renderer_host/frame_tree_node.cc
@@ -235,12 +235,8 @@
   return frame_tree_->root() == this;
 }
 
-FrameTreeNode::ResetForNavigationResult FrameTreeNode::ResetForNavigation(
+void FrameTreeNode::ResetForNavigation(
     bool was_served_from_back_forward_cache) {
-  // TODO(altimin,carlscab): Remove this logic after the relevant states are
-  // moved to RenderFrameHost or BrowsingInstanceFrameState.
-  ResetForNavigationResult result;
-
   replication_state_.accumulated_csp_headers.clear();
   if (!was_served_from_back_forward_cache) {
     render_manager_.OnDidResetContentSecurityPolicy();
@@ -253,15 +249,9 @@
     // they already have the correct value.
   }
 
-  // Clear any CSP-set sandbox flags, and the declared feature policy for the
-  // frame.
-  // TODO(https://crbug.com/1145886): Remove this.
-  result.changed_frame_policy =
-      UpdateFramePolicyHeaders(network::mojom::WebSandboxFlags::kNone, {});
-
-  // This frame has had its user activation bits cleared in the renderer
-  // before arriving here. We just need to clear them here and in the other
-  // renderer processes that may have a reference to this frame.
+  // This frame has had its user activation bits cleared in the renderer before
+  // arriving here. We just need to clear them here and in the other renderer
+  // processes that may have a reference to this frame.
   //
   // We do not take user activation into account when calculating
   // |ResetForNavigationResult|, as we are using it to determine bfcache
@@ -269,8 +259,6 @@
   UpdateUserActivationState(
       blink::mojom::UserActivationUpdateType::kClearActivation,
       blink::mojom::UserActivationNotificationType::kNone);
-
-  return result;
 }
 
 size_t FrameTreeNode::GetFrameTreeSize() const {
diff --git a/content/browser/renderer_host/frame_tree_node.h b/content/browser/renderer_host/frame_tree_node.h
index 624c724f..d9f2987 100644
--- a/content/browser/renderer_host/frame_tree_node.h
+++ b/content/browser/renderer_host/frame_tree_node.h
@@ -93,19 +93,13 @@
 
   bool IsMainFrame() const;
 
-  struct ResetForNavigationResult {
-    bool changed_frame_policy = false;
-  };
-
-  // Clears any state in this node which was set by the document itself (CSP
-  // Headers, Feature Policy Headers, and CSP-set sandbox flags), and notifies
-  // proxies as appropriate. Invoked after committing navigation to a new
-  // document (since the new document comes with a fresh set of CSP and
-  // Feature-Policy HTTP headers).
-  // Returns the details of the reset result — whether any important state (e.g.
-  // frame policy headers) was lost during the update.
-  ResetForNavigationResult ResetForNavigation(
-      bool was_served_from_back_forward_cache);
+  // Clears any state in this node which was set by the document itself (CSP &
+  // UserActivationState) and notifies proxies as appropriate. Invoked after
+  // committing navigation to a new document (since the new document comes with
+  // a fresh set of CSP).
+  // TODO(arthursonzogni): Remove this function. The frame/document must not be
+  // left temporarily with lax state.
+  void ResetForNavigation(bool was_served_from_back_forward_cache);
 
   FrameTree* frame_tree() const { return frame_tree_; }
   Navigator& navigator() { return frame_tree()->navigator(); }
diff --git a/content/browser/renderer_host/frame_tree_node_blame_context_unittest.cc b/content/browser/renderer_host/frame_tree_node_blame_context_unittest.cc
index 043800e7..2b0c893 100644
--- a/content/browser/renderer_host/frame_tree_node_blame_context_unittest.cc
+++ b/content/browser/renderer_host/frame_tree_node_blame_context_unittest.cc
@@ -101,6 +101,7 @@
           node->current_frame_host(), process_id(), child_id,
           TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
           TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+          mojo::NullAssociatedReceiver(),
           blink::mojom::TreeScopeType::kDocument, std::string(),
           base::StringPrintf("uniqueName%d", child_id), false,
           base::UnguessableToken::Create(), base::UnguessableToken::Create(),
diff --git a/content/browser/renderer_host/frame_tree_unittest.cc b/content/browser/renderer_host/frame_tree_unittest.cc
index 0f28e549..fe61fc3 100644
--- a/content/browser/renderer_host/frame_tree_unittest.cc
+++ b/content/browser/renderer_host/frame_tree_unittest.cc
@@ -63,6 +63,11 @@
   return TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver();
 }
 
+mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+CreateStubPolicyContainerHostReceiver() {
+  return TestRenderFrameHost::CreateStubPolicyContainerHostReceiver();
+}
+
 // Logs calls to WebContentsObserver along with the state of the frame tree,
 // for later use in EXPECT_EQ().
 class TreeWalkingWebContentsLogger : public WebContentsObserver {
@@ -173,6 +178,7 @@
   frame_tree->AddFrame(root->current_frame_host(), process_id, 14,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName0", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -180,6 +186,7 @@
   frame_tree->AddFrame(root->current_frame_host(), process_id, 15,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName1", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -187,6 +194,7 @@
   frame_tree->AddFrame(root->current_frame_host(), process_id, 16,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName2", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -194,6 +202,7 @@
   frame_tree->AddFrame(root->child_at(0)->current_frame_host(), process_id, 244,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName3", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -201,6 +210,7 @@
   frame_tree->AddFrame(root->child_at(1)->current_frame_host(), process_id, 255,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, no_children_node,
                        "uniqueName4", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -208,6 +218,7 @@
   frame_tree->AddFrame(root->child_at(0)->current_frame_host(), process_id, 245,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName5", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -223,6 +234,7 @@
   frame_tree->AddFrame(child_16->current_frame_host(), process_id, 264,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName6", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -230,6 +242,7 @@
   frame_tree->AddFrame(child_16->current_frame_host(), process_id, 265,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName7", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -237,6 +250,7 @@
   frame_tree->AddFrame(child_16->current_frame_host(), process_id, 266,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName8", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -244,6 +258,7 @@
   frame_tree->AddFrame(child_16->current_frame_host(), process_id, 267,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, deep_subtree,
                        "uniqueName9", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -251,6 +266,7 @@
   frame_tree->AddFrame(child_16->current_frame_host(), process_id, 268,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName10", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -260,6 +276,7 @@
   frame_tree->AddFrame(child_267->current_frame_host(), process_id, 365,
                        CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName11", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -267,6 +284,7 @@
   frame_tree->AddFrame(child_267->child_at(0)->current_frame_host(), process_id,
                        455, CreateStubInterfaceProviderReceiver(),
                        CreateStubBrowserInterfaceBrokerReceiver(),
+                       mojo::NullAssociatedReceiver(),
                        blink::mojom::TreeScopeType::kDocument, std::string(),
                        "uniqueName12", false, base::UnguessableToken::Create(),
                        base::UnguessableToken::Create(), blink::FramePolicy(),
@@ -275,18 +293,18 @@
       child_267->child_at(0)->child_at(0)->current_frame_host(), process_id,
       555, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName13",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName13", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
   frame_tree->AddFrame(
       child_267->child_at(0)->child_at(0)->child_at(0)->current_frame_host(),
       process_id, 655, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName14",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName14", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
 
   // Now that's it's fully built, verify the tree structure is as expected.
   EXPECT_EQ(
@@ -361,18 +379,21 @@
   main_test_rfh()->OnCreateChildFrame(
       22, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "child0", "uniqueName0", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
   main_test_rfh()->OnCreateChildFrame(
       23, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "child1", "uniqueName1", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
   main_test_rfh()->OnCreateChildFrame(
       24, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName2",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -384,6 +405,7 @@
   child1->current_frame_host()->OnCreateChildFrame(
       33, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "grandchild", "uniqueName3",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -426,18 +448,21 @@
   main_test_rfh()->OnCreateChildFrame(
       22, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "child0", "uniqueName0", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
   main_test_rfh()->OnCreateChildFrame(
       23, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "child1", "uniqueName1", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
   main_test_rfh()->OnCreateChildFrame(
       24, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "child2", "uniqueName2", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -449,6 +474,7 @@
   child1->current_frame_host()->OnCreateChildFrame(
       33, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "grandchild", "uniqueName3",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -484,6 +510,7 @@
   main_test_rfh()->OnCreateChildFrame(
       14, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName0",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -494,6 +521,7 @@
   main_test_rfh()->OnCreateChildFrame(
       18, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -518,6 +546,7 @@
   main_test_rfh()->OnCreateChildFrame(
       22, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName0",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -528,6 +557,7 @@
   main_test_rfh()->OnCreateChildFrame(
       23, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -561,9 +591,10 @@
       root->current_frame_host(), process_id + 1, 1,
       CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName0",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName0", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false,
       blink::mojom::FrameOwnerElementType::kIframe));
   ASSERT_EQ("1: []", GetTreeState(frame_tree));
 }
@@ -580,12 +611,14 @@
   main_test_rfh()->OnCreateChildFrame(
       22, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName0",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
   main_test_rfh()->OnCreateChildFrame(
       23, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -595,6 +628,7 @@
   child1_rfh->OnCreateChildFrame(
       33, CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName2",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc b/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
index 1527a4de..abe6bf3 100644
--- a/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
+++ b/content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc
@@ -17,9 +17,11 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/media_stream_request.h"
 #include "content/public/test/browser_task_environment.h"
-#include "content/test/test_render_frame_host.h"
+#include "content/public/test/navigation_simulator.h"
+#include "content/test/test_render_view_host.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/common/feature_policy/feature_policy.h"
 #include "third_party/blink/public/common/web_preferences/web_preferences.h"
 #include "ui/gfx/geometry/rect.h"
 #include "url/gurl.h"
@@ -401,10 +403,10 @@
   // page to simulate that.
   void RefreshPageAndSetHeaderPolicy(
       blink::mojom::FeaturePolicyFeature feature) {
-    NavigateAndCommit(main_rfh()->GetLastCommittedURL());
-    std::vector<url::Origin> empty_allowlist;
-    RenderFrameHostTester::For(main_rfh())
-        ->SimulateFeaturePolicyHeader(feature, empty_allowlist);
+    auto navigation = NavigationSimulator::CreateRendererInitiated(
+        main_rfh()->GetLastCommittedURL(), main_rfh());
+    navigation->SetFeaturePolicyHeader({{feature, {}, false, false}});
+    navigation->Commit();
   }
 
   void GetResultForRequest(std::unique_ptr<MediaStreamRequest> request,
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
index 1f9185a6..30ce9df 100644
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -1946,6 +1946,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name0,
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -1984,6 +1985,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name1,
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -2022,6 +2024,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name2,
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -2078,6 +2081,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name, false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -3051,6 +3055,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name, false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -3200,6 +3205,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name, false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -4256,6 +4262,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name, false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
index 969037c..6c59aec 100644
--- a/content/browser/renderer_host/navigator.cc
+++ b/content/browser/renderer_host/navigator.cc
@@ -335,18 +335,8 @@
     if (!navigation_request->IsServedFromBackForwardCache())
       render_frame_host->ResetContentSecurityPolicies();
 
-    auto reset_result = frame_tree_node->ResetForNavigation(
+    frame_tree_node->ResetForNavigation(
         navigation_request->IsServedFromBackForwardCache());
-
-    // |old_frame_host| might get immediately deleted after the DidNavigateFrame
-    // call above, so use weak pointer here.
-    if (old_frame_host && old_frame_host->IsInBackForwardCache()) {
-      if (reset_result.changed_frame_policy) {
-        old_frame_host->EvictFromBackForwardCacheWithReason(
-            BackForwardCacheMetrics::NotRestoredReason::
-                kFrameTreeNodeStateReset);
-      }
-    }
   }
 
   // Update the site of the SiteInstance if it doesn't have one yet, unless
diff --git a/content/browser/renderer_host/render_frame_host_feature_policy_unittest.cc b/content/browser/renderer_host/render_frame_host_feature_policy_unittest.cc
index 8bba74a..ec929594 100644
--- a/content/browser/renderer_host/render_frame_host_feature_policy_unittest.cc
+++ b/content/browser/renderer_host/render_frame_host_feature_policy_unittest.cc
@@ -54,11 +54,11 @@
                                      blink::mojom::FeaturePolicyFeature feature,
                                      const std::vector<std::string>& origins) {
     RenderFrameHost* current = *rfh;
-    SimulateNavigation(&current, current->GetLastCommittedURL());
-    static_cast<TestRenderFrameHost*>(current)->DidSetFramePolicyHeaders(
-        network::mojom::WebSandboxFlags::kNone,
-        CreateFPHeader(feature, origins), {} /* document_policy_header */);
-    *rfh = current;
+    auto navigation = NavigationSimulator::CreateRendererInitiated(
+        current->GetLastCommittedURL(), current);
+    navigation->SetFeaturePolicyHeader(CreateFPHeader(feature, origins));
+    navigation->Commit();
+    *rfh = navigation->GetFinalRenderFrameHost();
   }
 
   void SetContainerPolicy(RenderFrameHost* parent,
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index d2ca1f6..5ee713e7 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -2553,6 +2553,8 @@
         new_interface_provider_provider_receiver,
     mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
         browser_interface_broker_receiver,
+    mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+        policy_container_host_receiver,
     blink::mojom::TreeScopeType scope,
     const std::string& frame_name,
     const std::string& frame_unique_name,
@@ -2566,6 +2568,7 @@
   DCHECK(!frame_unique_name.empty());
   DCHECK(new_interface_provider_provider_receiver.is_valid());
   DCHECK(browser_interface_broker_receiver.is_valid());
+  DCHECK(policy_container_host_receiver.is_valid());
   if (owner_type == blink::mojom::FrameOwnerElementType::kNone) {
     // Any child frame must have a HTMLFrameOwnerElement in its parent document
     // and therefore the corresponding type of kNone (specific to main frames)
@@ -2590,7 +2593,8 @@
   // process.
   frame_tree_->AddFrame(this, GetProcess()->GetID(), new_routing_id,
                         std::move(new_interface_provider_provider_receiver),
-                        std::move(browser_interface_broker_receiver), scope,
+                        std::move(browser_interface_broker_receiver),
+                        std::move(policy_container_host_receiver), scope,
                         frame_name, frame_unique_name, is_created_by_script,
                         frame_token, devtools_frame_token, frame_policy,
                         frame_owner_properties, was_discarded_, owner_type);
@@ -2602,6 +2606,8 @@
         new_interface_provider_provider_receiver,
     mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
         browser_interface_broker_receiver,
+    mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+        policy_container_host_receiver,
     blink::mojom::TreeScopeType scope,
     const std::string& frame_name,
     const std::string& frame_unique_name,
@@ -2623,7 +2629,8 @@
   // match the mojo interface.
   OnCreateChildFrame(
       new_routing_id, std::move(new_interface_provider_provider_receiver),
-      std::move(browser_interface_broker_receiver), scope, frame_name,
+      std::move(browser_interface_broker_receiver),
+      std::move(policy_container_host_receiver), scope, frame_name,
       frame_unique_name, is_created_by_script, frame_token,
       devtools_frame_token, frame_policy, *frame_owner_properties, owner_type);
 }
@@ -2651,6 +2658,27 @@
 
   if (did_create_new_document)
     DidCommitNewDocument(params, navigation_request);
+
+  // When the frame hosts a different document, its state must be replicated
+  // via its proxies to the other processes where it appears as remote.
+  //
+  // This includes new documents. It also includes documents restored from the
+  // BackForwardCache. This is because the cached state in
+  // FrameTreeNode::replication_state_ needs to be refreshed with the actual
+  // values.
+  if (!navigation_request->IsSameDocument()) {
+    // Feature policy's inheritance from parent frame's feature policy is
+    // through accessing parent frame's security context(either remote or local)
+    // when initializing child's security context, so the update to proxies is
+    // needed.
+    frame_tree_node()->UpdateFramePolicyHeaders(active_sandbox_flags_,
+                                                feature_policy_header_);
+    // Document policy's inheritance from parent frame's required document
+    // policy is done at |HTMLFrameOwnerElement::UpdateRequiredPolicy|. Parent
+    // frame owns both parent's required document policy and child frame's frame
+    // owner element which contains child's required document policy, so there
+    // is no need to store required document policy in proxies.
+  }
 }
 
 void RenderFrameHostImpl::SetLastCommittedOrigin(const url::Origin& origin) {
@@ -4018,67 +4046,6 @@
   delegate_->DidChangeName(this, name);
 }
 
-void RenderFrameHostImpl::DidSetFramePolicyHeaders(
-    network::mojom::WebSandboxFlags sandbox_flags,
-    const blink::ParsedFeaturePolicy& feature_policy_header,
-    const blink::DocumentPolicyFeatureState& document_policy_header) {
-  // TODO(https://crbug.com/1093268): Investigate why this IPC can be received
-  // before the navigation commit. This can be triggered when loading an error
-  // page using the test:
-  // CrossOriginOpenerPolicyBrowserTest.NetworkErrorOnSandboxedPopups.
-  if (lifecycle_state() == LifecycleState::kSpeculative)
-    return;
-
-  // We should not be updating policy headers when the RenderFrameHost is in
-  // BackForwardCache. If this is called when the RenderFrameHost is in
-  // BackForwardCache, evict the document.
-  if (IsInactiveAndDisallowReactivation())
-    return;
-
-  // We shouldn't update policy headers for non-current frames.
-  DCHECK(IsCurrent());
-
-  // Rebuild |feature_policy_| for this frame.
-  ResetFeaturePolicy();
-  feature_policy_->SetHeaderPolicy(feature_policy_header);
-
-  // Rebuild |document_policy_| for this frame.
-  // Note: document_policy_header is the document policy state used to
-  // initialize |document_policy_| in SecurityContext on renderer side. It is
-  // supposed to be compatible with required_document_policy. If not, kill the
-  // renderer.
-  if (blink::DocumentPolicy::IsPolicyCompatible(
-          frame_tree_node()->effective_frame_policy().required_document_policy,
-          document_policy_header)) {
-    document_policy_ = blink::DocumentPolicy::CreateWithHeaderPolicy(
-        {document_policy_header, {} /* endpoint_map */});
-  } else {
-    bad_message::ReceivedBadMessage(
-        GetProcess(), bad_message::RFH_BAD_DOCUMENT_POLICY_HEADER);
-    return;
-  }
-
-  // Update the feature policy and sandbox flags in the frame tree. This will
-  // send any updates to proxies if necessary.
-  //
-  // Feature policy's inheritance from parent frame's feature policy is through
-  // accessing parent frame's security context(either remote or local) when
-  // initializing child's security context, so the update to proxies is needed.
-  //
-  // Document policy's inheritance from parent frame's required document policy
-  // is done at |HTMLFrameOwnerElement::UpdateRequiredPolicy|. Parent frame owns
-  // both parent required document policy and child frame's frame owner element
-  // which contains child's required document policy, so there is no need to
-  // store required document policy in proxies.
-  frame_tree_node()->UpdateFramePolicyHeaders(sandbox_flags,
-                                              feature_policy_header);
-
-  // Save a copy of the now-active sandbox flags on this RFHI.
-  active_sandbox_flags_ = frame_tree_node()->active_sandbox_flags();
-
-  CheckSandboxFlags();
-}
-
 void RenderFrameHostImpl::EnforceInsecureRequestPolicy(
     blink::mojom::InsecureRequestPolicy policy) {
   frame_tree_node()->SetInsecureRequestPolicy(policy);
@@ -7237,8 +7204,12 @@
 
 void RenderFrameHostImpl::NavigationRequestCancelled(
     NavigationRequest* navigation_request) {
-  OnCrossDocumentCommitProcessed(navigation_request,
-                                 blink::mojom::CommitResult::Aborted);
+  // Remove the requests from the list of NavigationRequests waiting to commit.
+  // RenderDocument should obsolete the need for this, as always swapping RFHs
+  // means that it won't be necessary to clean up the list of navigation
+  // requests when the renderer aborts a navigation--instead, we'll always just
+  // throw away the entire speculative RFH.
+  navigation_requests_.erase(navigation_request);
 }
 
 NavigationRequest*
@@ -7771,12 +7742,6 @@
   InstalledAppProviderImpl::Create(this, std::move(receiver));
 }
 
-void RenderFrameHostImpl::BindPolicyContainer(
-    mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
-        receiver) {
-  policy_container_host_->Bind(std::move(receiver));
-}
-
 void RenderFrameHostImpl::CreateDedicatedWorkerHostFactory(
     mojo::PendingReceiver<blink::mojom::DedicatedWorkerHostFactory> receiver) {
   // Allocate the worker in the same process as the creator.
@@ -8481,6 +8446,18 @@
     }
   }
 
+  // Note: document_policy_header is the document policy state used to
+  // initialize |document_policy_| in SecurityContext on renderer side. It is
+  // supposed to be compatible with required_document_policy. If not, kill the
+  // renderer.
+  if (!blink::DocumentPolicy::IsPolicyCompatible(
+          frame_tree_node()->effective_frame_policy().required_document_policy,
+          params->document_policy_header)) {
+    bad_message::ReceivedBadMessage(
+        GetProcess(), bad_message::RFH_BAD_DOCUMENT_POLICY_HEADER);
+    return false;
+  }
+
   return true;
 }
 
@@ -8694,12 +8671,14 @@
   // new ones.
   DCHECK(!navigation_request->IsServedFromBackForwardCache());
 
-  // After setting the last committed origin, reset the feature policy and
-  // sandbox flags in the RenderFrameHost to a blank policy based on the
-  // parent frame or opener frame.
   ResetFeaturePolicy();
-  active_sandbox_flags_ = frame_tree_node()->active_sandbox_flags();
-  document_policy_ = blink::DocumentPolicy::CreateWithHeaderPolicy({});
+  active_sandbox_flags_ = params.sandbox_flags;
+  feature_policy_header_ = params.feature_policy_header;
+  feature_policy_->SetHeaderPolicy(params.feature_policy_header);
+  document_policy_ = blink::DocumentPolicy::CreateWithHeaderPolicy({
+      params.document_policy_header,  // document_policy_header
+      {},                             // endpoint_map
+  });
 
   // Since we're changing documents, we should reset the event handler
   // trackers.
@@ -8739,21 +8718,13 @@
   // this frame embeds a subframe when that subframe navigates).
   required_csp_ = navigation_request->TakeRequiredCSP();
 
-  // Keep track of the sandbox policy of the document that has just committed.
-  // It will be compared with the value computed from the renderer. The latter
-  // is expected to be received in DidSetFramePolicyHeaders(..).
+  // TODO(https://crbug.com/1041376): The sandbox flags computed from the
+  // browser must match with the ones computed from the renderer process.
+  // Ultimately, the one from the browser process should supersede the
+  // renderer one. The browser will just "push" the correct value.
   if (navigation_request->state() >=
       NavigationRequest::NavigationState::WILL_PROCESS_RESPONSE) {
-    active_sandbox_flags_control_ = navigation_request->SandboxFlagsToCommit();
-  } else {
-    // Navigations that are known by the browser only at DidCommit time will
-    // have their state set to WILL_START_REQUEST and won't have sandbox flags
-    // that are calculated by the browser before commit.
-    // TODO(https://crbug.com/1133115): Remove this once all the cross-document
-    // cases of those navigations have been removed.
-    DCHECK_EQ(navigation_request->state(),
-              NavigationRequest::NavigationState::WILL_START_REQUEST);
-    active_sandbox_flags_control_.reset();
+    DCHECK_EQ(params.sandbox_flags, navigation_request->SandboxFlagsToCommit());
   }
 
   coep_reporter_ = navigation_request->TakeCoepReporter();
@@ -8834,27 +8805,6 @@
   }
 }
 
-void RenderFrameHostImpl::OnCrossDocumentCommitProcessed(
-    NavigationRequest* navigation_request,
-    blink::mojom::CommitResult result) {
-  DCHECK_NE(blink::mojom::CommitResult::RestartCrossDocument, result);
-  if (result == blink::mojom::CommitResult::Ok) {
-    // The navigation will soon be committed. Move it out of the map to the
-    // NavigationRequest that is about to commit.
-    auto find_request = navigation_requests_.find(navigation_request);
-    if (find_request != navigation_requests_.end()) {
-      navigation_request_ = std::move(find_request->second);
-    } else {
-      // This frame might be used for attaching an inner WebContents in which
-      // case |navigation_requests_| are deleted during attaching.
-      // TODO(ekaramad): Add a DCHECK to ensure the FrameTreeNode is attaching
-      // an inner delegate (https://crbug.com/911161).
-    }
-  }
-  // Remove the requests from the list of NavigationRequests waiting to commit.
-  navigation_requests_.erase(navigation_request);
-}
-
 std::unique_ptr<base::trace_event::TracedValue>
 RenderFrameHostImpl::CommitAsTracedValue(
     const mojom::DidCommitProvisionalLoadParams& params) const {
@@ -9734,16 +9684,6 @@
     delegate_->OnCookiesAccessed(this, blocked);
 }
 
-void RenderFrameHostImpl::CheckSandboxFlags() {
-  if (!active_sandbox_flags_control_)
-    return;
-
-  if (active_sandbox_flags_ == *active_sandbox_flags_control_)
-    return;
-
-  DCHECK(false);
-}
-
 void RenderFrameHostImpl::SetEmbeddingToken(
     const base::UnguessableToken& embedding_token) {
   // Everything in this method depends on whether the embedding token has
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 25b38d0..3ebbf863 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -530,6 +530,8 @@
           interface_provider_receiver,
       mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
           browser_interface_broker_receiver,
+      mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+          policy_container_host_receiver,
       blink::mojom::TreeScopeType scope,
       const std::string& frame_name,
       const std::string& frame_unique_name,
@@ -1688,9 +1690,6 @@
       network::mojom::ContentSecurityPolicyPtr parsed_csp_attribute) override;
   void DidChangeFramePolicy(const base::UnguessableToken& child_frame_token,
                             const blink::FramePolicy& frame_policy) override;
-  void BindPolicyContainer(
-      mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
-          receiver) override;
   void CapturePaintPreviewOfSubframe(
       const gfx::Rect& clip_rect,
       const base::UnguessableToken& guid) override;
@@ -1983,8 +1982,6 @@
                            NavigationCommitInIframePendingDeletionAB);
   FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
                            NavigationCommitInIframePendingDeletionABC);
-  FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
-                           CommittedOriginIncompatibleWithOriginLock);
   FRIEND_TEST_ALL_PREFIXES(
       SitePerProcessBrowserTest,
       IsDetachedSubframeObservableDuringUnloadHandlerSameProcess);
@@ -2059,6 +2056,8 @@
           interface_provider_receiver,
       mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
           browser_interface_broker_receiver,
+      mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+          policy_container_host_receiver,
       blink::mojom::TreeScopeType scope,
       const std::string& frame_name,
       const std::string& frame_unique_name,
@@ -2091,10 +2090,6 @@
       blink::mojom::ResourceLoadInfoPtr resource_load_info) override;
   void DidChangeName(const std::string& name,
                      const std::string& unique_name) override;
-  void DidSetFramePolicyHeaders(
-      network::mojom::WebSandboxFlags sandbox_flags,
-      const blink::ParsedFeaturePolicy& feature_policy_header,
-      const blink::DocumentPolicyFeatureState& document_policy_header) override;
   void CancelInitialHistoryLoad() override;
   void UpdateEncoding(const std::string& encoding) override;
   void FrameSizeChanged(const gfx::Size& frame_size) override;
@@ -2435,13 +2430,6 @@
                                      bool should_replace_current_entry,
                                      blink::mojom::CommitResult result);
 
-  // Called by the renderer process when it is done processing a cross-document
-  // commit request.
-  // TODO(https://crbug.com/1020175): this is only called with
-  // blink::mojom::CommitResult::Aborted.
-  void OnCrossDocumentCommitProcessed(NavigationRequest* navigation_request,
-                                      blink::mojom::CommitResult result);
-
   // Creates a TracedValue object containing the details of a committed
   // navigation, so it can be logged with the tracing system.
   std::unique_ptr<base::trace_event::TracedValue> CommitAsTracedValue(
@@ -2942,9 +2930,6 @@
   // See BindingsPolicy for details.
   int enabled_bindings_ = 0;
 
-  // Tracks the feature policy which has been set on this frame.
-  std::unique_ptr<blink::FeaturePolicy> feature_policy_;
-
   // Tracks the sandbox flags which are in effect on this frame. This includes
   // any flags which have been set by a Content-Security-Policy header, in
   // addition to those which are set by the embedding frame. This is initially a
@@ -2954,15 +2939,13 @@
   network::mojom::WebSandboxFlags active_sandbox_flags_ =
       network::mojom::WebSandboxFlags::kNone;
 
-  // Same as |active_sandbox_flags_|, except this is computed:
-  // - outside of the renderer process.
-  // - before loading the document.
-  //
-  // For now, this is simply used to double check this matches the renderer
-  // computation. Later this will be used as the source of truth.
-  //
-  // [OutOfBlinkSandbox](https://crbug.com/1041376)
-  base::Optional<network::mojom::WebSandboxFlags> active_sandbox_flags_control_;
+  // Parsed feature policy header. It is parsed from blink, received during
+  // DidCommitProvisionalLoad. This is constant during the whole lifetime of
+  // this document.
+  blink::ParsedFeaturePolicy feature_policy_header_;
+
+  // Tracks the feature policy which has been set on this frame.
+  std::unique_ptr<blink::FeaturePolicy> feature_policy_;
 
   // Tracks the document policy which has been set on this frame.
   std::unique_ptr<blink::DocumentPolicy> document_policy_;
diff --git a/content/browser/renderer_host/render_frame_host_manager_unittest.cc b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
index 11ec2e8..9a2d6c0 100644
--- a/content/browser/renderer_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
@@ -1812,6 +1812,7 @@
       contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame_name", "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -1819,6 +1820,7 @@
       contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame_name", "uniqueName2",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -1976,6 +1978,7 @@
       contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame_name", "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -2027,6 +2030,7 @@
       main_rfh->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName1",
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -2236,18 +2240,18 @@
       root1->current_frame_host(), process_id, 12,
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName0",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName0", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
   tree1->AddFrame(
       root1->current_frame_host(), process_id, 13,
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName1",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName1", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
 
   std::unique_ptr<TestWebContents> tab2(
       TestWebContents::Create(browser_context(), nullptr));
@@ -2259,18 +2263,18 @@
       root2->current_frame_host(), process_id, 22,
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName2",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName2", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
   tree2->AddFrame(
       root2->current_frame_host(), process_id, 23,
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName3",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName3", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
 
   std::unique_ptr<TestWebContents> tab3(
       TestWebContents::Create(browser_context(), nullptr));
@@ -2287,10 +2291,10 @@
       root4->current_frame_host(), process_id, 42,
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
-      blink::mojom::TreeScopeType::kDocument, std::string(), "uniqueName4",
-      false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
-      blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), false,
-      kOwnerType);
+      mojo::NullAssociatedReceiver(), blink::mojom::TreeScopeType::kDocument,
+      std::string(), "uniqueName4", false, base::UnguessableToken::Create(),
+      base::UnguessableToken::Create(), blink::FramePolicy(),
+      blink::mojom::FrameOwnerProperties(), false, kOwnerType);
 
   root1->child_at(1)->SetOpener(root1->child_at(1));
   root1->SetOpener(root2->child_at(1));
@@ -2356,6 +2360,7 @@
       main_test_rfh()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame1", "uniqueName1", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -2363,6 +2368,7 @@
       main_test_rfh()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame2", "uniqueName2", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -2370,6 +2376,7 @@
       main_test_rfh()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame3", "uniqueName3", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -2477,6 +2484,7 @@
       main_test_rfh()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame1", "uniqueName1", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(), kOwnerType);
@@ -3028,6 +3036,7 @@
       main_test_rfh()->GetProcess()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, "frame1", "uniqueName1", false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
@@ -3291,33 +3300,6 @@
   EXPECT_FALSE(main_test_rfh()->frame_tree_node()->navigation_request());
 }
 
-// Tests that sandbox flags received after a navigation away has started do not
-// affect the document being navigated to.
-TEST_P(RenderFrameHostManagerTest, ReceivedFramePolicyAfterNavigationStarted) {
-  // The RFH should start out with an fully permissive sandbox policy.
-  EXPECT_EQ(network::mojom::WebSandboxFlags::kNone,
-            main_test_rfh()->frame_tree_node()->active_sandbox_flags());
-
-  // Navigate, but don't commit the navigation.
-  auto navigation = NavigationSimulator::CreateBrowserInitiated(
-      GURL("http://a.com"), contents());
-  navigation->ReadyToCommit();
-
-  // Now send the frame policy for the initial page.
-  main_test_rfh()->SendFramePolicy(network::mojom::WebSandboxFlags::kAll,
-                                   {} /* feature_policy_header */,
-                                   {} /* document_policy_header */);
-
-  // Check 'SendFramePolicy' updated the active sandbox flags.
-  EXPECT_EQ(network::mojom::WebSandboxFlags::kAll,
-            main_test_rfh()->frame_tree_node()->active_sandbox_flags());
-
-  // Commit the navigation. The new frame should have a clear frame policy.
-  navigation->Commit();
-  EXPECT_EQ(network::mojom::WebSandboxFlags::kNone,
-            main_test_rfh()->frame_tree_node()->active_sandbox_flags());
-}
-
 // Check that after a navigation, the final SiteInstance has the correct
 // original URL that was used to determine its site URL.
 TEST_P(RenderFrameHostManagerTest,
diff --git a/content/browser/renderer_host/render_process_host_unittest.cc b/content/browser/renderer_host/render_process_host_unittest.cc
index ff079471..2919fa3f 100644
--- a/content/browser/renderer_host/render_process_host_unittest.cc
+++ b/content/browser/renderer_host/render_process_host_unittest.cc
@@ -157,6 +157,7 @@
       process()->GetNextRoutingID(),
       TestRenderFrameHost::CreateStubInterfaceProviderReceiver(),
       TestRenderFrameHost::CreateStubBrowserInterfaceBrokerReceiver(),
+      TestRenderFrameHost::CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, std::string(), unique_name, false,
       base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(), blink::mojom::FrameOwnerProperties(),
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index b4f92985..5234e839 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -15327,75 +15327,38 @@
                             ->GetFrameTree()
                             ->root();
 
-  // Setup an URL which will never commit, allowing this test to send its own,
-  // malformed, commit message.
-  GURL another_url(embedded_test_server()->GetURL("b.com", "/hung"));
+  GURL another_url(embedded_test_server()->GetURL("a.com", "/title2.html"));
+  const GURL bad_url = GURL("https://b.com");
 
-  // Use LoadURL, as the test shouldn't wait for navigation commit.
-  NavigationController& controller = shell()->web_contents()->GetController();
-  controller.LoadURL(another_url, Referrer(), ui::PAGE_TRANSITION_LINK,
-                     std::string());
-  EXPECT_TRUE(controller.GetPendingEntry());
-  EXPECT_EQ(another_url, controller.GetPendingEntry()->GetURL());
-  NavigationRequest* navigation_request = root->navigation_request();
-  ASSERT_TRUE(navigation_request);
-
-  RenderProcessHostBadIpcMessageWaiter kill_waiter(
-      root->current_frame_host()->GetProcess());
-
-  // Create commit params with the same URL as the start one, so URL checks
-  // pass, but use a different origin than the origin lock of the process.
-  auto params = mojom::DidCommitProvisionalLoadParams::New();
-  params->did_create_new_entry = false;
-  params->url = start_url;
-  params->referrer = blink::mojom::Referrer::New();
-  params->transition = ui::PAGE_TRANSITION_LINK;
-  params->should_update_history = false;
-  params->gesture = NavigationGestureAuto;
-  params->method = "GET";
-  params->page_state = blink::PageState::CreateFromURL(start_url);
-  params->navigation_token =
-      root->navigation_request()->commit_params().navigation_token;
-
-  // Use an origin mismatched with the origin lock.
-  params->origin = url::Origin::Create(another_url);
+  // Sanity check the process lock logic.
   auto* policy = ChildProcessSecurityPolicyImpl::GetInstance();
   int process_id = root->current_frame_host()->GetProcess()->GetID();
-  IsolationContext isolation_context(controller.GetBrowserContext());
+  IsolationContext isolation_context(
+      shell()->web_contents()->GetBrowserContext());
   auto start_url_lock = SiteInstanceImpl::DetermineProcessLock(
       isolation_context, UrlInfo::CreateForTesting(start_url),
       CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated());
   auto another_url_lock = SiteInstanceImpl::DetermineProcessLock(
       isolation_context, UrlInfo::CreateForTesting(another_url),
       CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated());
+  auto bad_url_lock = SiteInstanceImpl::DetermineProcessLock(
+      isolation_context, UrlInfo::CreateForTesting(bad_url),
+      CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated());
   EXPECT_EQ(start_url_lock, policy->GetProcessLock(process_id));
-  EXPECT_NE(another_url_lock, policy->GetProcessLock(process_id));
+  EXPECT_EQ(another_url_lock, policy->GetProcessLock(process_id));
+  EXPECT_NE(bad_url_lock, policy->GetProcessLock(process_id));
 
-  // Transfer the NavigationRequest ownership to the RenderFrameHost. The test
-  // for NavigationRequest match happens before the check of origin lock and
-  // needs to be successful.
-  root->TransferNavigationRequestOwnership(root->current_frame_host());
-  root->current_frame_host()->OnCrossDocumentCommitProcessed(
-      navigation_request, blink::mojom::CommitResult::Ok);
-
-  // Simulate a commit IPC.
-  mojo::PendingRemote<service_manager::mojom::InterfaceProvider>
-      interface_provider;
-  static_cast<mojom::FrameHost*>(root->current_frame_host())
-      ->DidCommitProvisionalLoad(
-          std::move(params),
-          mojom::DidCommitProvisionalLoadInterfaceParams::New(
-              interface_provider.InitWithNewPipeAndPassReceiver(),
-              mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker>()
-                  .InitWithNewPipeAndPassReceiver()));
-
-  // When the IPC message is received and validation fails, the process is
-  // terminated. However, the notification for that should be processed in a
-  // separate task of the message loop, so ensure that the process is still
-  // considered alive.
+  // Leave the commit URL alone, so the URL checks will pass, but change the
+  // origin to one that does not match the origin lock of the process.
+  PwnCommitIPC(shell()->web_contents(), another_url, another_url,
+               url::Origin::Create(bad_url));
   EXPECT_TRUE(
-      root->current_frame_host()->GetProcess()->IsInitializedAndNotDead());
+      BeginNavigateToURLFromRenderer(shell()->web_contents(), another_url));
 
+  // Due to the origin lock mismatch, the render process should be killed when
+  // it tries to commit.
+  RenderProcessHostBadIpcMessageWaiter kill_waiter(
+      root->current_frame_host()->GetProcess());
   EXPECT_EQ(bad_message::RFH_INVALID_ORIGIN_ON_COMMIT, kill_waiter.Wait());
 }
 
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 5bca0426..ca64f21d 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -17,7 +17,6 @@
 import "mojo/public/mojom/base/unguessable_token.mojom";
 import "mojo/public/mojom/base/values.mojom";
 import "services/network/public/mojom/content_security_policy.mojom";
-import "services/network/public/mojom/web_sandbox_flags.mojom";
 import "services/network/public/mojom/url_loader.mojom";
 import "services/network/public/mojom/url_loader_factory.mojom";
 import "services/network/public/mojom/url_response_head.mojom";
@@ -29,10 +28,6 @@
 import "third_party/blink/public/mojom/commit_result/commit_result.mojom";
 import "third_party/blink/public/mojom/devtools/console_message.mojom";
 import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
-import "third_party/blink/public/mojom/feature_policy/document_policy_feature.mojom";
-import "third_party/blink/public/mojom/feature_policy/feature_policy.mojom";
-import "third_party/blink/public/mojom/feature_policy/feature_policy_feature.mojom";
-import "third_party/blink/public/mojom/feature_policy/policy_value.mojom";
 import "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom";
 import "third_party/blink/public/mojom/frame/frame_owner_properties.mojom";
 import "third_party/blink/public/mojom/frame/frame_policy.mojom";
@@ -443,6 +438,8 @@
                      new_interface_provider,
                    pending_receiver<blink.mojom.BrowserInterfaceBroker>
                      browser_interface_broker,
+                   pending_associated_receiver<blink.mojom.PolicyContainerHost>
+                     policy_container_associated_receiver,
                    blink.mojom.TreeScopeType scope,
                    string frame_name,
                    string frame_unique_name,
@@ -507,19 +504,6 @@
   // Sent when the frame changes its window.name.
   DidChangeName(string name, string unique_name);
 
-  // Notifies the browser process that HTTP headers which affect the frame
-  // polices were delivered with the document being loaded into the frame. This
-  // can be any or all of 'Feature-Policy' or 'Content-Security-Policy' (
-  // which can set sandbox flags) or 'Document-Policy'.
-  //
-  // |feature_policy_header| is a list of an origin whitelist for each feature
-  // in the policy.
-  DidSetFramePolicyHeaders(
-      network.mojom.WebSandboxFlags sandbox_flags,
-      array<blink.mojom.ParsedFeaturePolicyDeclaration> feature_policy_header,
-      map<blink.mojom.DocumentPolicyFeature, blink.mojom.PolicyValue>
-        document_policy_header);
-
   // If a cross-process navigation was started for the initial history load in
   // this subframe, this tries to cancel it to allow a client redirect to happen
   // instead.
diff --git a/content/common/navigation_client.mojom b/content/common/navigation_client.mojom
index 13eb0ea..9f542680 100644
--- a/content/common/navigation_client.mojom
+++ b/content/common/navigation_client.mojom
@@ -11,7 +11,12 @@
 import "services/network/public/mojom/url_loader.mojom";
 import "services/network/public/mojom/url_loader_factory.mojom";
 import "services/network/public/mojom/url_response_head.mojom";
+import "services/network/public/mojom/web_sandbox_flags.mojom";
 import "third_party/blink/public/mojom/commit_result/commit_result.mojom";
+import "third_party/blink/public/mojom/feature_policy/document_policy_feature.mojom";
+import "third_party/blink/public/mojom/feature_policy/feature_policy.mojom";
+import "third_party/blink/public/mojom/feature_policy/feature_policy_feature.mojom";
+import "third_party/blink/public/mojom/feature_policy/policy_value.mojom";
 import "third_party/blink/public/mojom/frame/policy_container.mojom";
 import "third_party/blink/public/mojom/loader/referrer.mojom";
 import "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom";
@@ -124,6 +129,19 @@
   // RenderFrameProxies.
   url.mojom.Origin origin;
 
+  // TODO(https://crbug.com/1041376): Remove this, once we trust the value
+  // computed by the browser process.
+  network.mojom.WebSandboxFlags sandbox_flags;
+
+  // The 'Feature-Policy' headers applied to the document.
+  // https://w3c.github.io/webappsec-permissions-policy/#feature-policy-http-header-field
+  array<blink.mojom.ParsedFeaturePolicyDeclaration> feature_policy_header;
+
+  // The 'Document-Policy' headers applied to the document.
+  // https://w3c.github.io/webappsec-permissions-policy/document-policy.html
+  map<blink.mojom.DocumentPolicyFeature, blink.mojom.PolicyValue>
+    document_policy_header;
+
   // The insecure request policy the document for the load is enforcing.
   blink.mojom.InsecureRequestPolicy insecure_request_policy;
 
diff --git a/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java b/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java
index 3ca2ef8a..9d80737 100644
--- a/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java
+++ b/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java
@@ -20,45 +20,11 @@
     // Use this base address to load native shared libraries. If 0, ignore other members.
     public final long mBaseLoadAddress;
 
-    // If true, wait for a shared RELRO Bundle just after loading the libraries.
-    public final boolean mWaitForSharedRelro;
-
-    // If not empty, name of Linker.TestRunner implementation that needs to be
-    // registered in the service process.
-    public final String mTestRunnerClassNameForTesting;
-
-    // If mTestRunnerClassNameForTesting is not empty, the Linker implementation
-    // to force for testing.
-    public final int mLinkerImplementationForTesting;
-
     private static final String EXTRA_LINKER_PARAMS_BASE_LOAD_ADDRESS =
             "org.chromium.content.common.linker_params.base_load_address";
 
-    private static final String EXTRA_LINKER_PARAMS_WAIT_FOR_SHARED_RELRO =
-            "org.chromium.content.common.linker_params.wait_for_shared_relro";
-
-    private static final String EXTRA_LINKER_PARAMS_TEST_RUNNER_CLASS_NAME =
-            "org.chromium.content.common.linker_params.test_runner_class_name";
-
-    private static final String EXTRA_LINKER_PARAMS_LINKER_IMPLEMENTATION =
-            "org.chromium.content.common.linker_params.linker_implementation";
-
-    public ChromiumLinkerParams(long baseLoadAddress, boolean waitForSharedRelro) {
+    public ChromiumLinkerParams(long baseLoadAddress) {
         mBaseLoadAddress = baseLoadAddress;
-        mWaitForSharedRelro = waitForSharedRelro;
-        mTestRunnerClassNameForTesting = null;
-        mLinkerImplementationForTesting = 0;
-    }
-
-    /**
-     * Use this constructor to create a LinkerParams instance for testing.
-     */
-    public ChromiumLinkerParams(long baseLoadAddress, boolean waitForSharedRelro,
-            String testRunnerClassName, int linkerImplementation) {
-        mBaseLoadAddress = baseLoadAddress;
-        mWaitForSharedRelro = waitForSharedRelro;
-        mTestRunnerClassNameForTesting = testRunnerClassName;
-        mLinkerImplementationForTesting = linkerImplementation;
     }
 
     /**
@@ -69,22 +35,12 @@
      * @return params instance or possibly null if params was not put into bundle.
      */
     public static ChromiumLinkerParams create(Bundle bundle) {
-        if (!bundle.containsKey(EXTRA_LINKER_PARAMS_BASE_LOAD_ADDRESS)
-                || !bundle.containsKey(EXTRA_LINKER_PARAMS_WAIT_FOR_SHARED_RELRO)
-                || !bundle.containsKey(EXTRA_LINKER_PARAMS_TEST_RUNNER_CLASS_NAME)
-                || !bundle.containsKey(EXTRA_LINKER_PARAMS_LINKER_IMPLEMENTATION)) {
-            return null;
-        }
+        if (!bundle.containsKey(EXTRA_LINKER_PARAMS_BASE_LOAD_ADDRESS)) return null;
         return new ChromiumLinkerParams(bundle);
     }
 
     private ChromiumLinkerParams(Bundle bundle) {
         mBaseLoadAddress = bundle.getLong(EXTRA_LINKER_PARAMS_BASE_LOAD_ADDRESS, 0);
-        mWaitForSharedRelro = bundle.getBoolean(EXTRA_LINKER_PARAMS_WAIT_FOR_SHARED_RELRO, false);
-        mTestRunnerClassNameForTesting =
-                bundle.getString(EXTRA_LINKER_PARAMS_TEST_RUNNER_CLASS_NAME);
-        mLinkerImplementationForTesting =
-                bundle.getInt(EXTRA_LINKER_PARAMS_LINKER_IMPLEMENTATION, 0);
     }
 
     /**
@@ -94,19 +50,11 @@
      */
     public void populateBundle(Bundle bundle) {
         bundle.putLong(EXTRA_LINKER_PARAMS_BASE_LOAD_ADDRESS, mBaseLoadAddress);
-        bundle.putBoolean(EXTRA_LINKER_PARAMS_WAIT_FOR_SHARED_RELRO, mWaitForSharedRelro);
-        bundle.putString(
-                EXTRA_LINKER_PARAMS_TEST_RUNNER_CLASS_NAME, mTestRunnerClassNameForTesting);
-        bundle.putInt(EXTRA_LINKER_PARAMS_LINKER_IMPLEMENTATION, mLinkerImplementationForTesting);
     }
 
     // For debugging traces only.
     @Override
     public String toString() {
-        return String.format(Locale.US,
-                "LinkerParams(baseLoadAddress:0x%x, waitForSharedRelro:%s, "
-                        + "testRunnerClassName:%s, linkerImplementation:%d",
-                mBaseLoadAddress, Boolean.toString(mWaitForSharedRelro),
-                mTestRunnerClassNameForTesting, mLinkerImplementationForTesting);
+        return String.format(Locale.US, "LinkerParams(baseLoadAddress:0x%x", mBaseLoadAddress);
     }
 }
diff --git a/content/public/android/java/src/org/chromium/content/app/ContentChildProcessServiceDelegate.java b/content/public/android/java/src/org/chromium/content/app/ContentChildProcessServiceDelegate.java
index e5cb58c1e..94f8fbd 100644
--- a/content/public/android/java/src/org/chromium/content/app/ContentChildProcessServiceDelegate.java
+++ b/content/public/android/java/src/org/chromium/content/app/ContentChildProcessServiceDelegate.java
@@ -108,12 +108,8 @@
         if (LibraryLoader.getInstance().useChromiumLinker()) {
             assert mLinkerParams != null;
             linker = getLinker();
-            if (mLinkerParams.mWaitForSharedRelro) {
-                requestedSharedRelro = true;
-                linker.initServiceProcess(mLinkerParams.mBaseLoadAddress);
-            } else {
-                linker.disableSharedRelros();
-            }
+            requestedSharedRelro = true;
+            linker.initServiceProcess(mLinkerParams.mBaseLoadAddress);
         }
         try {
             LibraryLoader.getInstance().loadNowOverrideApplicationContext(hostContext);
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelperImpl.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelperImpl.java
index d8b12a7..8363900 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelperImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelperImpl.java
@@ -659,9 +659,7 @@
         assert sLinkerInitialized;
         if (sLinkerLoadAddress == 0) return null;
 
-        // Always wait for the shared RELROs in service processes.
-        final boolean waitForSharedRelros = true;
-        return new ChromiumLinkerParams(sLinkerLoadAddress, waitForSharedRelros);
+        return new ChromiumLinkerParams(sLinkerLoadAddress);
     }
 
     private static Bundle populateServiceBundle(Bundle bundle) {
diff --git a/content/public/test/navigation_simulator.h b/content/public/test/navigation_simulator.h
index 64f6e37..cf2acb5 100644
--- a/content/public/test/navigation_simulator.h
+++ b/content/public/test/navigation_simulator.h
@@ -14,7 +14,8 @@
 #include "mojo/public/cpp/bindings/pending_receiver.h"
 #include "net/dns/public/resolve_error_info.h"
 #include "services/service_manager/public/cpp/interface_provider.h"
-#include "third_party/blink/public/mojom/loader/referrer.mojom.h"
+#include "third_party/blink/public/common/feature_policy/feature_policy.h"
+#include "third_party/blink/public/mojom/loader/referrer.mojom-forward.h"
 #include "ui/base/page_transition_types.h"
 
 class GURL;
@@ -272,6 +273,10 @@
   virtual void SetIsSignedExchangeInnerResponse(
       bool is_signed_exchange_inner_response) = 0;
 
+  // Simulate receiving Feature-Policy headers.
+  virtual void SetFeaturePolicyHeader(
+      blink::ParsedFeaturePolicy feature_policy_header) = 0;
+
   // Provides the contents mime type to be set at commit. It should be
   // specified before calling |ReadyToCommit| or |Commit|.
   virtual void SetContentsMimeType(const std::string& contents_mime_type) = 0;
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index d5192c6..6e7da3d0 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -122,14 +122,6 @@
   // navigation without making any network requests.
   virtual void SimulateUnloadACK() = 0;
 
-  // Set the feature policy header for the RenderFrameHost for test. Currently
-  // this is limited to setting an allowlist for a single feature. This function
-  // can be generalized as needed. Setting a header policy should only be done
-  // once per navigation of the RFH.
-  virtual void SimulateFeaturePolicyHeader(
-      blink::mojom::FeaturePolicyFeature feature,
-      const std::vector<url::Origin>& allowlist) = 0;
-
   // Simulates the frame receiving a user activation.
   virtual void SimulateUserActivation() = 0;
 
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 859acd0e..b9baf15 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3915,7 +3915,10 @@
     const blink::WebString& fallback_name,
     const blink::FramePolicy& frame_policy,
     const blink::WebFrameOwnerProperties& frame_owner_properties,
-    blink::mojom::FrameOwnerElementType frame_owner_element_type) {
+    blink::mojom::FrameOwnerElementType frame_owner_element_type,
+    blink::CrossVariantMojoAssociatedReceiver<
+        blink::mojom::PolicyContainerHostInterfaceBase>
+        policy_container_host_receiver) {
   DCHECK_EQ(frame_, parent);
 
   // Allocate child routing ID. This is a synchronous call.
@@ -3957,8 +3960,9 @@
   GetFrameHost()->CreateChildFrame(
       child_routing_id,
       child_interface_provider.InitWithNewPipeAndPassReceiver(),
-      browser_interface_broker.InitWithNewPipeAndPassReceiver(), scope,
-      name.Utf8(), frame_unique_name, is_created_by_script, frame_policy,
+      browser_interface_broker.InitWithNewPipeAndPassReceiver(),
+      std::move(policy_container_host_receiver), scope, name.Utf8(),
+      frame_unique_name, is_created_by_script, frame_policy,
       blink::mojom::FrameOwnerProperties::From(frame_owner_properties),
       frame_owner_element_type);
 
@@ -4100,18 +4104,6 @@
   GetFrameHost()->DidChangeName(name.Utf8(), unique_name_helper_.value());
 }
 
-void RenderFrameImpl::DidSetFramePolicyHeaders(
-    network::mojom::WebSandboxFlags flags,
-    const blink::ParsedFeaturePolicy& fp_header,
-    const blink::DocumentPolicyFeatureState& dp_header) {
-  // If any of Feature Policy or Sandbox Flags or Document Policy are different
-  // from the default (empty) values, then send them to the browser.
-  if (!dp_header.empty() || !fp_header.empty() ||
-      flags != network::mojom::WebSandboxFlags::kNone) {
-    GetFrameHost()->DidSetFramePolicyHeaders(flags, fp_header, dp_header);
-  }
-}
-
 void RenderFrameImpl::DidMatchCSS(
     const blink::WebVector<blink::WebString>& newly_matching_selectors,
     const blink::WebVector<blink::WebString>& stopped_matching_selectors) {
@@ -4162,7 +4154,10 @@
 
 void RenderFrameImpl::DidCommitNavigation(
     blink::WebHistoryCommitType commit_type,
-    bool should_reset_browser_interface_broker) {
+    bool should_reset_browser_interface_broker,
+    network::mojom::WebSandboxFlags sandbox_flags,
+    const blink::ParsedFeaturePolicy& feature_policy_header,
+    const blink::DocumentPolicyFeatureState& document_policy_header) {
   CHECK_EQ(NavigationCommitState::kWillCommit, navigation_commit_state_);
   navigation_commit_state_ = NavigationCommitState::kDidCommit;
 
@@ -4303,6 +4298,7 @@
 
   DidCommitNavigationInternal(
       commit_type, false /* was_within_same_document */, transition,
+      sandbox_flags, feature_policy_header, document_policy_header,
       should_reset_browser_interface_broker
           ? mojom::DidCommitProvisionalLoadInterfaceParams::New(
                 std::move(remote_interface_provider_receiver),
@@ -4457,12 +4453,15 @@
 
   ui::PageTransition transition =
       GetTransitionType(frame_->GetDocumentLoader(), IsMainFrame());
-  DidCommitNavigationInternal(commit_type,
-                              // was_within_same_document
-                              true, transition,
-                              // interface_params
-                              nullptr,
-                              /*embedding_token=*/base::nullopt);
+  DidCommitNavigationInternal(
+      commit_type,
+      true,  // was_within_same_document
+      transition, network::mojom::WebSandboxFlags(),
+      blink::ParsedFeaturePolicy(),         // feature_policy_header
+      blink::DocumentPolicyFeatureState(),  // document_policy_header
+      nullptr,                              // interface_params
+      base::nullopt                         // embedding_token
+  );
 
   // If we end up reusing this WebRequest (for example, due to a #ref click),
   // we don't want the transition type to persist.  Just clear it.
@@ -4972,6 +4971,9 @@
 RenderFrameImpl::MakeDidCommitProvisionalLoadParams(
     blink::WebHistoryCommitType commit_type,
     ui::PageTransition transition,
+    network::mojom::WebSandboxFlags sandbox_flags,
+    const blink::ParsedFeaturePolicy& feature_policy_header,
+    const blink::DocumentPolicyFeatureState& document_policy_header,
     const base::Optional<base::UnguessableToken>& embedding_token) {
   WebDocumentLoader* document_loader = frame_->GetDocumentLoader();
   const WebURLResponse& response = document_loader->GetResponse();
@@ -5020,6 +5022,10 @@
   WebSecurityOrigin frame_origin = frame_document.GetSecurityOrigin();
   params->origin = frame_origin;
 
+  params->sandbox_flags = sandbox_flags;
+  params->feature_policy_header = feature_policy_header;
+  params->document_policy_header = document_policy_header;
+
   params->insecure_request_policy = frame_->GetInsecureRequestPolicy();
   params->insecure_navigations_set =
       frame_->GetInsecureRequestToUpgrade().ReleaseVector();
@@ -5239,6 +5245,9 @@
     blink::WebHistoryCommitType commit_type,
     bool was_within_same_document,
     ui::PageTransition transition,
+    network::mojom::WebSandboxFlags sandbox_flags,
+    const blink::ParsedFeaturePolicy& feature_policy_header,
+    const blink::DocumentPolicyFeatureState& document_policy_header,
     mojom::DidCommitProvisionalLoadInterfaceParamsPtr interface_params,
     const base::Optional<base::UnguessableToken>& embedding_token) {
   DCHECK(!(was_within_same_document && interface_params));
@@ -5252,8 +5261,10 @@
   // call chrome::ContentSettingsManager::OnContentBlocked, those calls arrive
   // after the browser process has already been informed of the provisional
   // load committing.
-  auto params = MakeDidCommitProvisionalLoadParams(commit_type, transition,
-                                                   embedding_token);
+  auto params = MakeDidCommitProvisionalLoadParams(
+      commit_type, transition, sandbox_flags, feature_policy_header,
+      document_policy_header, embedding_token);
+
   if (was_within_same_document) {
     GetFrameHost()->DidCommitSameDocumentNavigation(std::move(params));
   } else {
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 96d231c..3c1fbfc0 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -73,6 +73,7 @@
 #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
 #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
 #include "third_party/blink/public/common/browser_interface_broker_proxy.h"
+#include "third_party/blink/public/common/feature_policy/document_policy.h"
 #include "third_party/blink/public/common/feature_policy/feature_policy.h"
 #include "third_party/blink/public/common/loader/loading_behavior_flag.h"
 #include "third_party/blink/public/common/loader/previews_state.h"
@@ -83,10 +84,10 @@
 #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
 #include "third_party/blink/public/mojom/commit_result/commit_result.mojom.h"
 #include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
-#include "third_party/blink/public/mojom/feature_policy/feature_policy.mojom-forward.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
 #include "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom.h"
 #include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom-forward.h"
+#include "third_party/blink/public/mojom/frame/policy_container.mojom-shared.h"
 #include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h"
 #include "third_party/blink/public/mojom/input/focus_type.mojom-forward.h"
 #include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
@@ -584,7 +585,10 @@
       const blink::WebString& fallback_name,
       const blink::FramePolicy& frame_policy,
       const blink::WebFrameOwnerProperties& frame_owner_properties,
-      blink::mojom::FrameOwnerElementType frame_owner_element_type) override;
+      blink::mojom::FrameOwnerElementType frame_owner_element_type,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override;
   std::pair<blink::WebRemoteFrame*, blink::PortalToken> CreatePortal(
       blink::CrossVariantMojoAssociatedReceiver<
           blink::mojom::PortalInterfaceBase> portal_endpoint,
@@ -598,10 +602,6 @@
   void WillDetach() override;
   void FrameDetached() override;
   void DidChangeName(const blink::WebString& name) override;
-  void DidSetFramePolicyHeaders(
-      network::mojom::WebSandboxFlags flags,
-      const blink::ParsedFeaturePolicy& fp_header,
-      const blink::DocumentPolicyFeatureState& dp_header) override;
   void DidMatchCSS(
       const blink::WebVector<blink::WebString>& newly_matching_selectors,
       const blink::WebVector<blink::WebString>& stopped_matching_selectors)
@@ -616,8 +616,12 @@
   void WillSendSubmitEvent(const blink::WebFormElement& form) override;
   void DidCreateDocumentLoader(
       blink::WebDocumentLoader* document_loader) override;
-  void DidCommitNavigation(blink::WebHistoryCommitType commit_type,
-                           bool should_reset_browser_interface_broker) override;
+  void DidCommitNavigation(
+      blink::WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header) override;
   void DidCreateInitialEmptyDocument() override;
   void DidCommitDocumentReplacementNavigation(
       blink::WebDocumentLoader* document_loader) override;
@@ -1073,6 +1077,9 @@
   mojom::DidCommitProvisionalLoadParamsPtr MakeDidCommitProvisionalLoadParams(
       blink::WebHistoryCommitType commit_type,
       ui::PageTransition transition,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header,
       const base::Optional<base::UnguessableToken>& embedding_token);
 
   // Updates the navigation history depending on the passed parameters.
@@ -1096,6 +1103,9 @@
       blink::WebHistoryCommitType commit_type,
       bool was_within_same_document,
       ui::PageTransition transition,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header,
       mojom::DidCommitProvisionalLoadInterfaceParamsPtr interface_params,
       const base::Optional<base::UnguessableToken>& embedding_token);
 
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-android.txt b/content/test/data/accessibility/aom/aom-live-region-expected-android.txt
new file mode 100644
index 0000000..49268baa
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-android.txt
@@ -0,0 +1,5 @@
+android.webkit.WebView focusable focused scrollable
+++android.view.View role_description='marquee'
+++android.view.View role_description='marquee' live_region_type=1
+++android.view.View role_description='status' live_region_type=2
+++android.view.View role_description='alert' live_region_type=2
\ No newline at end of file
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-auralinux.txt b/content/test/data/accessibility/aom/aom-live-region-expected-auralinux.txt
new file mode 100644
index 0000000..50ed646e
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-auralinux.txt
@@ -0,0 +1,5 @@
+[document web]
+++[marquee] container-atomic:false container-busy:false container-live:off container-relevant:additions text live:off
+++[marquee] container-atomic:false container-busy:false container-live:polite container-relevant:additions text live:polite
+++[statusbar] container-atomic:true container-busy:false container-live:assertive container-relevant:additions text live:assertive
+++[notification] container-atomic:true container-busy:false container-live:assertive container-relevant:additions text live:assertive
\ No newline at end of file
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-blink.txt b/content/test/data/accessibility/aom/aom-live-region-expected-blink.txt
new file mode 100644
index 0000000..eb0da4d
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-blink.txt
@@ -0,0 +1,7 @@
+rootWebArea
+++genericContainer ignored
+++++genericContainer ignored
+++++++marquee containerLiveRelevant='additions text' containerLiveStatus='off' liveRelevant='additions text' liveStatus='off' containerLiveAtomic=false containerLiveBusy=false liveAtomic=false
+++++++marquee containerLiveRelevant='additions text' containerLiveStatus='polite' liveRelevant='additions text' liveStatus='polite' containerLiveAtomic=false containerLiveBusy=false liveAtomic=false
+++++++status containerLiveRelevant='additions text' containerLiveStatus='assertive' liveRelevant='additions text' liveStatus='assertive' containerLiveAtomic=true containerLiveBusy=false liveAtomic=true
+++++++alert containerLiveRelevant='additions text' containerLiveStatus='assertive' liveRelevant='additions text' liveStatus='assertive' containerLiveAtomic=true containerLiveBusy=false liveAtomic=true
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-mac.txt b/content/test/data/accessibility/aom/aom-live-region-expected-mac.txt
new file mode 100644
index 0000000..47254d54
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-mac.txt
@@ -0,0 +1,5 @@
+AXWebArea
+++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='off'
+++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='polite'
+++AXGroup AXSubrole=AXApplicationStatus AXARIALive='assertive'
+++AXGroup AXSubrole=AXApplicationAlert AXARIALive='assertive'
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-uia-win.txt b/content/test/data/accessibility/aom/aom-live-region-expected-uia-win.txt
new file mode 100644
index 0000000..5788fe4
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-uia-win.txt
@@ -0,0 +1,5 @@
+Document LocalizedControlType='document' AriaProperties='readonly=true;expanded=false;multiline=false;multiselectable=false;required=false' LiveSetting='LiveSetting::Off'
+++Text LocalizedControlType='marquee' IsControlElement=false AriaProperties='atomic=false;readonly=true;expanded=false;live=off;multiline=false;multiselectable=false;relevant=additions text;required=false' LiveSetting='LiveSetting::Off'
+++Text LocalizedControlType='marquee' IsControlElement=false AriaProperties='atomic=false;readonly=true;expanded=false;live=polite;multiline=false;multiselectable=false;relevant=additions text;required=false' LiveSetting='LiveSetting::Polite'
+++StatusBar LocalizedControlType='output' IsControlElement=false AriaProperties='atomic=true;readonly=true;expanded=false;live=assertive;multiline=false;multiselectable=false;relevant=additions text;required=false' LiveSetting='LiveSetting::Assertive'
+++Text LocalizedControlType='alert' IsControlElement=false AriaProperties='atomic=true;readonly=true;expanded=false;live=assertive;multiline=false;multiselectable=false;relevant=additions text;required=false' LiveSetting='LiveSetting::Assertive'
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-uia-win7.txt b/content/test/data/accessibility/aom/aom-live-region-expected-uia-win7.txt
new file mode 100644
index 0000000..c98a502
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-uia-win7.txt
@@ -0,0 +1,5 @@
+Document LocalizedControlType='document' AriaProperties='readonly=true;expanded=false;multiline=false;multiselectable=false;required=false'
+++Text LocalizedControlType='text' IsControlElement=false AriaProperties='atomic=false;readonly=true;expanded=false;live=off;multiline=false;multiselectable=false;relevant=additions text;required=false'
+++Text LocalizedControlType='text' IsControlElement=false AriaProperties='atomic=false;readonly=true;expanded=false;live=polite;multiline=false;multiselectable=false;relevant=additions text;required=false'
+++StatusBar LocalizedControlType='output' IsControlElement=false AriaProperties='atomic=true;readonly=true;expanded=false;live=assertive;multiline=false;multiselectable=false;relevant=additions text;required=false'
+++Text LocalizedControlType='text' IsControlElement=false AriaProperties='atomic=true;readonly=true;expanded=false;live=assertive;multiline=false;multiselectable=false;relevant=additions text;required=false'
diff --git a/content/test/data/accessibility/aom/aom-live-region-expected-win.txt b/content/test/data/accessibility/aom/aom-live-region-expected-win.txt
new file mode 100644
index 0000000..40259d7
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region-expected-win.txt
@@ -0,0 +1,5 @@
+ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
+++ROLE_SYSTEM_ANIMATION live:off container-live:off container-relevant:additions text container-atomic:false container-busy:false
+++ROLE_SYSTEM_ANIMATION live:polite container-live:polite container-relevant:additions text container-atomic:false container-busy:false
+++ROLE_SYSTEM_STATUSBAR live:assertive container-live:assertive container-relevant:additions text container-atomic:true container-busy:false
+++ROLE_SYSTEM_ALERT live:assertive container-live:assertive container-relevant:additions text container-atomic:true container-busy:false
diff --git a/content/test/data/accessibility/aom/aom-live-region.html b/content/test/data/accessibility/aom/aom-live-region.html
new file mode 100644
index 0000000..08db160
--- /dev/null
+++ b/content/test/data/accessibility/aom/aom-live-region.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<!--
+@MAC-ALLOW:AXSubrole
+@MAC-ALLOW:AXARIALive
+@WIN-ALLOW:live*
+@WIN-ALLOW:container*
+@WIN-ALLOW:BUSY*
+@UIA-WIN-ALLOW:LiveSetting*
+@UIA-WIN-ALLOW:LocalizedControlType*
+@UIA-WIN-ALLOW:AriaProperties*
+@BLINK-ALLOW:busy*
+@BLINK-ALLOW:live*
+@BLINK-ALLOW:container*
+@AURALINUX-ALLOW:busy*
+@AURALINUX-ALLOW:container*
+@AURALINUX-ALLOW:live*
+-->
+<html>
+  <body>
+    <script>
+      var live_off_node = new AccessibleNode();
+      live_off_node.role = "marquee";
+      live_off_node.live = "off";
+      document.body.accessibleNode.appendChild(live_off_node);
+
+      var live_polite_node = new AccessibleNode();
+      live_polite_node.role = "marquee";
+      live_polite_node.live = "polite";
+      document.body.accessibleNode.appendChild(live_polite_node);
+
+      // Some roles such as "status" should have an implicit atomic value equal
+      // to true.
+      var live_assertive_node = new AccessibleNode();
+      live_assertive_node.role = "status";
+      live_assertive_node.live = "assertive";
+      document.body.accessibleNode.appendChild(live_assertive_node);
+
+      // Some roles such as "alert" have an implicit live status of assertive,
+      // and implicit atomic value equal to true.
+      var alert_node = new AccessibleNode();
+      alert_node.role = "alert";
+      document.body.accessibleNode.appendChild(alert_node);
+    </script>
+  </body>
+</html>
diff --git a/content/test/navigation_simulator_impl.cc b/content/test/navigation_simulator_impl.cc
index ea4cc339..eda17b4 100644
--- a/content/test/navigation_simulator_impl.cc
+++ b/content/test/navigation_simulator_impl.cc
@@ -913,6 +913,13 @@
   is_signed_exchange_inner_response_ = is_signed_exchange_inner_response;
 }
 
+void NavigationSimulatorImpl::SetFeaturePolicyHeader(
+    blink::ParsedFeaturePolicy feature_policy_header) {
+  CHECK_LE(state_, STARTED) << "The Feature-Policy headers cannot be set after "
+                               "the navigation has committed or failed";
+  feature_policy_header_ = std::move(feature_policy_header);
+}
+
 void NavigationSimulatorImpl::SetContentsMimeType(
     const std::string& contents_mime_type) {
   CHECK_LE(state_, STARTED) << "The contents mime type cannot be set after the "
@@ -1328,6 +1335,8 @@
 
   CHECK(same_document || request_);
 
+  params->feature_policy_header = std::move(feature_policy_header_);
+
   // Simulate Blink assigning a item sequence number and document sequence
   // number to the navigation.
   params->item_sequence_number = ++g_unique_identifier;
diff --git a/content/test/navigation_simulator_impl.h b/content/test/navigation_simulator_impl.h
index a73a1fc3..26d280a 100644
--- a/content/test/navigation_simulator_impl.h
+++ b/content/test/navigation_simulator_impl.h
@@ -75,7 +75,6 @@
   RenderFrameHost* GetFinalRenderFrameHost() override;
   void Wait() override;
   bool IsDeferred() override;
-
   void SetInitiatorFrame(RenderFrameHost* initiator_frame_host) override;
   void SetTransition(ui::PageTransition transition) override;
   void SetHasUserGesture(bool has_user_gesture) override;
@@ -87,6 +86,8 @@
   void SetWasFetchedViaCache(bool was_fetched_via_cache) override;
   void SetIsSignedExchangeInnerResponse(
       bool is_signed_exchange_inner_response) override;
+  void SetFeaturePolicyHeader(
+      blink::ParsedFeaturePolicy feature_policy_header) override;
   void SetContentsMimeType(const std::string& contents_mime_type) override;
   void SetResponseHeaders(
       scoped_refptr<net::HttpResponseHeaders> response_headers) override;
@@ -293,6 +294,7 @@
       browser_interface_broker_receiver_;
   std::string contents_mime_type_;
   scoped_refptr<net::HttpResponseHeaders> response_headers_;
+  blink::ParsedFeaturePolicy feature_policy_header_;
   network::mojom::CSPDisposition should_check_main_world_csp_ =
       network::mojom::CSPDisposition::CHECK;
   net::HttpResponseInfo::ConnectionInfo http_connection_info_ =
diff --git a/content/test/test_render_frame.cc b/content/test/test_render_frame.cc
index bdb12951..9d22c7b 100644
--- a/content/test/test_render_frame.cc
+++ b/content/test/test_render_frame.cc
@@ -138,6 +138,8 @@
           interface_provider_receiver,
       mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
           browser_interface_broker_receiver,
+      mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+          policy_container_host_receiver,
       blink::mojom::TreeScopeType scope,
       const std::string& frame_name,
       const std::string& frame_unique_name,
@@ -188,12 +190,6 @@
   void DidChangeName(const std::string& name,
                      const std::string& unique_name) override {}
 
-  void DidSetFramePolicyHeaders(
-      network::mojom::WebSandboxFlags sandbox_flags,
-      const blink::ParsedFeaturePolicy& feature_policy_header,
-      const blink::DocumentPolicyFeatureState& document_policy_header)
-      override {}
-
   void CancelInitialHistoryLoad() override {}
 
   void UpdateEncoding(const std::string& encoding_name) override {}
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 4a14c76..844eba08 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -149,6 +149,7 @@
   OnCreateChildFrame(
       GetProcess()->GetNextRoutingID(), CreateStubInterfaceProviderReceiver(),
       CreateStubBrowserInterfaceBrokerReceiver(),
+      CreateStubPolicyContainerHostReceiver(),
       blink::mojom::TreeScopeType::kDocument, frame_name, frame_unique_name,
       false, base::UnguessableToken::Create(), base::UnguessableToken::Create(),
       blink::FramePolicy(
@@ -191,20 +192,6 @@
   OnUnloadACK();
 }
 
-void TestRenderFrameHost::SimulateFeaturePolicyHeader(
-    blink::mojom::FeaturePolicyFeature feature,
-    const std::vector<url::Origin>& allowlist) {
-  blink::ParsedFeaturePolicy header(1);
-  header[0].feature = feature;
-  header[0].matches_all_origins = false;
-  header[0].matches_opaque_src = false;
-  for (const auto& origin : allowlist) {
-    header[0].allowed_origins.push_back(origin);
-  }
-  DidSetFramePolicyHeaders(network::mojom::WebSandboxFlags::kNone, header,
-                           {} /* dp_header */);
-}
-
 void TestRenderFrameHost::SimulateUserActivation() {
   frame_tree_node()->UpdateUserActivationState(
       blink::mojom::UserActivationUpdateType::kNotifyActivation,
@@ -474,13 +461,6 @@
   return RenderFrameHostImpl::GetWebBluetoothServiceForTesting();
 }
 
-void TestRenderFrameHost::SendFramePolicy(
-    network::mojom::WebSandboxFlags sandbox_flags,
-    const blink::ParsedFeaturePolicy& fp_header,
-    const blink::DocumentPolicyFeatureState& dp_header) {
-  DidSetFramePolicyHeaders(sandbox_flags, fp_header, dp_header);
-}
-
 void TestRenderFrameHost::SendCommitNavigation(
     mojom::NavigationClient* navigation_client,
     NavigationRequest* navigation_request,
@@ -600,8 +580,7 @@
 }
 
 void TestRenderFrameHost::AbortCommit(NavigationRequest* navigation_request) {
-  OnCrossDocumentCommitProcessed(navigation_request,
-                                 blink::mojom::CommitResult::Aborted);
+  NavigationRequestCancelled(navigation_request);
 }
 
 // static
@@ -619,6 +598,13 @@
       .InitWithNewPipeAndPassReceiver();
 }
 
+// static
+mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+TestRenderFrameHost::CreateStubPolicyContainerHostReceiver() {
+  return mojo::PendingAssociatedRemote<blink::mojom::PolicyContainerHost>()
+      .InitWithNewEndpointAndPassReceiver();
+}
+
 void TestRenderFrameHost::SimulateLoadingCompleted(
     TestRenderFrameHost::LoadingScenario loading_scenario) {
   if (!is_loading())
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h
index a6a5671d..96ae738 100644
--- a/content/test/test_render_frame_host.h
+++ b/content/test/test_render_frame_host.h
@@ -87,9 +87,6 @@
                                   ui::PageTransition transition);
   void SimulateBeforeUnloadCompleted(bool proceed) override;
   void SimulateUnloadACK() override;
-  void SimulateFeaturePolicyHeader(
-      blink::mojom::FeaturePolicyFeature feature,
-      const std::vector<url::Origin>& allowlist) override;
   void SimulateUserActivation() override;
   const std::vector<std::string>& GetConsoleMessages() override;
   int GetHeavyAdIssueCount(HeavyAdIssueType type) override;
@@ -162,11 +159,6 @@
           browser_interface_broker_receiver,
       bool same_document);
 
-  // Send a message with the sandbox flags and feature policy
-  void SendFramePolicy(network::mojom::WebSandboxFlags sandbox_flags,
-                       const blink::ParsedFeaturePolicy& fp_header,
-                       const blink::DocumentPolicyFeatureState& dp_header);
-
   // Creates a WebBluetooth Service with a dummy InterfaceRequest.
   WebBluetoothServiceImpl* CreateWebBluetoothServiceForTesting();
 
@@ -180,6 +172,11 @@
   static mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
   CreateStubBrowserInterfaceBrokerReceiver();
 
+  // Returns a PendingAssociatedReceiver<PolicyContainerHost> that is safe to
+  // bind to an implementation, but will never receive any interface requests.
+  static mojo::PendingAssociatedReceiver<blink::mojom::PolicyContainerHost>
+  CreateStubPolicyContainerHostReceiver();
+
   // This simulates aborting a cross document navigation.
   // Will abort the navigation with the given |navigation_id|.
   void AbortCommit(NavigationRequest* navigation_request);
diff --git a/content/web_test/renderer/web_test_content_renderer_client.cc b/content/web_test/renderer/web_test_content_renderer_client.cc
index 0b59297..404fde1f 100644
--- a/content/web_test/renderer/web_test_content_renderer_client.cc
+++ b/content/web_test/renderer/web_test_content_renderer_client.cc
@@ -134,6 +134,8 @@
 
 void WebTestContentRendererClient::
     SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {
+  // PerformanceManager is used by measure-memory web platform tests.
+  blink::WebRuntimeFeatures::EnablePerformanceManagerInstrumentation(true);
   // We always expose GC to web tests.
   std::string flags("--expose-gc");
   auto* command_line = base::CommandLine::ForCurrentProcess();
diff --git a/docs/clang_sheriffing.md b/docs/clang_sheriffing.md
index 3cfccbd..1936a0eb 100644
--- a/docs/clang_sheriffing.md
+++ b/docs/clang_sheriffing.md
@@ -91,8 +91,13 @@
 This is probably the most common bug. The standard procedure is to do these
 things:
 
-1. Use `got_clang_revision` property from first red and last green build to find
-   upstream regression range
+1. Open the `gclient runhooks` stdout log from the first red build.  Near the
+   top of that log you can find the range of upstream llvm revisions.  For
+   example:
+
+       From https://github.com/llvm/llvm-project
+           f917356f9ce..292e898c16d  master     -> origin/master
+
 1. File a crbug documenting the crash. Include the range, and any other bots
    displaying the same symptoms.
 1. All clang crashes on the Chromium bots are automatically uploaded to
diff --git a/ios/chrome/browser/browsing_data/cache_counter_unittest.cc b/ios/chrome/browser/browsing_data/cache_counter_unittest.cc
index bc2c535..f30ec67f 100644
--- a/ios/chrome/browser/browsing_data/cache_counter_unittest.cc
+++ b/ios/chrome/browser/browsing_data/cache_counter_unittest.cc
@@ -240,14 +240,7 @@
 };
 
 // Tests that for the empty cache, the result is zero.
-// Disabled on Windows because this test randomly crashes on Win 7 Tests x64
-// (1). See: https://crbug.com/1152289
-#if defined(OS_WIN)
-#define MAYBE_Empty DISABLED_Empty
-#else
-#define MAYBE_Empty Empty
-#endif
-TEST_F(CacheCounterTest, MAYBE_Empty) {
+TEST_F(CacheCounterTest, Empty) {
   CacheCounter counter(browser_state());
   counter.Init(prefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
                base::BindRepeating(&CacheCounterTest::CountingCallback,
diff --git a/ios/chrome/browser/flags/BUILD.gn b/ios/chrome/browser/flags/BUILD.gn
index 04812b51..e29b443 100644
--- a/ios/chrome/browser/flags/BUILD.gn
+++ b/ios/chrome/browser/flags/BUILD.gn
@@ -57,7 +57,6 @@
     "//ios/chrome/browser/ui/content_suggestions:feature_flags",
     "//ios/chrome/browser/ui/fullscreen:feature_flags",
     "//ios/chrome/browser/ui/infobars:feature_flags",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/tab_switcher/tab_grid:features",
     "//ios/chrome/browser/ui/table_view:feature_flags",
     "//ios/chrome/browser/ui/toolbar_container:feature_flags",
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm
index 52f71bc..45e085ae9 100644
--- a/ios/chrome/browser/flags/about_flags.mm
+++ b/ios/chrome/browser/flags/about_flags.mm
@@ -68,7 +68,6 @@
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
 #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
 #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/tab_switcher/tab_grid/features.h"
 #import "ios/chrome/browser/ui/table_view/feature_flags.h"
 #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
@@ -455,9 +454,6 @@
      flags_ui::kOsIos,
      FEATURE_VALUE_TYPE(
          autofill::features::kAutofillSaveCardInfobarEditSupport)},
-    {"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName,
-     flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos,
-     FEATURE_VALUE_TYPE(kPageInfoRefactoring)},
     {"fullscreen-controller-browser-scoped",
      flag_descriptions::kFullscreenControllerBrowserScopedName,
      flag_descriptions::kFullscreenControllerBrowserScopedDescription,
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
index 045a951..ce0de3a 100644
--- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
+++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -353,10 +353,6 @@
     "before the user has typed any input. This provides overrides for the "
     "default suggestion locations.";
 
-const char kPageInfoRefactoringName[] = "New design of the page info";
-const char kPageInfoRefactoringDescription[] =
-    "Uses the new design for the page security info.";
-
 #if defined(__IPHONE_13_4)
 const char kPointerSupportName[] = "Enables pointer support on tablets";
 const char kPointerSupportDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
index dc406d9..12d4b905 100644
--- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
+++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -316,10 +316,6 @@
 extern const char kOmniboxOnFocusSuggestionsName[];
 extern const char kOmniboxOnFocusSuggestionsDescription[];
 
-// Title and description for the flag to enable the new design of the page info.
-extern const char kPageInfoRefactoringName[];
-extern const char kPageInfoRefactoringDescription[];
-
 #if defined(__IPHONE_13_4)
 // Title and description for the flag to enable pointer support on tablets.
 extern const char kPointerSupportName[];
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn
index 49b2b67..d5874727 100644
--- a/ios/chrome/browser/ui/browser_view/BUILD.gn
+++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -119,7 +119,6 @@
     "//ios/chrome/browser/ui/overlays",
     "//ios/chrome/browser/ui/overscroll_actions",
     "//ios/chrome/browser/ui/page_info:coordinator",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/page_info/requirements",
     "//ios/chrome/browser/ui/passwords",
     "//ios/chrome/browser/ui/popup_menu",
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm
index 3d395aa..1435317c 100644
--- a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm
+++ b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm
@@ -48,9 +48,7 @@
 #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
 #import "ios/chrome/browser/ui/open_in/open_in_mediator.h"
 #import "ios/chrome/browser/ui/overlays/overlay_container_coordinator.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/page_info/page_info_coordinator.h"
-#import "ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.h"
 #import "ios/chrome/browser/ui/passwords/password_breach_coordinator.h"
 #import "ios/chrome/browser/ui/print/print_controller.h"
 #import "ios/chrome/browser/ui/qr_generator/qr_generator_coordinator.h"
@@ -678,19 +676,7 @@
 
 #pragma mark - PageInfoCommands
 
-- (void)legacyShowPageInfoForOriginPoint:(CGPoint)originPoint {
-  PageInfoLegacyCoordinator* pageInfoCoordinator =
-      [[PageInfoLegacyCoordinator alloc]
-          initWithBaseViewController:self.viewController
-                             browser:self.browser];
-  pageInfoCoordinator.presentationProvider = self.viewController;
-  pageInfoCoordinator.originPoint = originPoint;
-  self.pageInfoCoordinator = pageInfoCoordinator;
-  [self.pageInfoCoordinator start];
-}
-
 - (void)showPageInfo {
-  DCHECK(base::FeatureList::IsEnabled(kPageInfoRefactoring));
   PageInfoCoordinator* pageInfoCoordinator = [[PageInfoCoordinator alloc]
       initWithBaseViewController:self.viewController
                          browser:self.browser];
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
index e2c1c18..3a23887 100644
--- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -107,7 +107,6 @@
 #import "ios/chrome/browser/ui/ntp/new_tab_page_coordinator.h"
 #import "ios/chrome/browser/ui/ntp/ntp_util.h"
 #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/popup_menu/popup_menu_coordinator.h"
 #import "ios/chrome/browser/ui/presenters/vertical_animation_container.h"
 #import "ios/chrome/browser/ui/sad_tab/sad_tab_coordinator.h"
@@ -2562,9 +2561,6 @@
   // be unrecognized.
   if (_isShutdown)
     return;
-  if (!base::FeatureList::IsEnabled(kPageInfoRefactoring) &&
-      [self.dispatcher respondsToSelector:@selector(hidePageInfo)])
-    [self.dispatcher hidePageInfo];
   [self.dispatcher dismissPopupMenuAnimated:NO];
   [self.helpHandler hideAllHelpBubbles];
 }
@@ -3772,12 +3768,9 @@
     [SizeClassRecorder pageLoadedWithHorizontalSizeClass:sizeClass];
   }
 
-  // If there is no first responder, or it is not a view, try to make the
-  // webview or the NTP first responder to have it answer keyboard commands
-  // (e.g. space bar to scroll).
-  BOOL isFirstResponderView =
-      [GetFirstResponder() isKindOfClass:[UIView class]];
-  if (!isFirstResponderView && self.currentWebState) {
+  // If there is no first responder, try to make the webview or the NTP first
+  // responder to have it answer keyboard commands (e.g. space bar to scroll).
+  if (!GetFirstResponder() && self.currentWebState) {
     NewTabPageTabHelper* NTPHelper =
         NewTabPageTabHelper::FromWebState(webState);
     if (NTPHelper && NTPHelper->IsActive()) {
diff --git a/ios/chrome/browser/ui/commands/page_info_commands.h b/ios/chrome/browser/ui/commands/page_info_commands.h
index 7657616..e892ed6 100644
--- a/ios/chrome/browser/ui/commands/page_info_commands.h
+++ b/ios/chrome/browser/ui/commands/page_info_commands.h
@@ -11,11 +11,6 @@
 // Commands related to the Page Info UI.
 @protocol PageInfoCommands
 
-// TODO(crbug.com/1038923): Remove this command.
-// Shows the page security info. |originPoint| is the midpoint of the UI element
-// which triggered this command and should be in window coordinates.
-- (void)legacyShowPageInfoForOriginPoint:(CGPoint)originPoint;
-
 // Shows the page security info.
 - (void)showPageInfo;
 
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
index 16e80ef..34d67db 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
@@ -41,6 +41,7 @@
 #import "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/commands/browser_commands.h"
 #import "ios/chrome/browser/ui/commands/command_dispatcher.h"
+#import "ios/chrome/browser/ui/commands/omnibox_commands.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
 #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.h"
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_action_handler.h"
@@ -138,6 +139,12 @@
 
   _visible = YES;
 
+  // Make sure that the omnibox is unfocused to prevent having it visually
+  // focused while the NTP is just created (with the fakebox visible).
+  id<OmniboxCommands> omniboxCommandHandler =
+      HandlerForProtocol(self.browser->GetCommandDispatcher(), OmniboxCommands);
+  [omniboxCommandHandler cancelOmniboxEdit];
+
   self.authService = AuthenticationServiceFactory::GetForBrowserState(
       self.browser->GetBrowserState());
   self.authService->WaitUntilCacheIsPopulated();
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm
index adffb46..aeb8c84 100644
--- a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm
+++ b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm
@@ -146,8 +146,12 @@
   // callback occurs after the model's state is reset, and updating the model
   // the with active animator's current value would overwrite the reset value.
   StopAnimating(false /* update_model */);
-  // Update observers for the reset progress value.
+  // Update observers for the reset progress value and set the inset range in
+  // case this is a new WebState.
   for (auto& observer : observers_) {
+    observer.FullscreenViewportInsetRangeChanged(
+        controller_, controller_->GetMinViewportInsets(),
+        controller_->GetMaxViewportInsets());
     observer.FullscreenProgressUpdated(controller_, model_->progress());
   }
 
diff --git a/ios/chrome/browser/ui/main/BUILD.gn b/ios/chrome/browser/ui/main/BUILD.gn
index 125b4dc8..f839799a2 100644
--- a/ios/chrome/browser/ui/main/BUILD.gn
+++ b/ios/chrome/browser/ui/main/BUILD.gn
@@ -202,7 +202,6 @@
     "//ios/chrome/browser/web:tab_helper_delegates",
     "//ios/chrome/browser/web:web_internal",
     "//ios/chrome/browser/web_state_list",
-    "//ios/chrome/common/ui/util",
     "//ios/public/provider/chrome/browser",
     "//net",
   ]
diff --git a/ios/chrome/browser/ui/main/bvc_container_view_controller.mm b/ios/chrome/browser/ui/main/bvc_container_view_controller.mm
index a09cc540..d133899 100644
--- a/ios/chrome/browser/ui/main/bvc_container_view_controller.mm
+++ b/ios/chrome/browser/ui/main/bvc_container_view_controller.mm
@@ -4,7 +4,6 @@
 
 #import "ios/chrome/browser/ui/main/bvc_container_view_controller.h"
 #import "ios/chrome/browser/ui/thumb_strip/thumb_strip_feature.h"
-#import "ios/chrome/common/ui/util/constraints_ui_util.h"
 
 #include <ostream>
 
@@ -40,8 +39,8 @@
 
   // Add the new active view controller.
   [self addChildViewController:bvc];
+  bvc.view.frame = self.view.bounds;
   [self.view addSubview:bvc.view];
-  AddSameConstraints(self.view, bvc.view);
   [bvc didMoveToParentViewController:self];
 
   if (IsThumbStripEnabled()) {
diff --git a/ios/chrome/browser/ui/ntp/BUILD.gn b/ios/chrome/browser/ui/ntp/BUILD.gn
index d59c1973..d4b4ab3 100644
--- a/ios/chrome/browser/ui/ntp/BUILD.gn
+++ b/ios/chrome/browser/ui/ntp/BUILD.gn
@@ -108,7 +108,6 @@
     "//ios/chrome/browser/ui/content_suggestions/cells",
     "//ios/chrome/browser/ui/favicon",
     "//ios/chrome/browser/ui/overscroll_actions",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/settings/cells",
     "//ios/chrome/browser/ui/toolbar/buttons",
     "//ios/chrome/browser/ui/toolbar/public",
diff --git a/ios/chrome/browser/ui/ntp/incognito_view.mm b/ios/chrome/browser/ui/ntp/incognito_view.mm
index 50f1679..b63716da 100644
--- a/ios/chrome/browser/ui/ntp/incognito_view.mm
+++ b/ios/chrome/browser/ui/ntp/incognito_view.mm
@@ -11,7 +11,6 @@
 #include "ios/chrome/browser/application_context.h"
 #include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h"
 #import "ios/chrome/browser/drag_and_drop/url_drag_drop_handler.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h"
 #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator_unittest.mm b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator_unittest.mm
index a78b3ff6..ab661dc 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator_unittest.mm
@@ -14,6 +14,7 @@
 #import "ios/chrome/browser/signin/authentication_service_factory.h"
 #import "ios/chrome/browser/signin/authentication_service_fake.h"
 #import "ios/chrome/browser/ui/commands/command_dispatcher.h"
+#import "ios/chrome/browser/ui/commands/omnibox_commands.h"
 #import "ios/chrome/browser/ui/commands/snackbar_commands.h"
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h"
 #import "ios/chrome/browser/ui/main/scene_state.h"
@@ -90,8 +91,11 @@
 // Tests that the coordinator vends a content suggestions VC on the record.
 TEST_F(NewTabPageCoordinatorTest, StartOnTheRecord) {
   CreateCoordinator(/*off_the_record=*/false);
-  id snackbarCommandsHandlerMock =
-      [OCMockObject mockForProtocol:@protocol(SnackbarCommands)];
+  id omniboxCommandsHandlerMock = OCMProtocolMock(@protocol(OmniboxCommands));
+  id snackbarCommandsHandlerMock = OCMProtocolMock(@protocol(SnackbarCommands));
+  [browser_.get()->GetCommandDispatcher()
+      startDispatchingToTarget:omniboxCommandsHandlerMock
+                   forProtocol:@protocol(OmniboxCommands)];
   [browser_.get()->GetCommandDispatcher()
       startDispatchingToTarget:snackbarCommandsHandlerMock
                    forProtocol:@protocol(SnackbarCommands)];
diff --git a/ios/chrome/browser/ui/page_info/BUILD.gn b/ios/chrome/browser/ui/page_info/BUILD.gn
index 268c0790..6af7406c 100644
--- a/ios/chrome/browser/ui/page_info/BUILD.gn
+++ b/ios/chrome/browser/ui/page_info/BUILD.gn
@@ -5,8 +5,6 @@
 source_set("page_info") {
   configs += [ "//build/config/compiler:enable_arc" ]
   sources = [
-    "legacy_page_info_view_controller.h",
-    "legacy_page_info_view_controller.mm",
     "page_info_site_security_description.h",
     "page_info_site_security_description.mm",
     "page_info_view_controller.h",
@@ -29,7 +27,6 @@
     "//ios/chrome/browser/ui:feature_flags",
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/fancy_ui",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/page_info/requirements",
     "//ios/chrome/browser/ui/popup_menu",
     "//ios/chrome/browser/ui/settings/cells",
@@ -58,27 +55,15 @@
   ]
 }
 
-source_set("features") {
-  configs += [ "//build/config/compiler:enable_arc" ]
-  sources = [
-    "features.h",
-    "features.mm",
-  ]
-  deps = [ "//base" ]
-}
-
 source_set("coordinator") {
   configs += [ "//build/config/compiler:enable_arc" ]
   sources = [
     "page_info_coordinator.h",
     "page_info_coordinator.mm",
-    "page_info_legacy_coordinator.h",
-    "page_info_legacy_coordinator.mm",
     "page_info_site_security_mediator.h",
     "page_info_site_security_mediator.mm",
   ]
   deps = [
-    ":features",
     ":page_info",
     "resources:page_info_bad",
     "resources:page_info_good",
@@ -113,26 +98,3 @@
   ]
   frameworks = [ "UIKit.framework" ]
 }
-
-source_set("eg2_tests") {
-  defines = [ "CHROME_EARL_GREY_2" ]
-  configs += [
-    "//build/config/compiler:enable_arc",
-    "//build/config/ios:xctest_config",
-  ]
-  testonly = true
-  sources = [ "legacy_page_info_egtest.mm" ]
-  deps = [
-    ":constants",
-    "//ios/chrome/browser/ui/page_info:features",
-    "//ios/chrome/browser/ui/popup_menu:constants",
-    "//ios/chrome/test/earl_grey:eg_test_support+eg2",
-    "//ios/testing/earl_grey:eg_test_support+eg2",
-    "//ios/third_party/earl_grey2:test_lib",
-    "//ui/base",
-  ]
-  frameworks = [
-    "UIKit.framework",
-    "XCTest.framework",
-  ]
-}
diff --git a/ios/chrome/browser/ui/page_info/features.h b/ios/chrome/browser/ui/page_info/features.h
deleted file mode 100644
index d7f791d..0000000
--- a/ios/chrome/browser/ui/page_info/features.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IOS_CHROME_BROWSER_UI_PAGE_INFO_FEATURES_H_
-#define IOS_CHROME_BROWSER_UI_PAGE_INFO_FEATURES_H_
-
-#include "base/feature_list.h"
-
-// Feature to enable the new design of the page info.
-extern const base::Feature kPageInfoRefactoring;
-
-#endif  // IOS_CHROME_BROWSER_UI_PAGE_INFO_FEATURES_H_
diff --git a/ios/chrome/browser/ui/page_info/features.mm b/ios/chrome/browser/ui/page_info/features.mm
deleted file mode 100644
index 4d48b3f..0000000
--- a/ios/chrome/browser/ui/page_info/features.mm
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/page_info/features.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-const base::Feature kPageInfoRefactoring{"PageInfoRefactoring",
-                                         base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/ui/page_info/legacy_page_info_egtest.mm b/ios/chrome/browser/ui/page_info/legacy_page_info_egtest.mm
deleted file mode 100644
index 9334d41..0000000
--- a/ios/chrome/browser/ui/page_info/legacy_page_info_egtest.mm
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import <UIKit/UIKit.h>
-#import <XCTest/XCTest.h>
-
-#import "ios/chrome/browser/ui/page_info/features.h"
-#import "ios/chrome/browser/ui/page_info/page_info_constants.h"
-#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h"
-#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
-#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_test_case.h"
-#import "ios/testing/earl_grey/earl_grey_test.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-@interface LegacyPageInfoTestCase : ChromeTestCase
-@end
-
-@implementation LegacyPageInfoTestCase
-
-- (AppLaunchConfiguration)appConfigurationForTestCase {
-  AppLaunchConfiguration config;
-  config.features_disabled.push_back(kPageInfoRefactoring);
-  return config;
-}
-
-// Tests that rotating the device will automatically dismiss the page info view.
-- (void)testShowPageInfoAndDismissOnDeviceRotation {
-  // TODO(crbug.com/652465): Enable the test for iPad when rotation bug is
-  // fixed.
-  if ([ChromeEarlGrey isIPadIdiom]) {
-    EARL_GREY_TEST_DISABLED(@"Disabled for iPad due to device rotation bug.");
-  }
-
-  if ([[UIDevice currentDevice] orientation] != UIDeviceOrientationPortrait) {
-    [EarlGrey rotateDeviceToOrientation:UIDeviceOrientationPortrait error:nil];
-  }
-
-  [ChromeEarlGrey loadURL:GURL("https://invalid")];
-  [ChromeEarlGreyUI openToolsMenu];
-  [[[EarlGrey
-      selectElementWithMatcher:grey_allOf(grey_accessibilityID(
-                                              kToolsMenuSiteInformation),
-                                          grey_sufficientlyVisible(), nil)]
-         usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, 200)
-      onElementWithMatcher:grey_accessibilityID(kPopupMenuToolsMenuTableViewId)]
-      performAction:grey_tap()];
-
-  // Expect that the page info view has appeared.
-  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(
-                                          kPageInfoViewAccessibilityIdentifier)]
-      assertWithMatcher:grey_sufficientlyVisible()];
-  [EarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeRight
-                                error:nil];
-
-  // Expect that the page info view has disappeared.
-  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(
-                                          kPageInfoViewAccessibilityIdentifier)]
-      assertWithMatcher:grey_nil()];
-}
-
-@end
diff --git a/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.h b/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.h
deleted file mode 100644
index aeff3edb..0000000
--- a/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IOS_CHROME_BROWSER_UI_PAGE_INFO_LEGACY_PAGE_INFO_VIEW_CONTROLLER_H_
-#define IOS_CHROME_BROWSER_UI_PAGE_INFO_LEGACY_PAGE_INFO_VIEW_CONTROLLER_H_
-
-#import <UIKit/UIKit.h>
-
-#include <memory>
-
-#include "base/memory/weak_ptr.h"
-
-@protocol BrowserCommands;
-@class PageInfoSiteSecurityDescription;
-@protocol PageInfoPresentation;
-
-// The view controller for the page info view.
-@interface LegacyPageInfoViewController : NSObject
-// Designated initializer.
-// The |sourcePoint| parameter should be in the coordinate system of
-// |provider|'s view. Typically, |sourcePoint| would be the midpoint of a button
-// that resulted in this popup being displayed.
-- (id)initWithModel:(PageInfoSiteSecurityDescription*)model
-             sourcePoint:(CGPoint)sourcePoint
-    presentationProvider:(id<PageInfoPresentation>)provider
-                 handler:(id<BrowserCommands>)handler;
-
-// Dispatcher for this view controller.
-@property(nonatomic, weak) id<BrowserCommands> handler;
-
-// Dismisses the view.
-- (void)dismiss;
-
-// Layout the page info view.
-- (void)performLayout;
-
-@end
-
-#endif  // IOS_CHROME_BROWSER_UI_PAGE_INFO_LEGACY_PAGE_INFO_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.mm b/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.mm
deleted file mode 100644
index 63a56354..0000000
--- a/ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.mm
+++ /dev/null
@@ -1,558 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.h"
-
-#import <MaterialComponents/MaterialTypography.h>
-
-#include "base/bind.h"
-#include "base/location.h"
-#include "base/mac/bundle_locations.h"
-#import "base/mac/foundation_util.h"
-#include "base/single_thread_task_runner.h"
-#include "base/strings/sys_string_conversions.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "components/strings/grit/components_strings.h"
-#import "ios/chrome/browser/ui/commands/browser_commands.h"
-#import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h"
-#import "ios/chrome/browser/ui/page_info/page_info_constants.h"
-#include "ios/chrome/browser/ui/page_info/page_info_site_security_description.h"
-#import "ios/chrome/browser/ui/page_info/requirements/page_info_presentation.h"
-#import "ios/chrome/browser/ui/util/animation_util.h"
-#include "ios/chrome/browser/ui/util/rtl_geometry.h"
-#include "ios/chrome/browser/ui/util/ui_util.h"
-#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
-#import "ios/chrome/common/material_timing.h"
-#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
-#import "ios/chrome/common/ui/colors/semantic_color_names.h"
-#include "ios/chrome/grit/ios_strings.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/l10n/l10n_util_mac.h"
-#import "ui/gfx/ios/NSString+CrStringDrawing.h"
-#import "ui/gfx/ios/uikit_util.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-using ios::material::TimingFunction;
-
-namespace {
-
-// The width of the view.
-const CGFloat kViewWidthRegular = 600.0;
-const CGFloat kViewWidthCompact = 288.0;
-const CGFloat kViewWidthiPhoneLandscape = 400.0;
-// Spacing in between sections.
-const CGFloat kVerticalSpacing = 20.0;
-// Initial position for the left side of the frame.
-const CGFloat kInitialFramePosition = 8.0;
-// Alpha for the shield.
-const CGFloat kShieldAlpha = 0.5;
-// Scroll View inset.
-const CGFloat kScrollViewInset = 5.0;
-// The size of the footer (rounded corner and shadow) for page info view.
-const CGFloat kPageInfoViewFooterSize = 15.0;
-// Padding between the window frame and content.
-const CGFloat kFramePadding = 24;
-// Padding for the initial line of the view.
-const CGFloat kInitialLinePadding = 40;
-// Padding between the bottom of the content and the window frame.
-const CGFloat kFrameBottomPadding = 16;
-// Spacing between the optional headline and description text views.
-const CGFloat kHeadlineSpacing = 16;
-// Spacing between the image and the text.
-const CGFloat kImageSpacing = 16;
-// Square size of the image.
-const CGFloat kImageSize = 24;
-// The height of the headline label.
-const CGFloat kHeadlineHeight = 19;
-
-inline UIFont* PageInfoHeadlineFont() {
-  return [[MDCTypography fontLoader] mediumFontOfSize:16];
-}
-
-inline CATransform3D PageInfoAnimationScale() {
-  return CATransform3DMakeScale(0.03, 0.03, 1);
-}
-
-// Offset to make sure image aligns with the header line.
-inline CGFloat PageInfoImageVerticalOffset() {
-  return ui::AlignValueToUpperPixel((kHeadlineHeight - kImageSize) / 2.0);
-}
-
-// The X position of the text fields. Variants for with and without an image.
-const CGFloat kTextXPositionNoImage = kFramePadding;
-const CGFloat kTextXPosition =
-    kTextXPositionNoImage + kImageSize + kImageSpacing;
-
-// The X offset for the help button.
-const CGFloat kButtonXOffset = kTextXPosition;
-
-}  // namespace
-
-#pragma mark - LegacyPageInfoViewController
-
-@interface LegacyPageInfoViewController () {
-  // Scroll View inside the PageInfoView used to display content that exceeds
-  // the available space.
-  UIScrollView* _scrollView;
-  // Container View added inside the Scroll View. All content is added to this
-  // view.
-  BidiContainerView* _innerContainerView;
-
-  // Origin of the arrow at the top of the popup window.
-  CGPoint _arrowOriginPoint;
-
-  // Model for the data to display.
-  PageInfoSiteSecurityDescription* _model;
-
-  // Width of the view. Depends on the device (iPad/iPhone).
-  CGFloat _viewWidth;
-
-  // Width of the text fields.
-  CGFloat _textWidth;
-
-  // YES when the popup has finished animating in. NO otherwise.
-  BOOL _displayAnimationCompleted;
-}
-
-@property(nonatomic, strong) UIView* containerView;
-@property(nonatomic, strong) UIView* popupContainer;
-// An invisible button added to the |containerView|. Closes the popup just
-// like the tap on the background. Exposed purely for voiceover purposes.
-@property(nonatomic, strong) UIButton* closeButton;
-
-@end
-
-@implementation LegacyPageInfoViewController
-
-#pragma mark public
-
-- (id)initWithModel:(PageInfoSiteSecurityDescription*)model
-             sourcePoint:(CGPoint)sourcePoint
-    presentationProvider:(id<PageInfoPresentation>)provider
-                 handler:(id<BrowserCommands>)handler {
-  DCHECK(provider);
-  self = [super init];
-  if (self) {
-    _scrollView =
-        [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 240, 128)];
-    [_scrollView setMultipleTouchEnabled:YES];
-    [_scrollView setClipsToBounds:YES];
-    [_scrollView setShowsHorizontalScrollIndicator:NO];
-    [_scrollView setIndicatorStyle:UIScrollViewIndicatorStyleBlack];
-    [_scrollView
-        setAutoresizingMask:(UIViewAutoresizingFlexibleTrailingMargin() |
-                             UIViewAutoresizingFlexibleTopMargin)];
-
-    _innerContainerView =
-        [[BidiContainerView alloc] initWithFrame:CGRectMake(0, 0, 194, 327)];
-    [_innerContainerView
-        setAccessibilityLabel:@"Page Security Info Scroll Container"];
-    [_innerContainerView
-        setAutoresizingMask:(UIViewAutoresizingFlexibleTrailingMargin() |
-                             UIViewAutoresizingFlexibleBottomMargin)];
-
-    _model = model;
-    _arrowOriginPoint = sourcePoint;
-    _handler = handler;
-
-    UIInterfaceOrientation orientation =
-        [[UIApplication sharedApplication] statusBarOrientation];
-    _viewWidth = IsCompactWidth([UIApplication sharedApplication].keyWindow)
-                     ? kViewWidthCompact
-                     : kViewWidthRegular;
-    // Special case iPhone landscape.
-    if (!IsIPadIdiom() && UIInterfaceOrientationIsLandscape(orientation))
-      _viewWidth = kViewWidthiPhoneLandscape;
-
-    _textWidth = _viewWidth - (kImageSize + kImageSpacing + kFramePadding * 2 +
-                               kScrollViewInset * 2);
-
-    _containerView = [[UIView alloc] init];
-    [_containerView setBackgroundColor:[UIColor colorWithWhite:0
-                                                         alpha:kShieldAlpha]];
-    [_containerView setOpaque:NO];
-    [_containerView setAlpha:0];
-    [_containerView setAccessibilityViewIsModal:YES];
-    _containerView.accessibilityIdentifier =
-        kPageInfoViewAccessibilityIdentifier;
-
-    // Set up an invisible button that closes the popup.
-    _closeButton = [[UIButton alloc] init];
-    _closeButton.accessibilityLabel = l10n_util::GetNSString(IDS_DONE);
-    [_closeButton addTarget:handler
-                     action:@selector(hidePageInfo)
-           forControlEvents:UIControlEventTouchDown];
-    [_containerView addSubview:_closeButton];
-
-    _popupContainer = [[UIView alloc] initWithFrame:CGRectZero];
-    [_popupContainer setBackgroundColor:UIColor.cr_systemBackgroundColor];
-    [_popupContainer setClipsToBounds:YES];
-    _popupContainer.userInteractionEnabled = YES;
-    [_containerView addSubview:_popupContainer];
-
-    [self.popupContainer addSubview:_scrollView];
-    [_scrollView addSubview:_innerContainerView];
-    [_scrollView setAccessibilityIdentifier:@"Page Security Scroll View"];
-    [provider presentPageInfoView:self.containerView];
-    [self performLayout];
-
-    [self animatePageInfoViewIn:sourcePoint];
-    UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
-                                    _containerView);
-  }
-
-  return self;
-}
-
-- (void)performLayout {
-  CGFloat offset = kInitialLinePadding;
-
-  // Keep the new subviews in an array that gets replaced at the end.
-  NSMutableArray* subviews = [NSMutableArray array];
-
-    // Only certain sections have images. This affects the X position.
-  BOOL hasImage = _model.legacyImage != nil;
-  CGFloat xPosition = (hasImage ? kTextXPosition : kTextXPositionNoImage);
-
-  // Insert the image subview for sections that are appropriate.
-  CGFloat imageBaseline = offset + kImageSize;
-  if (hasImage) {
-    [self addImage:[_model.legacyImage imageWithRenderingMode:
-                                           UIImageRenderingModeAlwaysTemplate]
-        toSubviews:subviews
-          atOffset:offset + PageInfoImageVerticalOffset()];
-  }
-
-    // Add the title.
-  offset += [self addHeadline:_model.siteURL
-                   toSubviews:subviews
-                      atPoint:CGPointMake(xPosition, offset)];
-  offset += kHeadlineSpacing;
-
-  // Create the description of the state.
-  offset += [self addDescription:_model.message
-                      toSubviews:subviews
-                         atPoint:CGPointMake(xPosition, offset)];
-
-  // If at this point the description and optional headline and button are
-  // not as tall as the image, adjust the offset by the difference.
-  CGFloat imageBaselineDelta = imageBaseline - offset;
-  if (imageBaselineDelta > 0)
-    offset += imageBaselineDelta;
-
-  // Add the separators.
-  if (_model.buttonAction != PageInfoSiteSecurityButtonActionNone) {
-    offset += kVerticalSpacing;
-  }
-
-  // The last item at the bottom of the window is the help center link. Do not
-  // show this for the internal pages, which have one section.
-  offset += [self addButton:_model.buttonAction
-                 toSubviews:subviews
-                   atOffset:offset];
-
-  // Add the bottom padding.
-  offset += kVerticalSpacing;
-  CGRect frame = CGRectMake(kInitialFramePosition, _arrowOriginPoint.y,
-                            _viewWidth, offset);
-
-  // Increase the size of the frame by the amount used for drawing rounded
-  // corners and shadow.
-  frame.size.height += kPageInfoViewFooterSize;
-
-  if (CGRectGetMaxY(frame) >
-      CGRectGetMaxY([[self containerView] superview].bounds) -
-          kFrameBottomPadding) {
-    // If the frame is bigger than the parent view than change the frame to
-    // fit in the superview bounds.
-    frame.size.height = [[self containerView] superview].bounds.size.height -
-                        kFrameBottomPadding - frame.origin.y;
-
-    [_scrollView setScrollEnabled:YES];
-    [_scrollView flashScrollIndicators];
-  } else {
-    [_scrollView setScrollEnabled:NO];
-  }
-
-  CGRect containerBounds = [_containerView bounds];
-  CGRect popupFrame = frame;
-  popupFrame.origin.x =
-      CGRectGetMidX(containerBounds) - CGRectGetWidth(popupFrame) / 2.0;
-  popupFrame.origin.y =
-      CGRectGetMidY(containerBounds) - CGRectGetHeight(popupFrame) / 2.0;
-
-  popupFrame.origin = AlignPointToPixel(popupFrame.origin);
-  CGRect innerFrame = CGRectMake(0, 0, popupFrame.size.width, offset);
-
-  // If the initial animation has completed, animate the new frames.
-  if (_displayAnimationCompleted) {
-    [UIView cr_animateWithDuration:ios::material::kDuration3
-                             delay:0
-                             curve:ios::material::CurveEaseInOut
-                           options:0
-                        animations:^{
-                          [_popupContainer setFrame:popupFrame];
-                          [_scrollView setFrame:[_popupContainer bounds]];
-                          [_innerContainerView setFrame:innerFrame];
-                        }
-                        completion:nil];
-  } else {
-    // Popup hasn't finished animating in yet. Set frames immediately.
-    [_popupContainer setFrame:popupFrame];
-    [_scrollView setFrame:[_popupContainer bounds]];
-    [_innerContainerView setFrame:innerFrame];
-  }
-
-  for (UIView* view in [_innerContainerView subviews]) {
-    [view removeFromSuperview];
-  }
-
-  for (UIView* view in subviews) {
-    [_innerContainerView addSubview:view];
-    [_innerContainerView setSubviewNeedsAdjustmentForRTL:view];
-  }
-
-  [_scrollView setContentSize:_innerContainerView.frame.size];
-  _closeButton.frame = _containerView.bounds;
-}
-
-- (void)dismiss {
-  [self animatePageInfoViewOut];
-  UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
-                                  nil);
-}
-
-#pragma mark - internal
-
-- (BOOL)accessibilityPerformEscape {
-  [self.handler hidePageInfo];
-  return YES;
-}
-
-- (void)animatePageInfoViewIn:(CGPoint)sourcePoint {
-  // Animate the info card itself.
-  CATransform3D scaleTransform = PageInfoAnimationScale();
-
-  CABasicAnimation* scaleAnimation =
-      [CABasicAnimation animationWithKeyPath:@"transform"];
-  [scaleAnimation setFromValue:[NSValue valueWithCATransform3D:scaleTransform]];
-
-  CABasicAnimation* positionAnimation =
-      [CABasicAnimation animationWithKeyPath:@"position"];
-  [positionAnimation setFromValue:[NSValue valueWithCGPoint:sourcePoint]];
-
-  CAAnimationGroup* sizeAnimation = [CAAnimationGroup animation];
-  [sizeAnimation setAnimations:@[ scaleAnimation, positionAnimation ]];
-  [sizeAnimation
-      setTimingFunction:TimingFunction(ios::material::CurveEaseInOut)];
-  [sizeAnimation setDuration:ios::material::kDuration3];
-
-  CABasicAnimation* fadeAnimation =
-      [CABasicAnimation animationWithKeyPath:@"opacity"];
-  [fadeAnimation setTimingFunction:TimingFunction(ios::material::CurveEaseOut)];
-  [fadeAnimation setDuration:ios::material::kDuration6];
-  [fadeAnimation setFromValue:@0];
-  [fadeAnimation setToValue:@1];
-
-  [[_popupContainer layer] addAnimation:fadeAnimation forKey:@"fade"];
-  [[_popupContainer layer] addAnimation:sizeAnimation forKey:@"size"];
-
-  // Animation the background grey overlay.
-  CABasicAnimation* overlayAnimation =
-      [CABasicAnimation animationWithKeyPath:@"opacity"];
-  [overlayAnimation
-      setTimingFunction:TimingFunction(ios::material::CurveEaseOut)];
-  [overlayAnimation setDuration:ios::material::kDuration3];
-  [overlayAnimation setFromValue:@0];
-  [overlayAnimation setToValue:@1];
-
-  [[_containerView layer] addAnimation:overlayAnimation forKey:@"fade"];
-  [_containerView setAlpha:1];
-
-  // Animate the contents of the info card.
-  CALayer* contentsLayer = [_innerContainerView layer];
-
-  CGRect startFrame = CGRectOffset([_innerContainerView frame], 0, -32);
-  CAAnimation* contentSlideAnimation = FrameAnimationMake(
-      contentsLayer, startFrame, [_innerContainerView frame]);
-  [contentSlideAnimation
-      setTimingFunction:TimingFunction(ios::material::CurveEaseOut)];
-  [contentSlideAnimation setDuration:ios::material::kDuration5];
-  contentSlideAnimation =
-      DelayedAnimationMake(contentSlideAnimation, ios::material::kDuration2);
-  [contentsLayer addAnimation:contentSlideAnimation forKey:@"slide"];
-
-  [CATransaction begin];
-  [CATransaction setCompletionBlock:^{
-    [_innerContainerView setAlpha:1];
-    _displayAnimationCompleted = YES;
-  }];
-  CAAnimation* contentFadeAnimation = OpacityAnimationMake(0.0, 1.0);
-  [contentFadeAnimation
-      setTimingFunction:TimingFunction(ios::material::CurveEaseOut)];
-  [contentFadeAnimation setDuration:ios::material::kDuration5];
-  contentFadeAnimation =
-      DelayedAnimationMake(contentFadeAnimation, ios::material::kDuration1);
-  [contentsLayer addAnimation:contentFadeAnimation forKey:@"fade"];
-  [CATransaction commit];
-
-  // Since the animations have delay on them, the alpha of the content view
-  // needs to be set to zero and then one after the animation starts. If these
-  // steps are not taken, there will be a visible flash/jump from the initial
-  // spot during the animation.
-  [_innerContainerView setAlpha:0];
-}
-
-- (void)animatePageInfoViewOut {
-  [CATransaction begin];
-  [CATransaction setCompletionBlock:^{
-    [self.containerView removeFromSuperview];
-  }];
-
-  CABasicAnimation* opacityAnimation =
-      [CABasicAnimation animationWithKeyPath:@"opacity"];
-  [opacityAnimation
-      setTimingFunction:TimingFunction(ios::material::CurveEaseIn)];
-  [opacityAnimation setDuration:ios::material::kDuration3];
-  [opacityAnimation setFromValue:@1];
-  [opacityAnimation setToValue:@0];
-  [[_containerView layer] addAnimation:opacityAnimation forKey:@"animateOut"];
-
-  [_popupContainer setAlpha:0];
-  [_containerView setAlpha:0];
-  [CATransaction commit];
-}
-
-#pragma mark - Helper methods to create subviews.
-
-// Adds the state image at a pre-determined x position and the given y. This
-// does not affect the next Y position because the image is placed next to
-// a text field that is larger and accounts for the image's size.
-- (void)addImage:(UIImage*)image
-      toSubviews:(NSMutableArray*)subviews
-        atOffset:(CGFloat)offset {
-  CGRect frame = CGRectMake(kFramePadding, offset, kImageSize, kImageSize);
-  UIImageView* imageView = [[UIImageView alloc] initWithFrame:frame];
-  imageView.tintColor = UIColor.cr_labelColor;
-  [imageView setImage:image];
-  [subviews addObject:imageView];
-}
-
-// Adds the title text field at the given x,y position, and returns the y
-// position for the next element.
-- (CGFloat)addHeadline:(NSString*)headline
-            toSubviews:(NSMutableArray*)subviews
-               atPoint:(CGPoint)point {
-  CGRect frame = CGRectMake(point.x, point.y, _textWidth, kHeadlineHeight);
-  UILabel* label = [[UILabel alloc] initWithFrame:frame];
-  [label setTextAlignment:NSTextAlignmentNatural];
-  [label setText:headline];
-  [label setTextColor:UIColor.cr_labelColor];
-  [label setFont:PageInfoHeadlineFont()];
-  [label setFrame:frame];
-  [label setLineBreakMode:NSLineBreakByTruncatingHead];
-  [subviews addObject:label];
-  return CGRectGetHeight(frame);
-}
-
-// Adds the description text field at the given x,y position, and returns the y
-// position for the next element.
-- (CGFloat)addDescription:(NSString*)description
-               toSubviews:(NSMutableArray*)subviews
-                  atPoint:(CGPoint)point {
-  CGRect frame = CGRectMake(point.x, point.y, _textWidth, kImageSize);
-  UILabel* label = [[UILabel alloc] initWithFrame:frame];
-  [label setTextAlignment:NSTextAlignmentNatural];
-  UIFont* font = [MDCTypography captionFont];
-  [label setTextColor:UIColor.cr_labelColor];
-  [label setText:description];
-  [label setFont:font];
-  [label setNumberOfLines:0];
-
-  // If the text is oversized, resize the text field.
-  CGSize constraintSize = CGSizeMake(_textWidth, CGFLOAT_MAX);
-  CGSize sizeToFit = [description cr_boundingSizeWithSize:constraintSize
-                                                     font:font];
-  frame.size.height = sizeToFit.height;
-  [label setFrame:frame];
-  [subviews addObject:label];
-  return CGRectGetHeight(frame);
-}
-
-// Returns a button with title and action configured for |buttonAction|.
-- (UIButton*)buttonForAction:(PageInfoSiteSecurityButtonAction)buttonAction {
-  if (buttonAction == PageInfoSiteSecurityButtonActionNone) {
-    return nil;
-  }
-  UIButton* button = [[UIButton alloc] initWithFrame:CGRectZero];
-  int messageId;
-  NSString* accessibilityID = @"Reload button";
-  switch (buttonAction) {
-    case PageInfoSiteSecurityButtonActionNone:
-      NOTREACHED();
-      return nil;
-    case PageInfoSiteSecurityButtonActionShowHelp:
-      messageId = IDS_LEARN_MORE;
-      accessibilityID = @"Learn more";
-      [button addTarget:self.handler
-                    action:@selector(showSecurityHelpPage)
-          forControlEvents:UIControlEventTouchUpInside];
-      break;
-    case PageInfoSiteSecurityButtonActionReload:
-      messageId = IDS_IOS_PAGE_INFO_RELOAD;
-      accessibilityID = @"Reload button";
-      [button addTarget:self.handler
-                    action:@selector(hidePageInfo)
-          forControlEvents:UIControlEventTouchUpInside];
-      [button addTarget:self.handler
-                    action:@selector(reload)
-          forControlEvents:UIControlEventTouchUpInside];
-      break;
-  };
-
-  NSString* title = l10n_util::GetNSStringWithFixup(messageId);
-  SetA11yLabelAndUiAutomationName(button, messageId, accessibilityID);
-  [button setTitle:title forState:UIControlStateNormal];
-  return button;
-}
-
-// Adds the the button |buttonAction| that explains the icons. Returns the y
-// position delta for the next offset.
-- (CGFloat)addButton:(PageInfoSiteSecurityButtonAction)buttonAction
-          toSubviews:(NSMutableArray*)subviews
-            atOffset:(CGFloat)offset {
-  UIButton* button = [self buttonForAction:buttonAction];
-  if (!button) {
-    return 0;
-  }
-  // The size of the initial frame is irrelevant since it will be changed based
-  // on the size for the string inside.
-  CGRect frame = CGRectMake(kButtonXOffset, offset, 100, 10);
-
-  UIFont* font = [MDCTypography captionFont];
-  CGSize sizeWithFont =
-      [[[button titleLabel] text] cr_pixelAlignedSizeWithFont:font];
-  frame.size = sizeWithFont;
-  // According to iOS Human Interface Guidelines, minimal size of UIButton
-  // should be 44x44.
-  frame.size.height = std::max<CGFloat>(44, frame.size.height);
-
-  [button setFrame:frame];
-
-  [button.titleLabel setFont:font];
-  [button.titleLabel setTextAlignment:NSTextAlignmentLeft];
-  [button setTitleColor:[UIColor colorNamed:kBlueColor]
-               forState:UIControlStateNormal];
-  [button setTitleColor:[UIColor colorNamed:kBlueColor]
-               forState:UIControlStateSelected];
-
-  [subviews addObject:button];
-
-  return CGRectGetHeight([button frame]);
-}
-
-@end
diff --git a/ios/chrome/browser/ui/page_info/page_info_coordinator.mm b/ios/chrome/browser/ui/page_info/page_info_coordinator.mm
index 3cc0cdf..2707110 100644
--- a/ios/chrome/browser/ui/page_info/page_info_coordinator.mm
+++ b/ios/chrome/browser/ui/page_info/page_info_coordinator.mm
@@ -7,7 +7,6 @@
 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h"
 #include "ios/chrome/browser/main/browser.h"
-#import "ios/chrome/browser/reading_list/offline_page_tab_helper.h"
 #include "ios/chrome/browser/ui/commands/browser_commands.h"
 #import "ios/chrome/browser/ui/commands/command_dispatcher.h"
 #import "ios/chrome/browser/ui/page_info/page_info_site_security_description.h"
@@ -15,8 +14,6 @@
 #import "ios/chrome/browser/ui/page_info/page_info_view_controller.h"
 #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller.h"
 #import "ios/chrome/browser/web_state_list/web_state_list.h"
-#include "ios/web/public/navigation/navigation_item.h"
-#include "ios/web/public/navigation/navigation_manager.h"
 #import "ios/web/public/web_state.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -41,16 +38,9 @@
 - (void)start {
   web::WebState* webState =
       self.browser->GetWebStateList()->GetActiveWebState();
-  web::NavigationItem* navItem =
-      webState->GetNavigationManager()->GetVisibleItem();
-
-  bool offlinePage =
-      OfflinePageTabHelper::FromWebState(webState)->presenting_offline_page();
 
   PageInfoSiteSecurityDescription* siteSecurityDescription =
-      [PageInfoSiteSecurityMediator configurationForURL:navItem->GetURL()
-                                              SSLStatus:navItem->GetSSL()
-                                            offlinePage:offlinePage];
+      [PageInfoSiteSecurityMediator configurationForWebState:webState];
 
   self.viewController = [[PageInfoViewController alloc]
       initWithSiteSecurityDescription:siteSecurityDescription];
diff --git a/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.h b/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.h
deleted file mode 100644
index e51496f7..0000000
--- a/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IOS_CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_LEGACY_COORDINATOR_H_
-#define IOS_CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_LEGACY_COORDINATOR_H_
-
-#import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h"
-
-@protocol PageInfoPresentation;
-
-// The coordinator that manages the display of the Page Info UI. When
-// |dispatcher| is set, this coordinator uses |dispatcher| to register itself
-// as the target for PageInfoCommmands. These commands can then trigger the
-// showing/hiding of the Page Info UI. The PageInfo UI must have been hidden
-// before |-stop| is called.
-@interface PageInfoLegacyCoordinator : ChromeCoordinator
-
-//|originPoint| is the midpoint of the UI element from which the page info
-// should start presenting.
-@property(nonatomic, assign) CGPoint originPoint;
-
-// |presentationProvider| provides information and runs tasks necessary to
-// present Page Info.
-@property(nonatomic, weak) id<PageInfoPresentation> presentationProvider;
-
-@end
-
-#endif  // IOS_CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_LEGACY_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.mm b/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.mm
deleted file mode 100644
index d52f9a17..0000000
--- a/ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.mm
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/page_info/page_info_legacy_coordinator.h"
-
-#import <Foundation/Foundation.h>
-
-#include "base/metrics/user_metrics.h"
-#include "base/metrics/user_metrics_action.h"
-#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
-#include "ios/chrome/browser/chrome_url_constants.h"
-#import "ios/chrome/browser/main/browser.h"
-#import "ios/chrome/browser/reading_list/offline_page_tab_helper.h"
-#include "ios/chrome/browser/reading_list/offline_url_utils.h"
-#import "ios/chrome/browser/ui/commands/browser_commands.h"
-#import "ios/chrome/browser/ui/commands/command_dispatcher.h"
-#import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
-#import "ios/chrome/browser/ui/fullscreen/chrome_coordinator+fullscreen_disabling.h"
-#import "ios/chrome/browser/ui/page_info/legacy_page_info_view_controller.h"
-#import "ios/chrome/browser/ui/page_info/page_info_constants.h"
-#import "ios/chrome/browser/ui/page_info/page_info_site_security_mediator.h"
-#import "ios/chrome/browser/ui/page_info/requirements/page_info_presentation.h"
-#import "ios/chrome/browser/web_state_list/web_state_list.h"
-#include "ios/web/public/navigation/navigation_item.h"
-#include "ios/web/public/navigation/navigation_manager.h"
-#include "ios/web/public/navigation/reload_type.h"
-#include "ios/web/public/web_client.h"
-#import "ios/web/public/web_state.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-@interface PageInfoLegacyCoordinator ()
-
-// The view controller for the Page Info UI. Nil if not visible.
-@property(nonatomic, strong)
-    LegacyPageInfoViewController* pageInfoViewController;
-
-@end
-
-@implementation PageInfoLegacyCoordinator
-
-@synthesize presentationProvider = _presentationProvider;
-
-#pragma mark - ChromeCoordinator
-
-- (void)start {
-  web::WebState* webState =
-      self.browser->GetWebStateList()->GetActiveWebState();
-  web::NavigationItem* navItem =
-      webState->GetNavigationManager()->GetVisibleItem();
-
-  // It is fully expected to have a navItem here, as showPageInfoPopup can only
-  // be trigerred by a button enabled when a current item matches some
-  // conditions. However a crash was seen were navItem was NULL hence this
-  // test after a DCHECK.
-  DCHECK(navItem);
-  if (!navItem)
-    return;
-
-  // Don't show the bubble twice (this can happen when tapping very quickly in
-  // accessibility mode).
-  if (self.pageInfoViewController)
-    return;
-
-  base::RecordAction(base::UserMetricsAction("MobileToolbarPageSecurityInfo"));
-
-  [self.presentationProvider prepareForPageInfoPresentation];
-
-  [[NSNotificationCenter defaultCenter]
-      postNotificationName:kPageInfoWillShowNotification
-                    object:nil];
-
-  // Disable fullscreen while the page info UI is displayed.
-  [self didStartFullscreenDisablingUI];
-
-  GURL url = navItem->GetURL();
-  bool presentingOfflinePage =
-      OfflinePageTabHelper::FromWebState(webState)->presenting_offline_page();
-
-  PageInfoSiteSecurityDescription* config =
-      [PageInfoSiteSecurityMediator configurationForURL:navItem->GetURL()
-                                              SSLStatus:navItem->GetSSL()
-                                            offlinePage:presentingOfflinePage];
-
-  CGPoint originPresentationCoordinates = [self.presentationProvider
-      convertToPresentationCoordinatesForOrigin:self.originPoint];
-  // TODO(crbug.com/1045047): Use HandlerForProtocol() when BrowserCommands is
-  // broken up.
-  self.pageInfoViewController = [[LegacyPageInfoViewController alloc]
-             initWithModel:config
-               sourcePoint:originPresentationCoordinates
-      presentationProvider:self.presentationProvider
-                   handler:static_cast<id<BrowserCommands>>(
-                               self.browser->GetCommandDispatcher())];
-}
-
-- (void)stop {
-  // Early return if the PageInfoPopup is not presented.
-  if (!self.pageInfoViewController)
-    return;
-
-  [[NSNotificationCenter defaultCenter]
-      postNotificationName:kPageInfoWillHideNotification
-                    object:nil];
-
-  // Stop disabling fullscreen since the page info UI was stopped.
-  [self didStopFullscreenDisablingUI];
-
-  [self.pageInfoViewController dismiss];
-  self.pageInfoViewController = nil;
-}
-
-@end
diff --git a/ios/chrome/browser/ui/page_info/page_info_site_security_description.h b/ios/chrome/browser/ui/page_info/page_info_site_security_description.h
index a6e1a8c..63c68a9 100644
--- a/ios/chrome/browser/ui/page_info/page_info_site_security_description.h
+++ b/ios/chrome/browser/ui/page_info/page_info_site_security_description.h
@@ -7,26 +7,13 @@
 
 #import <UIKit/UIKit.h>
 
-// Types of the different actions the page info Site Security button can have.
-typedef NS_ENUM(NSUInteger, PageInfoSiteSecurityButtonAction) {
-  // No action.
-  PageInfoSiteSecurityButtonActionNone,
-  // Show the help page.
-  PageInfoSiteSecurityButtonActionShowHelp,
-  // Reload the page.
-  PageInfoSiteSecurityButtonActionReload,
-};
-
 // Config for the information displayed by the page info Site Security section.
 @interface PageInfoSiteSecurityDescription : NSObject
 
 @property(nonatomic, copy) NSString* siteURL;
 @property(nonatomic, copy) NSString* status;
 @property(nonatomic, copy) NSString* message;
-// TODO(crbug.com/1038923): Remove this.
-@property(nonatomic, strong) UIImage* legacyImage;
 @property(nonatomic, copy) NSString* iconImageName;
-@property(nonatomic, assign) PageInfoSiteSecurityButtonAction buttonAction;
 @property(nonatomic, assign) BOOL isEmpty;
 
 @end
diff --git a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.h b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.h
index 4ade9c1..9dd2d415 100644
--- a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.h
+++ b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.h
@@ -8,11 +8,10 @@
 #import <Foundation/Foundation.h>
 
 namespace web {
-struct SSLStatus;
+class WebState;
 }
 
 @class PageInfoSiteSecurityDescription;
-class GURL;
 
 // Mediator for the page info site security, extracting the data to be displayed
 // for the view controller.
@@ -21,12 +20,9 @@
 // For now this object only have static method.
 - (instancetype)init NS_UNAVAILABLE;
 
-// Returns a configuration based on the |URL|, the SSL |status| and if the
-// current page is an |offlinePage|.
-// TODO(crbug.com/1038923): This method should take a WebState.
-+ (PageInfoSiteSecurityDescription*)configurationForURL:(const GURL&)URL
-                                              SSLStatus:(web::SSLStatus&)status
-                                            offlinePage:(BOOL)offlinePage;
+// Returns a configuration based on the given WebState.
++ (PageInfoSiteSecurityDescription*)configurationForWebState:
+    (web::WebState*)webState;
 
 @end
 
diff --git a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm
index b644fcf..534977a 100644
--- a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm
+++ b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm
@@ -12,12 +12,15 @@
 #include "components/strings/grit/components_google_chrome_strings.h"
 #include "components/strings/grit/components_strings.h"
 #include "ios/chrome/browser/chrome_url_constants.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
+#import "ios/chrome/browser/reading_list/offline_page_tab_helper.h"
 #import "ios/chrome/browser/ui/page_info/page_info_site_security_description.h"
 #include "ios/chrome/grit/ios_chromium_strings.h"
 #include "ios/chrome/grit/ios_strings.h"
 #include "ios/components/webui/web_ui_url_constants.h"
+#include "ios/web/public/navigation/navigation_item.h"
+#include "ios/web/public/navigation/navigation_manager.h"
 #include "ios/web/public/security/ssl_status.h"
+#import "ios/web/public/web_state.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "url/gurl.h"
 
@@ -69,32 +72,31 @@
 
 @implementation PageInfoSiteSecurityMediator
 
-+ (PageInfoSiteSecurityDescription*)configurationForURL:(const GURL&)URL
-                                              SSLStatus:(web::SSLStatus&)status
-                                            offlinePage:(BOOL)offlinePage {
++ (PageInfoSiteSecurityDescription*)configurationForWebState:
+    (web::WebState*)webState {
+  web::NavigationItem* navItem =
+      webState->GetNavigationManager()->GetVisibleItem();
+  const GURL& URL = navItem->GetURL();
+  web::SSLStatus& status = navItem->GetSSL();
+  bool offlinePage =
+      OfflinePageTabHelper::FromWebState(webState)->presenting_offline_page();
+
   PageInfoSiteSecurityDescription* dataHolder =
       [[PageInfoSiteSecurityDescription alloc] init];
 
   if (offlinePage) {
     dataHolder.siteURL =
-        base::FeatureList::IsEnabled(kPageInfoRefactoring)
-            ? l10n_util::GetNSString(IDS_IOS_PAGE_INFO_OFFLINE_PAGE_LABEL)
-            : l10n_util::GetNSString(IDS_IOS_PAGE_INFO_OFFLINE_TITLE);
+        l10n_util::GetNSString(IDS_IOS_PAGE_INFO_OFFLINE_PAGE_LABEL);
+
     dataHolder.message = l10n_util::GetNSString(IDS_IOS_PAGE_INFO_OFFLINE_PAGE);
-    dataHolder.legacyImage = [UIImage imageNamed:@"page_info_offline"];
-    dataHolder.buttonAction = PageInfoSiteSecurityButtonActionReload;
     dataHolder.isEmpty = YES;
     return dataHolder;
   }
 
   if (URL.SchemeIs(kChromeUIScheme)) {
     dataHolder.siteURL =
-        base::FeatureList::IsEnabled(kPageInfoRefactoring)
-            ? l10n_util::GetNSString(IDS_IOS_PAGE_INFO_CHROME_PAGE_LABEL)
-            : base::SysUTF8ToNSString(URL.spec());
+        l10n_util::GetNSString(IDS_IOS_PAGE_INFO_CHROME_PAGE_LABEL);
     dataHolder.message = l10n_util::GetNSString(IDS_PAGE_INFO_INTERNAL_PAGE);
-    dataHolder.legacyImage = nil;
-    dataHolder.buttonAction = PageInfoSiteSecurityButtonActionNone;
     dataHolder.isEmpty = YES;
     return dataHolder;
   }
@@ -104,7 +106,6 @@
   dataHolder.isEmpty = NO;
   dataHolder.status =
       l10n_util::GetNSString(IDS_IOS_PAGE_INFO_SECURITY_STATUS_NOT_SECURE);
-  dataHolder.buttonAction = PageInfoSiteSecurityButtonActionShowHelp;
 
   // Summary and details.
   if (!status.certificate) {
@@ -112,25 +113,17 @@
     // triangle icon in page info based on the same logic used to determine
     // the iconography in the omnibox.
     if (security_state::ShouldShowDangerTriangleForWarningLevel()) {
-      dataHolder.legacyImage = [UIImage imageNamed:@"page_info_bad"];
       dataHolder.iconImageName = kSecurityIconDangerous;
     } else {
-      dataHolder.legacyImage = [UIImage imageNamed:@"page_info_info"];
       dataHolder.iconImageName = kSecurityIconNotSecure;
     }
 
-    if (base::FeatureList::IsEnabled(kPageInfoRefactoring)) {
-      dataHolder.message =
-          [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
-                                     l10n_util::GetNSString(
-                                         IDS_PAGE_INFO_NOT_SECURE_DETAILS),
-                                     l10n_util::GetNSString(IDS_LEARN_MORE)];
-    } else {
-      dataHolder.message = BuildMessage(@[
-        l10n_util::GetNSString(IDS_PAGE_INFO_NOT_SECURE_SUMMARY),
-        l10n_util::GetNSString(IDS_PAGE_INFO_NOT_SECURE_DETAILS)
-      ]);
-    }
+    dataHolder.message =
+        [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
+                                   l10n_util::GetNSString(
+                                       IDS_PAGE_INFO_NOT_SECURE_DETAILS),
+                                   l10n_util::GetNSString(IDS_LEARN_MORE)];
+
     return dataHolder;
   }
 
@@ -142,26 +135,17 @@
   if (net::IsCertStatusError(status.cert_status) ||
       status.security_style == web::SECURITY_STYLE_AUTHENTICATION_BROKEN) {
     // HTTPS with major errors
-    dataHolder.legacyImage = [UIImage imageNamed:@"page_info_bad"];
     dataHolder.iconImageName = kSecurityIconDangerous;
 
     NSString* certificateDetails = BuildCertificateDetailString(status, URL);
 
-    if (base::FeatureList::IsEnabled(kPageInfoRefactoring)) {
-      dataHolder.message = BuildMessage(@[
-        [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
-                                   l10n_util::GetNSString(
-                                       IDS_PAGE_INFO_NOT_SECURE_DETAILS),
-                                   l10n_util::GetNSString(IDS_LEARN_MORE)],
-        certificateDetails
-      ]);
-    } else {
-      dataHolder.message = BuildMessage(@[
-        l10n_util::GetNSString(IDS_PAGE_INFO_NOT_SECURE_SUMMARY),
-        l10n_util::GetNSString(IDS_PAGE_INFO_NOT_SECURE_DETAILS),
-        certificateDetails
-      ]);
-    }
+    dataHolder.message = BuildMessage(@[
+      [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
+                                 l10n_util::GetNSString(
+                                     IDS_PAGE_INFO_NOT_SECURE_DETAILS),
+                                 l10n_util::GetNSString(IDS_LEARN_MORE)],
+      certificateDetails
+    ]);
 
     return dataHolder;
   }
@@ -185,27 +169,18 @@
     // a grey triangle. This will result in an inconsistency between the omnibox
     // and page info if the mixed content WARNING feature is disabled.
     if (security_state::ShouldShowDangerTriangleForWarningLevel()) {
-      dataHolder.legacyImage = [UIImage imageNamed:@"page_info_bad"];
       dataHolder.iconImageName = kSecurityIconDangerous;
     } else {
-      dataHolder.legacyImage = [UIImage imageNamed:@"page_info_info"];
       dataHolder.iconImageName = kSecurityIconNotSecure;
     }
-    if (base::FeatureList::IsEnabled(kPageInfoRefactoring)) {
-      dataHolder.message = BuildMessage(@[
-        [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
-                                   l10n_util::GetNSString(
-                                       IDS_PAGE_INFO_MIXED_CONTENT_DETAILS),
-                                   l10n_util::GetNSString(IDS_LEARN_MORE)],
-        certificateDetails
-      ]);
-    } else {
-      dataHolder.message = BuildMessage(@[
-        l10n_util::GetNSString(IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY),
-        l10n_util::GetNSString(IDS_PAGE_INFO_MIXED_CONTENT_DETAILS),
-        certificateDetails
-      ]);
-    }
+
+    dataHolder.message = BuildMessage(@[
+      [NSString stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
+                                 l10n_util::GetNSString(
+                                     IDS_PAGE_INFO_MIXED_CONTENT_DETAILS),
+                                 l10n_util::GetNSString(IDS_LEARN_MORE)],
+      certificateDetails
+    ]);
 
     return dataHolder;
   }
@@ -213,22 +188,15 @@
   // Valid HTTPS
   dataHolder.status =
       l10n_util::GetNSString(IDS_IOS_PAGE_INFO_SECURITY_STATUS_SECURE);
-  dataHolder.legacyImage = [UIImage imageNamed:@"page_info_good"];
   dataHolder.iconImageName = kSecurityIconSecure;
-  if (base::FeatureList::IsEnabled(kPageInfoRefactoring)) {
-    dataHolder.message = BuildMessage(@[
-      [NSString
-          stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
-                           l10n_util::GetNSString(IDS_PAGE_INFO_SECURE_DETAILS),
-                           l10n_util::GetNSString(IDS_LEARN_MORE)],
-      certificateDetails
-    ]);
-  } else {
-    dataHolder.message = BuildMessage(@[
-      l10n_util::GetNSString(IDS_PAGE_INFO_SECURE_SUMMARY),
-      l10n_util::GetNSString(IDS_PAGE_INFO_SECURE_DETAILS), certificateDetails
-    ]);
-  }
+
+  dataHolder.message = BuildMessage(@[
+    [NSString
+        stringWithFormat:@"%@ BEGIN_LINK %@ END_LINK",
+                         l10n_util::GetNSString(IDS_PAGE_INFO_SECURE_DETAILS),
+                         l10n_util::GetNSString(IDS_LEARN_MORE)],
+    certificateDetails
+  ]);
 
   DCHECK(!(status.cert_status & net::CERT_STATUS_IS_EV))
       << "Extended Validation should be disabled";
diff --git a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
index 09edd59..43685874 100644
--- a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
+++ b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
@@ -7,7 +7,6 @@
 #include "base/mac/foundation_util.h"
 #include "ios/chrome/browser/chrome_url_constants.h"
 #include "ios/chrome/browser/ui/commands/browser_commands.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/page_info/page_info_constants.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
diff --git a/ios/chrome/browser/ui/popup_menu/BUILD.gn b/ios/chrome/browser/ui/popup_menu/BUILD.gn
index 078f84c2..f11b1f1 100644
--- a/ios/chrome/browser/ui/popup_menu/BUILD.gn
+++ b/ios/chrome/browser/ui/popup_menu/BUILD.gn
@@ -73,7 +73,6 @@
     "//ios/chrome/browser/ui/coordinators:chrome_coordinators",
     "//ios/chrome/browser/ui/list_model",
     "//ios/chrome/browser/ui/ntp_tile_views:constants",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/popup_menu/cells",
     "//ios/chrome/browser/ui/popup_menu/public",
     "//ios/chrome/browser/ui/popup_menu/public:popup_menu_ui",
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_action_handler.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_action_handler.mm
index ee12939c..8362b6f 100644
--- a/ios/chrome/browser/ui/popup_menu/popup_menu_action_handler.mm
+++ b/ios/chrome/browser/ui/popup_menu/popup_menu_action_handler.mm
@@ -19,7 +19,6 @@
 #import "ios/chrome/browser/ui/commands/load_query_commands.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
 #import "ios/chrome/browser/ui/commands/text_zoom_commands.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/popup_menu/popup_menu_action_handler_commands.h"
 #import "ios/chrome/browser/ui/popup_menu/public/cells/popup_menu_item.h"
 #import "ios/chrome/browser/ui/popup_menu/public/popup_menu_table_view_controller.h"
@@ -99,13 +98,7 @@
       break;
     case PopupMenuActionSiteInformation:
       RecordAction(UserMetricsAction("MobileMenuSiteInformation"));
-      if (base::FeatureList::IsEnabled(kPageInfoRefactoring)) {
-        [self.dispatcher showPageInfo];
-      } else {
-        [self.dispatcher
-            legacyShowPageInfoForOriginPoint:self.baseViewController.view
-                                                 .center];
-      }
+      [self.dispatcher showPageInfo];
       break;
     case PopupMenuActionReportIssue:
       RecordAction(UserMetricsAction("MobileMenuReportAnIssue"));
diff --git a/ios/chrome/browser/ui/reading_list/BUILD.gn b/ios/chrome/browser/ui/reading_list/BUILD.gn
index e49fc780..72d63555 100644
--- a/ios/chrome/browser/ui/reading_list/BUILD.gn
+++ b/ios/chrome/browser/ui/reading_list/BUILD.gn
@@ -187,7 +187,6 @@
     "//base",
     "//base/test:test_support",
     "//ios/chrome/app/strings:ios_strings_grit",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/popup_menu:constants",
     "//ios/chrome/browser/ui/table_view:constants",
     "//ios/chrome/browser/ui/util",
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
index e7735a1..2960bb7 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
@@ -15,7 +15,6 @@
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #import "base/test/ios/wait_util.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h"
 #import "ios/chrome/browser/ui/reading_list/reading_list_app_interface.h"
 #import "ios/chrome/browser/ui/reading_list/reading_list_constants.h"
@@ -434,7 +433,6 @@
 
 - (AppLaunchConfiguration)appConfigurationForTestCase {
   AppLaunchConfiguration config;
-  config.features_enabled.push_back(kPageInfoRefactoring);
 
   // Error page Workflow Feature is enabled by test name. This is done because
   // it is inefficient to use ensureAppLaunchedWithConfiguration for each test.
diff --git a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
index 134ff0a..1c46529 100644
--- a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
@@ -60,10 +60,7 @@
 #pragma mark - Public
 
 - (instancetype)init {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_IOS_ABOUT_PRODUCT_NAME);
   }
diff --git a/ios/chrome/browser/ui/settings/autofill/BUILD.gn b/ios/chrome/browser/ui/settings/autofill/BUILD.gn
index d36448a..137a5c12 100644
--- a/ios/chrome/browser/ui/settings/autofill/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/autofill/BUILD.gn
@@ -51,6 +51,7 @@
     "//ios/chrome/browser/ui/settings/autofill/cells",
     "//ios/chrome/browser/ui/settings/cells",
     "//ios/chrome/browser/ui/settings/elements:enterprise_info_popover_view_controller",
+    "//ios/chrome/browser/ui/settings/utils",
     "//ios/chrome/browser/ui/table_view",
     "//ios/chrome/browser/ui/table_view/cells",
     "//ios/chrome/browser/ui/table_view/cells:cells_constants",
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
index 76176897..d1d721b 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
@@ -10,6 +10,7 @@
 #include "components/autofill/core/common/autofill_payments_features.h"
 #import "ios/chrome/browser/ui/autofill/cells/autofill_edit_item.h"
 #import "ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller_delegate.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_edit_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_edit_item_delegate.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
@@ -75,10 +76,7 @@
 
 - (instancetype)initWithDelegate:
     (id<AddCreditCardViewControllerDelegate>)delegate {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
 
   if (self) {
     _delegate = delegate;
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
index fb15d0c..2571b088 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
@@ -25,6 +25,7 @@
 #import "ios/chrome/browser/ui/settings/autofill/autofill_constants.h"
 #import "ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller+protected.h"
 #import "ios/chrome/browser/ui/settings/cells/copied_to_chrome_item.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_edit_item_delegate.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
@@ -69,10 +70,7 @@
 
 - (instancetype)initWithCreditCard:(const autofill::CreditCard&)creditCard
                personalDataManager:(autofill::PersonalDataManager*)dataManager {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     DCHECK(dataManager);
 
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
index 4881359..588fe77 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
@@ -25,6 +25,7 @@
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #include "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_cell.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_item.h"
@@ -94,10 +95,8 @@
 
 - (instancetype)initWithBrowser:(Browser*)browser {
   DCHECK(browser);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_AUTOFILL_PAYMENT_METHODS);
     self.shouldHideDoneButton = YES;
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_profile_edit_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_profile_edit_table_view_controller.mm
index 86b4f89..e50b44d 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_profile_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_profile_edit_table_view_controller.mm
@@ -19,6 +19,7 @@
 #include "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
 #import "ios/chrome/browser/ui/settings/autofill/autofill_constants.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/table_view_model.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #include "ios/chrome/grit/ios_strings.h"
@@ -95,10 +96,7 @@
             personalDataManager:(autofill::PersonalDataManager*)dataManager {
   DCHECK(dataManager);
 
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _personalDataManager = dataManager;
     _autofillProfile = profile;
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
index 802dd0ae..c004b1b 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
@@ -23,6 +23,7 @@
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_cell.h"
@@ -85,10 +86,8 @@
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
   DCHECK(browserState);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_AUTOFILL_ADDRESSES_SETTINGS_TITLE);
     self.shouldHideDoneButton = YES;
diff --git a/ios/chrome/browser/ui/settings/bandwidth_management_table_view_controller.mm b/ios/chrome/browser/ui/settings/bandwidth_management_table_view_controller.mm
index 42963375..e11a44e 100644
--- a/ios/chrome/browser/ui/settings/bandwidth_management_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/bandwidth_management_table_view_controller.mm
@@ -62,10 +62,7 @@
 @implementation BandwidthManagementTableViewController
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_IOS_BANDWIDTH_MANAGEMENT_SETTINGS);
     _browserState = browserState;
diff --git a/ios/chrome/browser/ui/settings/block_popups_table_view_controller.mm b/ios/chrome/browser/ui/settings/block_popups_table_view_controller.mm
index 706e786..ecb32c9a 100644
--- a/ios/chrome/browser/ui/settings/block_popups_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/block_popups_table_view_controller.mm
@@ -21,6 +21,7 @@
 #import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
 #import "ios/chrome/browser/ui/settings/utils/content_setting_backed_boolean.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_cell.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_item.h"
@@ -79,10 +80,8 @@
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
   DCHECK(browserState);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browserState = browserState;
     HostContentSettingsMap* settingsMap =
diff --git a/ios/chrome/browser/ui/settings/content_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings_table_view_controller.mm
index dbc35b0..e923ca3 100644
--- a/ios/chrome/browser/ui/settings/content_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/content_settings_table_view_controller.mm
@@ -18,6 +18,7 @@
 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
 #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h"
 #import "ios/chrome/browser/ui/settings/utils/content_setting_backed_boolean.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_multi_detail_text_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
@@ -73,10 +74,8 @@
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
   DCHECK(browserState);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browserState = browserState;
     self.title = l10n_util::GetNSString(IDS_IOS_CONTENT_SETTINGS_TITLE);
diff --git a/ios/chrome/browser/ui/settings/dataplan_usage_table_view_controller.mm b/ios/chrome/browser/ui/settings/dataplan_usage_table_view_controller.mm
index 7c4bfdb6..f449856 100644
--- a/ios/chrome/browser/ui/settings/dataplan_usage_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/dataplan_usage_table_view_controller.mm
@@ -9,6 +9,7 @@
 #include "components/prefs/pref_member.h"
 #include "components/prefs/pref_service.h"
 #import "ios/chrome/browser/prerender/prerender_pref.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
 #import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
@@ -82,10 +83,7 @@
 - (instancetype)initWithPrefs:(PrefService*)prefs
                   settingPref:(const char*)settingPreference
                         title:(NSString*)title {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = title;
     _settingPreference.Init(settingPreference, prefs);
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
index 596f4e8..1e219e0 100644
--- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
@@ -32,6 +32,7 @@
 #import "ios/chrome/browser/ui/icons/chrome_icon.h"
 #import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h"
 #import "ios/chrome/browser/ui/settings/sync/utils/sync_util.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_header_footer_item.h"
@@ -127,10 +128,8 @@
       closeSettingsOnAddAccount:(BOOL)closeSettingsOnAddAccount {
   DCHECK(browser);
   DCHECK(!browser->GetBrowserState()->IsOffTheRecord());
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     _closeSettingsOnAddAccount = closeSettingsOnAddAccount;
diff --git a/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm b/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
index 94adc12..2930ceb 100644
--- a/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
@@ -30,6 +30,7 @@
 #import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_coordinator.h"
 #import "ios/chrome/browser/ui/settings/google_services/sync_error_settings_command_handler.h"
 #import "ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
 
@@ -93,12 +94,9 @@
 
 - (void)start {
   self.authService->WaitUntilCacheIsPopulated();
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-
   GoogleServicesSettingsViewController* viewController =
-      [[GoogleServicesSettingsViewController alloc] initWithStyle:style];
+      [[GoogleServicesSettingsViewController alloc]
+          initWithStyle:SettingsTableViewStyle()];
   viewController.presentationDelegate = self;
   self.viewController = viewController;
   SyncSetupService* syncSetupService =
diff --git a/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm b/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
index 8cf8818..cedab48 100644
--- a/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
@@ -8,6 +8,7 @@
 #import "base/mac/foundation_util.h"
 #include "base/strings/sys_string_conversions.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_multiline_detail_item.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
 #import "ios/chrome/browser/ui/table_view/table_view_model.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
@@ -59,10 +60,8 @@
                       isSignedIn:(BOOL)isSignedIn {
   DCHECK(fromEmail);
   DCHECK(toEmail);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _delegate = delegate;
     _fromEmail = [fromEmail copy];
diff --git a/ios/chrome/browser/ui/settings/language/BUILD.gn b/ios/chrome/browser/ui/settings/language/BUILD.gn
index a6087b2..7dbe345 100644
--- a/ios/chrome/browser/ui/settings/language/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/language/BUILD.gn
@@ -54,6 +54,7 @@
     "//ios/chrome/browser/ui/settings/cells:public",
     "//ios/chrome/browser/ui/settings/elements:enterprise_info_popover_view_controller",
     "//ios/chrome/browser/ui/settings/language/cells",
+    "//ios/chrome/browser/ui/settings/utils",
     "//ios/chrome/browser/ui/table_view",
     "//ios/chrome/browser/ui/table_view/cells",
     "//ios/chrome/browser/ui/table_view/cells",
diff --git a/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm b/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
index a6dc40369..af52fd2 100644
--- a/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
@@ -11,6 +11,7 @@
 #import "ios/chrome/browser/ui/settings/language/language_settings_data_source.h"
 #import "ios/chrome/browser/ui/settings/language/language_settings_histograms.h"
 #import "ios/chrome/browser/ui/settings/language/language_settings_ui_constants.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller_constants.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
@@ -64,10 +65,8 @@
                                        delegate {
   DCHECK(dataSource);
   DCHECK(delegate);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _dataSource = dataSource;
     _delegate = delegate;
diff --git a/ios/chrome/browser/ui/settings/language/language_details_table_view_controller.mm b/ios/chrome/browser/ui/settings/language/language_details_table_view_controller.mm
index 17410f2..3ef38de 100644
--- a/ios/chrome/browser/ui/settings/language/language_details_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/language/language_details_table_view_controller.mm
@@ -11,6 +11,7 @@
 #import "ios/chrome/browser/ui/settings/language/language_settings_data_source.h"
 #import "ios/chrome/browser/ui/settings/language/language_settings_histograms.h"
 #import "ios/chrome/browser/ui/settings/language/language_settings_ui_constants.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
@@ -55,10 +56,8 @@
                                     delegate {
   DCHECK(languageItem);
   DCHECK(delegate);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _languageItem = languageItem;
     _delegate = delegate;
diff --git a/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
index cfeedd07..d3ca5a4 100644
--- a/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
@@ -26,6 +26,7 @@
 #import "ios/chrome/browser/ui/settings/language/language_settings_histograms.h"
 #import "ios/chrome/browser/ui/settings/language/language_settings_ui_constants.h"
 #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_cell.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_info_button_item.h"
@@ -93,10 +94,8 @@
                         (id<LanguageSettingsCommands>)commandHandler {
   DCHECK(dataSource);
   DCHECK(commandHandler);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _dataSource = dataSource;
     _commandHandler = commandHandler;
diff --git a/ios/chrome/browser/ui/settings/password/BUILD.gn b/ios/chrome/browser/ui/settings/password/BUILD.gn
index 164b096..c80b2677 100644
--- a/ios/chrome/browser/ui/settings/password/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/password/BUILD.gn
@@ -32,6 +32,7 @@
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/coordinators:chrome_coordinators",
     "//ios/chrome/browser/ui/settings/password/password_details",
+    "//ios/chrome/browser/ui/settings/utils",
     "//ios/chrome/common",
     "//ios/chrome/common/ui/colors",
     "//ios/chrome/common/ui/reauthentication",
diff --git a/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn b/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn
index 589c334..be9b518 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn
@@ -25,6 +25,7 @@
     "//ios/chrome/browser/ui/alert_coordinator",
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/coordinators:chrome_coordinators",
+    "//ios/chrome/browser/ui/settings/utils",
     "//ios/chrome/browser/ui/table_view",
     "//ios/chrome/browser/ui/util",
     "//ios/chrome/common/ui/colors",
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
index d9570d6..a6cd13f1 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
@@ -21,6 +21,7 @@
 #import "ios/chrome/browser/ui/settings/password/password_details/password_details_handler.h"
 #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h"
 #import "ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/chrome/common/ui/reauthentication/reauthentication_module.h"
 #include "ios/chrome/grit/ios_strings.h"
@@ -87,12 +88,8 @@
 }
 
 - (void)start {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-
-  self.viewController =
-      [[PasswordDetailsTableViewController alloc] initWithStyle:style];
+  self.viewController = [[PasswordDetailsTableViewController alloc]
+      initWithStyle:SettingsTableViewStyle()];
 
   self.mediator = [[PasswordDetailsMediator alloc] initWithPassword:_password
                                                passwordCheckManager:_manager];
diff --git a/ios/chrome/browser/ui/settings/password/password_issues_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_issues_coordinator.mm
index 6a6ebe4..ce2d6cb 100644
--- a/ios/chrome/browser/ui/settings/password/password_issues_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/password/password_issues_coordinator.mm
@@ -15,6 +15,7 @@
 #import "ios/chrome/browser/ui/settings/password/password_issues_mediator.h"
 #import "ios/chrome/browser/ui/settings/password/password_issues_presenter.h"
 #import "ios/chrome/browser/ui/settings/password/password_issues_table_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/chrome/common/ui/reauthentication/reauthentication_module.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -65,12 +66,8 @@
   // To start, a password check manager should be ready.
   DCHECK(_manager);
 
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-
-  self.viewController =
-      [[PasswordIssuesTableViewController alloc] initWithStyle:style];
+  self.viewController = [[PasswordIssuesTableViewController alloc]
+      initWithStyle:SettingsTableViewStyle()];
 
   self.mediator =
       [[PasswordIssuesMediator alloc] initWithPasswordCheckManager:_manager];
diff --git a/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm b/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm
index 56eac49..97d0791 100644
--- a/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/passwords_table_view_controller.mm
@@ -246,10 +246,8 @@
 
 - (instancetype)initWithBrowser:(Browser*)browser {
   DCHECK(browser);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     _browserState = browser->GetBrowserState();
diff --git a/ios/chrome/browser/ui/settings/privacy/BUILD.gn b/ios/chrome/browser/ui/settings/privacy/BUILD.gn
index 10e7fda8..9b378b0f 100644
--- a/ios/chrome/browser/ui/settings/privacy/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/privacy/BUILD.gn
@@ -28,7 +28,6 @@
     "//ios/chrome/browser/ui/colors",
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/list_model",
-    "//ios/chrome/browser/ui/page_info:features",
     "//ios/chrome/browser/ui/settings:constants",
     "//ios/chrome/browser/ui/settings:settings_root",
     "//ios/chrome/browser/ui/settings/cells",
diff --git a/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
index 8fa517d..0e5f1f34 100644
--- a/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
@@ -11,6 +11,7 @@
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #include "ios/chrome/grit/ios_strings.h"
@@ -49,10 +50,8 @@
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
   DCHECK(browserState);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_IOS_OPTIONS_CONTINUITY_LABEL);
     _handoffEnabled = [[PrefBackedBoolean alloc]
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
index d4d36261..ef501b7 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
@@ -20,13 +20,13 @@
 #import "ios/chrome/browser/main/browser.h"
 #include "ios/chrome/browser/pref_names.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
-#import "ios/chrome/browser/ui/page_info/features.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/settings/privacy/privacy_navigation_commands.h"
 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
 #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h"
 #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
@@ -99,10 +99,8 @@
 - (instancetype)initWithBrowser:(Browser*)browser
          reauthenticationModule:(id<ReauthenticationProtocol>)reauthModule {
   DCHECK(browser);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     _reauthModule = reauthModule;
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
index 11065016..cceeff5 100644
--- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
@@ -19,6 +19,7 @@
 #import "ios/chrome/browser/search_engines/search_engine_observer_bridge.h"
 #include "ios/chrome/browser/search_engines/template_url_service_factory.h"
 #import "ios/chrome/browser/ui/settings/cells/search_engine_item.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_header_footer_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
@@ -81,10 +82,8 @@
 
 - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
   DCHECK(browserState);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _templateURLService =
         ios::TemplateURLServiceFactory::GetForBrowserState(browserState);
diff --git a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
index 36252e7..aa79295 100644
--- a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
@@ -291,11 +291,11 @@
   self.view.backgroundColor = UIColor.cr_systemBackgroundColor;
 
   if (base::FeatureList::IsEnabled(kSettingsRefresh)) {
+    self.view.backgroundColor = UIColor.cr_systemGroupedBackgroundColor;
     self.navigationBar.translucent = NO;
-    self.navigationBar.barTintColor = UIColor.cr_systemBackgroundColor;
-
+    self.navigationBar.barTintColor = UIColor.cr_systemGroupedBackgroundColor;
     self.toolbar.translucent = NO;
-    self.toolbar.barTintColor = UIColor.cr_systemBackgroundColor;
+    self.toolbar.barTintColor = UIColor.cr_systemGroupedBackgroundColor;
   }
 
   self.navigationBar.prefersLargeTitles = YES;
diff --git a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
index 111f633..1e20155 100644
--- a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
@@ -110,12 +110,8 @@
                            action:nil];
   [self setToolbarItems:@[ flexibleSpace, self.deleteButton, flexibleSpace ]
                animated:YES];
-  if (base::FeatureList::IsEnabled(kSettingsRefresh)) {
-    self.styler.tableViewBackgroundColor = UIColor.cr_systemBackgroundColor;
-  } else {
     self.styler.tableViewBackgroundColor =
         UIColor.cr_systemGroupedBackgroundColor;
-  }
   [super viewDidLoad];
   if (base::FeatureList::IsEnabled(kSettingsRefresh)) {
     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
index a165d1b..8846ab1 100644
--- a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
@@ -77,6 +77,7 @@
 #import "ios/chrome/browser/ui/settings/sync/utils/sync_util.h"
 #import "ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.h"
 #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/settings/voice_search_table_view_controller.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #include "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
@@ -285,10 +286,8 @@
                  dispatcher {
   DCHECK(browser);
   DCHECK(!browser->GetBrowserState()->IsOffTheRecord());
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     _browserState = _browser->GetBrowserState();
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
index aca101d..1ffc7cc 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
@@ -86,10 +86,8 @@
 
 - (instancetype)initWithBrowser:(Browser*)browser {
   DCHECK(browser);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     ChromeBrowserState* browserState = self.browser->GetBrowserState();
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
index 22c45ddf..cb07fca 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
@@ -68,10 +68,8 @@
 
 - (instancetype)initWithBrowser:(Browser*)browser {
   DCHECK(browser);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _browser = browser;
     ChromeBrowserState* browserState = self.browser->GetBrowserState();
diff --git a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
index 5a05f54e..17d87ca 100644
--- a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
@@ -18,6 +18,7 @@
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h"
 #import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_image_item.h"
@@ -92,10 +93,7 @@
 @implementation TableCellCatalogViewController
 
 - (instancetype)init {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  return [super initWithStyle:style];
+  return [super initWithStyle:SettingsTableViewStyle()];
 }
 
 - (void)viewDidLoad {
diff --git a/ios/chrome/browser/ui/settings/translate_table_view_controller.mm b/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
index 76ad9e1..92c095c 100644
--- a/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
@@ -72,10 +72,8 @@
 
 - (instancetype)initWithPrefs:(PrefService*)prefs {
   DCHECK(prefs);
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     _prefs = prefs;
     _translationEnabled = [[PrefBackedBoolean alloc]
diff --git a/ios/chrome/browser/ui/settings/utils/BUILD.gn b/ios/chrome/browser/ui/settings/utils/BUILD.gn
index 6aaf2f1..9999f66 100644
--- a/ios/chrome/browser/ui/settings/utils/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/utils/BUILD.gn
@@ -19,7 +19,9 @@
     "//components/content_settings/core/common",
     "//components/prefs",
     "//ios/chrome/browser",
+    "//ios/chrome/browser/ui:feature_flags",
     "//ios/chrome/browser/ui/commands",
+    "//ios/chrome/browser/ui/util",
   ]
 }
 
diff --git a/ios/chrome/browser/ui/settings/utils/settings_utils.h b/ios/chrome/browser/ui/settings/utils/settings_utils.h
index a3d41bf..29a9964 100644
--- a/ios/chrome/browser/ui/settings/utils/settings_utils.h
+++ b/ios/chrome/browser/ui/settings/utils/settings_utils.h
@@ -16,4 +16,8 @@
 ProceduralBlockWithURL BlockToOpenURL(UIResponder* responder,
                                       id<ApplicationCommands> handler);
 
+// Returns an UITableViewStyle according to the state of the kSettingsRefresh
+// flag and the width of the current device.
+UITableViewStyle SettingsTableViewStyle();
+
 #endif  // IOS_CHROME_BROWSER_UI_SETTINGS_UTILS_SETTINGS_UTILS_H_
diff --git a/ios/chrome/browser/ui/settings/utils/settings_utils.mm b/ios/chrome/browser/ui/settings/utils/settings_utils.mm
index cf906cec..d851cb8c 100644
--- a/ios/chrome/browser/ui/settings/utils/settings_utils.mm
+++ b/ios/chrome/browser/ui/settings/utils/settings_utils.mm
@@ -6,6 +6,8 @@
 
 #import "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
+#include "ios/chrome/browser/ui/ui_feature_flags.h"
+#import "ios/chrome/browser/ui/util/ui_util.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
 #error "This file requires ARC support."
@@ -25,3 +27,11 @@
   };
   return [blockToOpenURL copy];
 }
+
+UITableViewStyle SettingsTableViewStyle() {
+  if (@available(iOS 13, *)) {
+    if (base::FeatureList::IsEnabled(kSettingsRefresh) && !IsSmallDevice())
+      return UITableViewStyleInsetGrouped;
+  }
+  return UITableViewStyleGrouped;
+}
diff --git a/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm b/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
index e8d311d..459af60 100644
--- a/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
@@ -13,6 +13,7 @@
 #include "components/prefs/pref_service.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
 #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
+#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #include "ios/chrome/browser/ui/ui_feature_flags.h"
 #include "ios/chrome/browser/voice/speech_input_locale_config.h"
@@ -54,10 +55,7 @@
 @implementation VoiceSearchTableViewController
 
 - (instancetype)initWithPrefs:(PrefService*)prefs {
-  UITableViewStyle style = base::FeatureList::IsEnabled(kSettingsRefresh)
-                               ? UITableViewStylePlain
-                               : UITableViewStyleGrouped;
-  self = [super initWithStyle:style];
+  self = [super initWithStyle:SettingsTableViewStyle()];
   if (self) {
     self.title = l10n_util::GetNSString(IDS_IOS_VOICE_SEARCH_SETTING_TITLE);
     _prefs = prefs;
diff --git a/ios/chrome/browser/ui/ui_feature_flags.cc b/ios/chrome/browser/ui/ui_feature_flags.cc
index 7a61dc8..bc53bb0 100644
--- a/ios/chrome/browser/ui/ui_feature_flags.cc
+++ b/ios/chrome/browser/ui/ui_feature_flags.cc
@@ -31,6 +31,9 @@
 const base::Feature kTestFeature{"TestFeature",
                                  base::FEATURE_DISABLED_BY_DEFAULT};
 
+const base::Feature kFirstResponderSendAction{
+    "FirstResponderSendAction", base::FEATURE_DISABLED_BY_DEFAULT};
+
 const base::Feature kEnableNativeContextMenus{
     "EnableNativeContextMenus", base::FEATURE_DISABLED_BY_DEFAULT};
 
diff --git a/ios/chrome/browser/ui/ui_feature_flags.h b/ios/chrome/browser/ui/ui_feature_flags.h
index 2b66b0d0..2d68e0e 100644
--- a/ios/chrome/browser/ui/ui_feature_flags.h
+++ b/ios/chrome/browser/ui/ui_feature_flags.h
@@ -34,6 +34,9 @@
 // features in tests works.
 extern const base::Feature kTestFeature;
 
+// Verify if the crash in https://crbug.com/816427 is fixed on iOS 12.
+extern const base::Feature kFirstResponderSendAction;
+
 // Feature flag that enables the native UI Context Menus (not for Web content).
 extern const base::Feature kEnableNativeContextMenus;
 
diff --git a/ios/chrome/browser/ui/util/ui_util.h b/ios/chrome/browser/ui/util/ui_util.h
index 1ff80e8..38e5ae8 100644
--- a/ios/chrome/browser/ui/util/ui_util.h
+++ b/ios/chrome/browser/ui/util/ui_util.h
@@ -26,6 +26,11 @@
 // Returns true if the device is an iPhone X.
 bool IsIPhoneX();
 
+// Returns true if the device is considered as a small device.
+// TODO(crbug.com/1152730): Define what is called a small device & update this
+// method.
+bool IsSmallDevice();
+
 // Returns the approximate corner radius of the current device.
 CGFloat DeviceCornerRadius();
 
diff --git a/ios/chrome/browser/ui/util/ui_util.mm b/ios/chrome/browser/ui/util/ui_util.mm
index 1b7b188..213ed21 100644
--- a/ios/chrome/browser/ui/util/ui_util.mm
+++ b/ios/chrome/browser/ui/util/ui_util.mm
@@ -38,6 +38,10 @@
           (height == 2436 || height == 2688 || height == 1792));
 }
 
+bool IsSmallDevice() {
+  return CurrentScreenWidth() <= 375;
+}
+
 CGFloat DeviceCornerRadius() {
   return IsIPhoneX() ? 40.0 : 0.0;
 }
diff --git a/ios/chrome/browser/ui/util/uikit_ui_util.h b/ios/chrome/browser/ui/util/uikit_ui_util.h
index 3b43cce..efd9985c 100644
--- a/ios/chrome/browser/ui/util/uikit_ui_util.h
+++ b/ios/chrome/browser/ui/util/uikit_ui_util.h
@@ -181,7 +181,7 @@
 // bottom toolbar or if it is displayed as only one toolbar.
 bool IsSplitToolbarMode(UITraitCollection* traitCollection);
 
-// Returns the current first responder.
+// Returns the current first responder for keyWindow.
 UIResponder* GetFirstResponder();
 
 // Trigger a haptic vibration for various types of actions. This is a no-op for
diff --git a/ios/chrome/browser/ui/util/uikit_ui_util.mm b/ios/chrome/browser/ui/util/uikit_ui_util.mm
index 0745fef91..aea31e12 100644
--- a/ios/chrome/browser/ui/util/uikit_ui_util.mm
+++ b/ios/chrome/browser/ui/util/uikit_ui_util.mm
@@ -315,15 +315,19 @@
 
 UIResponder* GetFirstResponder() {
   DCHECK_CURRENTLY_ON(web::WebThread::UI);
-  DCHECK(!g_first_responder);
-  [[UIApplication sharedApplication]
-      sendAction:@selector(cr_markSelfCurrentFirstResponder)
-              to:nil
-            from:nil
-        forEvent:nil];
-  UIResponder* firstResponder = g_first_responder;
-  g_first_responder = nil;
-  return firstResponder;
+  if (base::FeatureList::IsEnabled(kFirstResponderSendAction)) {
+    DCHECK_CURRENTLY_ON(web::WebThread::UI);
+    DCHECK(!g_first_responder);
+    [[UIApplication sharedApplication]
+        sendAction:@selector(cr_markSelfCurrentFirstResponder)
+                to:nil
+              from:nil
+          forEvent:nil];
+    UIResponder* firstResponder = g_first_responder;
+    g_first_responder = nil;
+    return firstResponder;
+  }
+  return GetFirstResponderSubview([UIApplication sharedApplication].keyWindow);
 }
 
 // Trigger a haptic vibration for the user selecting an action. This is a no-op
diff --git a/ios/chrome/test/earl_grey2/BUILD.gn b/ios/chrome/test/earl_grey2/BUILD.gn
index 91343c1..43c8196 100644
--- a/ios/chrome/test/earl_grey2/BUILD.gn
+++ b/ios/chrome/test/earl_grey2/BUILD.gn
@@ -158,7 +158,6 @@
     "//ios/chrome/browser/ui/omnibox:eg2_tests",
     "//ios/chrome/browser/ui/omnibox/popup:eg2_tests",
     "//ios/chrome/browser/ui/open_in:eg2_tests",
-    "//ios/chrome/browser/ui/page_info:eg2_tests",
     "//ios/chrome/browser/ui/passwords:eg2_tests",
     "//ios/chrome/browser/ui/popup_menu:eg2_tests",
     "//ios/chrome/browser/ui/qr_scanner:eg2_tests",
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1
index 8e80c8a8..97ac3004 100644
--- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1
+++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@
-fef4e744106d685338b21081095dc3a82bb5bec2
\ No newline at end of file
+45660fb611b75619ba3da46a03cea8cd921110f8
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1
index 14603a6e..2305265 100644
--- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1
+++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@
-e4cf1ddb027a9f71a688ee4bd57c0e84ae589841
\ No newline at end of file
+b9e4ac9fa32d5b135bb526c87328f76bbb5def4b
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1
index caf27f8..4046a13 100644
--- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1
+++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@
-b9404c6de81585b24625b55dc5b278ea4d59292f
\ No newline at end of file
+3afd7c904a0b8b561c5d64d6ea6c6d490d968f2e
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1
index 1659b1b9..8f85947 100644
--- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1
+++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@
-1084adddcc5ae44f0eea37397cbdab3d4ea91121
\ No newline at end of file
+d06b0e907f13e7944a898697a6aa1275c0db5052
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1
index 43465b9..be268e3 100644
--- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1
+++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@
-5dc2ea35fba12ab068ccc05c69dce2377e1065b7
\ No newline at end of file
+7cd914aba3753dbc6368f6caca97667a5fdd7bc4
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1
index 36337e81..fe6d9bc6 100644
--- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1
+++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@
-3e9f556c3a8b4b07688661dde402748feb692060
\ No newline at end of file
+d4bbc609cbf5f0a90b9df32b8c52640d87bece0a
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1
index fe2bda2..0da22a13 100644
--- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1
+++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@
-7223c72049f4804c971876bdab5d93beed34a842
\ No newline at end of file
+55eaf68e4e46136577bff3df7913a3beabc74fe5
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1
index 2754f98..3a184e51 100644
--- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1
+++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.arm64.zip.sha1
@@ -1 +1 @@
-f271c80ba5d329123699dd34186b4445632d5880
\ No newline at end of file
+7521c0b2abdaaefa30b51775934673adea2d216a
\ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1
index 63fd2d84..bd98b6e 100644
--- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1
+++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.x64.zip.sha1
@@ -1 +1 @@
-d7e1f48514c0cdcdaf7addacc2e315e1286cdad4
\ No newline at end of file
+27d0a8c5dcb8ecf5a203bd228a9c44ddea05ecde
\ No newline at end of file
diff --git a/ios/third_party/material_components_ios/BUILD.gn b/ios/third_party/material_components_ios/BUILD.gn
index b3bc919..968274f 100644
--- a/ios/third_party/material_components_ios/BUILD.gn
+++ b/ios/third_party/material_components_ios/BUILD.gn
@@ -508,6 +508,7 @@
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelAnimation.h",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelPosition.h",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlPlaceholderSupport.h",
+  "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlSideViewSupport.h",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlVerticalPositioningReference.h",
   "src/components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h",
   "src/components/private/TextControlsPrivate/src/Shared/UIBezierPath+MDCTextControlStyle.h",
@@ -1471,6 +1472,8 @@
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelPosition.m",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlPlaceholderSupport.h",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlPlaceholderSupport.m",
+  "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlSideViewSupport.h",
+  "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlSideViewSupport.m",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlVerticalPositioningReference.h",
   "src/components/private/TextControlsPrivate/src/Shared/MDCTextControlVerticalPositioningReference.m",
   "src/components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h",
diff --git a/ios/web/web_state/error_page_inttest.mm b/ios/web/web_state/error_page_inttest.mm
index 76d5b70..823d1a7 100644
--- a/ios/web/web_state/error_page_inttest.mm
+++ b/ios/web/web_state/error_page_inttest.mm
@@ -30,7 +30,9 @@
 #import "ios/web/public/test/web_view_content_test_util.h"
 #import "ios/web/public/web_client.h"
 #import "ios/web/public/web_state.h"
+#include "ios/web/test/test_url_constants.h"
 #import "net/base/mac/url_conversions.h"
+#include "net/base/net_errors.h"
 #include "net/test/embedded_test_server/default_handlers.h"
 #include "net/test/embedded_test_server/request_handler_util.h"
 #include "url/gurl.h"
@@ -545,4 +547,56 @@
   ASSERT_TRUE(test::WaitForWebViewContainingText(web_state(), error_text));
 }
 
+// Tests that restoring an invalid WebUI URL doesn't create a new navigation.
+TEST_F(ErrorPageTest, RestorationFromInvalidURL) {
+  server_responds_with_content_ = true;
+
+  std::string scheme = kTestWebUIScheme;
+  GURL invalid_webui = GURL(scheme + "://invalid");
+
+  NSError* error = testing::CreateErrorWithUnderlyingErrorChain(
+      {{@"NSURLErrorDomain", NSURLErrorUnsupportedURL},
+       {net::kNSErrorDomain, net::ERR_INVALID_URL}});
+
+  test::LoadUrl(web_state(), server_.GetURL("/echo-query?foo"));
+  ASSERT_TRUE(test::WaitForWebViewContainingText(web_state(), "foo"));
+  test::LoadUrl(web_state(), invalid_webui);
+  ASSERT_TRUE(test::WaitForWebViewContainingText(
+      web_state(), testing::GetErrorText(web_state(), invalid_webui, error,
+                                         /*is_post=*/false, /*is_otr=*/false,
+                                         /*cert_status=*/0)));
+
+  // Restore the session.
+  WebState::CreateParams params(GetBrowserState());
+  auto restored_web_state = WebState::CreateWithStorageSession(
+      params, web_state()->BuildSessionStorage());
+
+  restored_web_state->GetNavigationManager()->LoadIfNecessary();
+  ASSERT_TRUE(test::WaitForWebViewContainingText(
+      restored_web_state.get(),
+      testing::GetErrorText(restored_web_state.get(), invalid_webui, error,
+                            /*is_post=*/false, /*is_otr=*/false,
+                            /*cert_status=*/0)));
+
+  // Check that there is one item in the back list and no forward item.
+  EXPECT_EQ(
+      1UL,
+      restored_web_state->GetNavigationManager()->GetBackwardItems().size());
+  EXPECT_EQ(
+      0UL,
+      restored_web_state->GetNavigationManager()->GetForwardItems().size());
+
+  restored_web_state->GetNavigationManager()->GoBack();
+  ASSERT_TRUE(
+      test::WaitForWebViewContainingText(restored_web_state.get(), "foo"));
+
+  // Check that there is one item in the forward list and no back item.
+  EXPECT_EQ(
+      0UL,
+      restored_web_state->GetNavigationManager()->GetBackwardItems().size());
+  EXPECT_EQ(
+      1UL,
+      restored_web_state->GetNavigationManager()->GetForwardItems().size());
+}
+
 }  // namespace web
diff --git a/ios/web/webui/crw_web_ui_scheme_handler.mm b/ios/web/webui/crw_web_ui_scheme_handler.mm
index d211e0ac0..16cc662 100644
--- a/ios/web/webui/crw_web_ui_scheme_handler.mm
+++ b/ios/web/webui/crw_web_ui_scheme_handler.mm
@@ -52,14 +52,14 @@
   NSInteger errorCode = GetErrorCodeForUrl(
       net::GURLWithNSURL(urlSchemeTask.request.mainDocumentURL));
   if (errorCode != 0) {
-    NSError* error =
-        [NSError errorWithDomain:NSURLErrorDomain
-                            code:errorCode
-                        userInfo:@{
-                          NSURLErrorKey : urlSchemeTask.request.URL,
-                          NSURLErrorFailingURLStringErrorKey :
-                              urlSchemeTask.request.URL.absoluteString
-                        }];
+    NSError* error = [NSError
+        errorWithDomain:NSURLErrorDomain
+                   code:errorCode
+               userInfo:@{
+                 NSURLErrorFailingURLErrorKey : urlSchemeTask.request.URL,
+                 NSURLErrorFailingURLStringErrorKey :
+                     urlSchemeTask.request.URL.absoluteString
+               }];
     [urlSchemeTask didFailWithError:error];
     return;
   }
diff --git a/media/base/fake_audio_worker.cc b/media/base/fake_audio_worker.cc
index 2d0bbef..8d57a09 100644
--- a/media/base/fake_audio_worker.cc
+++ b/media/base/fake_audio_worker.cc
@@ -57,7 +57,7 @@
   int64_t frames_elapsed_;
 
   // Used to cancel any delayed tasks still inside the worker loop's queue.
-  base::CancelableClosure worker_task_cb_;
+  base::CancelableRepeatingClosure worker_task_cb_;
 
   THREAD_CHECKER(thread_checker_);
 
diff --git a/media/base/null_video_sink.h b/media/base/null_video_sink.h
index 3b972a9a..988799c4 100644
--- a/media/base/null_video_sink.h
+++ b/media/base/null_video_sink.h
@@ -66,7 +66,7 @@
   RenderCallback* callback_;
 
   // Manages cancellation of periodic Render() callback task.
-  base::CancelableClosure cancelable_worker_;
+  base::CancelableRepeatingClosure cancelable_worker_;
 
   // Used to determine when a new frame is received.
   scoped_refptr<VideoFrame> last_frame_;
diff --git a/media/base/silent_sink_suspender.h b/media/base/silent_sink_suspender.h
index 52fffadb..40fc611 100644
--- a/media/base/silent_sink_suspender.h
+++ b/media/base/silent_sink_suspender.h
@@ -114,7 +114,7 @@
   // A cancelable task that is posted to switch to or from the |fake_sink_|
   // after a period of silence or first non-silent audio respective. We do this
   // on Android to save battery consumption.
-  base::CancelableCallback<void(bool)> sink_transition_callback_;
+  base::CancelableRepeatingCallback<void(bool)> sink_transition_callback_;
 
   // Audio output delay at the moment when transition to |fake_sink_| starts.
   base::TimeDelta latest_output_delay_;
diff --git a/media/base/video_util.cc b/media/base/video_util.cc
index 595e947..f2d9b59a 100644
--- a/media/base/video_util.cc
+++ b/media/base/video_util.cc
@@ -453,6 +453,7 @@
   }
 
   mapped_frame->set_color_space(video_frame->ColorSpace());
+  mapped_frame->metadata()->MergeMetadataFrom(video_frame->metadata());
 
   // Pass |video_frame| so that it outlives |mapped_frame| and the mapped buffer
   // is unmapped on destruction.
diff --git a/media/renderers/renderer_impl.cc b/media/renderers/renderer_impl.cc
index d69595d7..065b7dd 100644
--- a/media/renderers/renderer_impl.cc
+++ b/media/renderers/renderer_impl.cc
@@ -518,7 +518,7 @@
 
   // If we had a deferred video renderer underflow prior to the flush, it should
   // have been cleared by the audio renderer changing to BUFFERING_HAVE_NOTHING.
-  DCHECK(deferred_video_underflow_cb_.IsCancelled());
+  DCHECK(!has_deferred_buffering_state_change_);
   DCHECK_EQ(audio_buffering_state_, BUFFERING_HAVE_NOTHING);
   audio_ended_ = false;
   audio_playing_ = false;
@@ -719,11 +719,12 @@
     if (video_buffering_state_ == BUFFERING_HAVE_ENOUGH &&
         audio_buffering_state_ == BUFFERING_HAVE_ENOUGH &&
         new_buffering_state == BUFFERING_HAVE_NOTHING &&
-        deferred_video_underflow_cb_.IsCancelled()) {
+        !has_deferred_buffering_state_change_) {
       DVLOG(4) << __func__ << " Deferring HAVE_NOTHING for video stream.";
       deferred_video_underflow_cb_.Reset(
-          base::BindRepeating(&RendererImpl::OnBufferingStateChange, weak_this_,
-                              type, new_buffering_state, reason));
+          base::BindOnce(&RendererImpl::OnBufferingStateChange, weak_this_,
+                         type, new_buffering_state, reason));
+      has_deferred_buffering_state_change_ = true;
       task_runner_->PostDelayedTask(FROM_HERE,
                                     deferred_video_underflow_cb_.callback(),
                                     video_underflow_threshold_.value());
@@ -732,12 +733,14 @@
 
     DVLOG(4) << "deferred_video_underflow_cb_.Cancel()";
     deferred_video_underflow_cb_.Cancel();
-  } else if (!deferred_video_underflow_cb_.IsCancelled() &&
+    has_deferred_buffering_state_change_ = false;
+  } else if (has_deferred_buffering_state_change_ &&
              type == DemuxerStream::AUDIO &&
              new_buffering_state == BUFFERING_HAVE_NOTHING) {
     // If audio underflows while we have a deferred video underflow in progress
     // we want to mark video as underflowed immediately and cancel the deferral.
     deferred_video_underflow_cb_.Cancel();
+    has_deferred_buffering_state_change_ = false;
     video_buffering_state_ = BUFFERING_HAVE_NOTHING;
   }
 
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h
index c33d290..dd5fe59 100644
--- a/media/renderers/renderer_impl.h
+++ b/media/renderers/renderer_impl.h
@@ -246,10 +246,11 @@
   bool clockless_video_playback_enabled_for_testing_;
 
   // Used to defer underflow for video when audio is present.
-  base::CancelableClosure deferred_video_underflow_cb_;
+  base::CancelableOnceClosure deferred_video_underflow_cb_;
 
-  // Used to defer underflow for audio when restarting audio playback.
-  base::CancelableClosure deferred_audio_restart_underflow_cb_;
+  // We cannot use `!deferred_video_underflow_cb_.IsCancelled()` as that changes
+  // when the callback is run, even if not explicitly cancelled.
+  bool has_deferred_buffering_state_change_ = false;
 
   // The amount of time to wait before declaring underflow if the video renderer
   // runs out of data but the audio renderer still has enough.
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h
index 39606f9..b5d1ab3 100644
--- a/net/dns/mdns_client_impl.h
+++ b/net/dns/mdns_client_impl.h
@@ -283,7 +283,7 @@
   bool started_;
   bool active_refresh_;
 
-  base::CancelableClosure next_refresh_;
+  base::CancelableRepeatingClosure next_refresh_;
   DISALLOW_COPY_AND_ASSIGN(MDnsListenerImpl);
 };
 
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index 1312d8b9..0beeef1 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -3480,21 +3480,6 @@
             ]
         }
     ],
-    "IOSPageInfoRefactoring": [
-        {
-            "platforms": [
-                "ios"
-            ],
-            "experiments": [
-                {
-                    "name": "Enabled",
-                    "enable_features": [
-                        "PageInfoRefactoring"
-                    ]
-                }
-            ]
-        }
-    ],
     "IOSPreloadDelayWebStateReset": [
         {
             "platforms": [
diff --git a/third_party/abseil-cpp/CMake/AbseilDll.cmake b/third_party/abseil-cpp/CMake/AbseilDll.cmake
index e0ff249..8b664c24b 100644
--- a/third_party/abseil-cpp/CMake/AbseilDll.cmake
+++ b/third_party/abseil-cpp/CMake/AbseilDll.cmake
@@ -122,6 +122,8 @@
   "hash/internal/hash.h"
   "hash/internal/hash.cc"
   "hash/internal/spy_hash_state.h"
+  "hash/internal/wyhash.h"
+  "hash/internal/wyhash.cc"
   "memory/memory.h"
   "meta/type_traits.h"
   "numeric/int128.cc"
diff --git a/third_party/abseil-cpp/CMake/AbseilHelpers.cmake b/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
index e85deba..e88507d 100644
--- a/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
+++ b/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
@@ -260,6 +260,8 @@
     if(ABSL_ENABLE_INSTALL)
       set_target_properties(${_NAME} PROPERTIES
         OUTPUT_NAME "absl_${_NAME}"
+        # TODO(b/173696973): Figure out how to set SOVERSION for LTS releases.
+        SOVERSION 0
       )
     endif()
   else()
diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium
index dbfbd38..ea67be2 100644
--- a/third_party/abseil-cpp/README.chromium
+++ b/third_party/abseil-cpp/README.chromium
@@ -4,7 +4,7 @@
 License: Apache 2.0
 License File: LICENSE
 Version: 0
-Revision: 4ae6730677ea3c2984f8bb0e4919bd0d9dd04f73
+Revision: 5d8fc9192245f0ea67094af57399d7931d6bd53f
 Security Critical: yes
 
 Description:
diff --git a/third_party/abseil-cpp/absl/base/internal/unaligned_access.h b/third_party/abseil-cpp/absl/base/internal/unaligned_access.h
index 080c197c..093dd9b 100644
--- a/third_party/abseil-cpp/absl/base/internal/unaligned_access.h
+++ b/third_party/abseil-cpp/absl/base/internal/unaligned_access.h
@@ -31,70 +31,6 @@
 // The unaligned API is C++ only.  The declarations use C++ features
 // (namespaces, inline) which are absent or incompatible in C.
 #if defined(__cplusplus)
-
-#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
-    defined(ABSL_HAVE_THREAD_SANITIZER) || defined(ABSL_HAVE_MEMORY_SANITIZER)
-// Consider we have an unaligned load/store of 4 bytes from address 0x...05.
-// AddressSanitizer will treat it as a 3-byte access to the range 05:07 and
-// will miss a bug if 08 is the first unaddressable byte.
-// ThreadSanitizer will also treat this as a 3-byte access to 05:07 and will
-// miss a race between this access and some other accesses to 08.
-// MemorySanitizer will correctly propagate the shadow on unaligned stores
-// and correctly report bugs on unaligned loads, but it may not properly
-// update and report the origin of the uninitialized memory.
-// For all three tools, replacing an unaligned access with a tool-specific
-// callback solves the problem.
-
-#include <sanitizer/common_interface_defs.h>
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-inline uint16_t UnalignedLoad16(const void *p) {
-  return __sanitizer_unaligned_load16(p);
-}
-
-inline uint32_t UnalignedLoad32(const void *p) {
-  return __sanitizer_unaligned_load32(p);
-}
-
-inline uint64_t UnalignedLoad64(const void *p) {
-  return __sanitizer_unaligned_load64(p);
-}
-
-inline void UnalignedStore16(void *p, uint16_t v) {
-  __sanitizer_unaligned_store16(p, v);
-}
-
-inline void UnalignedStore32(void *p, uint32_t v) {
-  __sanitizer_unaligned_store32(p, v);
-}
-
-inline void UnalignedStore64(void *p, uint64_t v) {
-  __sanitizer_unaligned_store64(p, v);
-}
-
-}  // namespace base_internal
-ABSL_NAMESPACE_END
-}  // namespace absl
-
-#define ABSL_INTERNAL_UNALIGNED_LOAD16(_p) \
-  (absl::base_internal::UnalignedLoad16(_p))
-#define ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \
-  (absl::base_internal::UnalignedLoad32(_p))
-#define ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \
-  (absl::base_internal::UnalignedLoad64(_p))
-
-#define ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \
-  (absl::base_internal::UnalignedStore16(_p, _val))
-#define ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \
-  (absl::base_internal::UnalignedStore32(_p, _val))
-#define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \
-  (absl::base_internal::UnalignedStore64(_p, _val))
-
-#else
-
 namespace absl {
 ABSL_NAMESPACE_BEGIN
 namespace base_internal {
@@ -141,8 +77,6 @@
 #define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \
   (absl::base_internal::UnalignedStore64(_p, _val))
 
-#endif
-
 #endif  // defined(__cplusplus), end of unaligned API
 
 #endif  // ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_
diff --git a/third_party/abseil-cpp/absl/base/optimization.h b/third_party/abseil-cpp/absl/base/optimization.h
index 2e31376..393fc3a4 100644
--- a/third_party/abseil-cpp/absl/base/optimization.h
+++ b/third_party/abseil-cpp/absl/base/optimization.h
@@ -179,7 +179,7 @@
 #endif
 
 // ABSL_INTERNAL_ASSUME(cond)
-// Informs the compiler than a condition is always true and that it can assume
+// Informs the compiler that a condition is always true and that it can assume
 // it to be true for optimization purposes. The call has undefined behavior if
 // the condition is false.
 // In !NDEBUG mode, the condition is checked with an assert().
diff --git a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
index 4d80b727..c98c25c 100644
--- a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
+++ b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
@@ -462,6 +462,9 @@
     Inlined inlined;
   };
 
+  template <typename... Args>
+  ABSL_ATTRIBUTE_NOINLINE reference EmplaceBackSlow(Args&&... args);
+
   Metadata metadata_;
   Data data_;
 };
@@ -542,48 +545,42 @@
 template <typename ValueAdapter>
 auto Storage<T, N, A>::Resize(ValueAdapter values, size_type new_size) -> void {
   StorageView storage_view = MakeStorageView();
-
-  IteratorValueAdapter<MoveIterator> move_values(
-      MoveIterator(storage_view.data));
-
-  AllocationTransaction allocation_tx(GetAllocPtr());
-  ConstructionTransaction construction_tx(GetAllocPtr());
-
-  absl::Span<value_type> construct_loop;
-  absl::Span<value_type> move_construct_loop;
-  absl::Span<value_type> destroy_loop;
-
-  if (new_size > storage_view.capacity) {
+  auto* const base = storage_view.data;
+  const size_type size = storage_view.size;
+  auto* alloc = GetAllocPtr();
+  if (new_size <= size) {
+    // Destroy extra old elements.
+    inlined_vector_internal::DestroyElements(alloc, base + new_size,
+                                             size - new_size);
+  } else if (new_size <= storage_view.capacity) {
+    // Construct new elements in place.
+    inlined_vector_internal::ConstructElements(alloc, base + size, &values,
+                                               new_size - size);
+  } else {
+    // Steps:
+    //  a. Allocate new backing store.
+    //  b. Construct new elements in new backing store.
+    //  c. Move existing elements from old backing store to now.
+    //  d. Destroy all elements in old backing store.
+    // Use transactional wrappers for the first two steps so we can roll
+    // back if necessary due to exceptions.
+    AllocationTransaction allocation_tx(alloc);
     size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size);
     pointer new_data = allocation_tx.Allocate(new_capacity);
-    construct_loop = {new_data + storage_view.size,
-                      new_size - storage_view.size};
-    move_construct_loop = {new_data, storage_view.size};
-    destroy_loop = {storage_view.data, storage_view.size};
-  } else if (new_size > storage_view.size) {
-    construct_loop = {storage_view.data + storage_view.size,
-                      new_size - storage_view.size};
-  } else {
-    destroy_loop = {storage_view.data + new_size, storage_view.size - new_size};
-  }
 
-  construction_tx.Construct(construct_loop.data(), &values,
-                            construct_loop.size());
+    ConstructionTransaction construction_tx(alloc);
+    construction_tx.Construct(new_data + size, &values, new_size - size);
 
-  inlined_vector_internal::ConstructElements(
-      GetAllocPtr(), move_construct_loop.data(), &move_values,
-      move_construct_loop.size());
+    IteratorValueAdapter<MoveIterator> move_values((MoveIterator(base)));
+    inlined_vector_internal::ConstructElements(alloc, new_data, &move_values,
+                                               size);
 
-  inlined_vector_internal::DestroyElements(GetAllocPtr(), destroy_loop.data(),
-                                           destroy_loop.size());
-
-  construction_tx.Commit();
-  if (allocation_tx.DidAllocate()) {
+    inlined_vector_internal::DestroyElements(alloc, base, size);
+    construction_tx.Commit();
     DeallocateIfAllocated();
     AcquireAllocatedData(&allocation_tx);
     SetIsAllocated();
   }
-
   SetSize(new_size);
 }
 
@@ -684,44 +681,50 @@
 template <typename... Args>
 auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> reference {
   StorageView storage_view = MakeStorageView();
+  const auto n = storage_view.size;
+  if (ABSL_PREDICT_TRUE(n != storage_view.capacity)) {
+    // Fast path; new element fits.
+    pointer last_ptr = storage_view.data + n;
+    AllocatorTraits::construct(*GetAllocPtr(), last_ptr,
+                               std::forward<Args>(args)...);
+    AddSize(1);
+    return *last_ptr;
+  }
+  // TODO(b/173712035): Annotate with musttail attribute to prevent regression.
+  return EmplaceBackSlow(std::forward<Args>(args)...);
+}
 
+template <typename T, size_t N, typename A>
+template <typename... Args>
+auto Storage<T, N, A>::EmplaceBackSlow(Args&&... args) -> reference {
+  StorageView storage_view = MakeStorageView();
   AllocationTransaction allocation_tx(GetAllocPtr());
-
   IteratorValueAdapter<MoveIterator> move_values(
       MoveIterator(storage_view.data));
-
-  pointer construct_data;
-  if (storage_view.size == storage_view.capacity) {
-    size_type new_capacity = NextCapacity(storage_view.capacity);
-    construct_data = allocation_tx.Allocate(new_capacity);
-  } else {
-    construct_data = storage_view.data;
-  }
-
+  size_type new_capacity = NextCapacity(storage_view.capacity);
+  pointer construct_data = allocation_tx.Allocate(new_capacity);
   pointer last_ptr = construct_data + storage_view.size;
 
+  // Construct new element.
   AllocatorTraits::construct(*GetAllocPtr(), last_ptr,
                              std::forward<Args>(args)...);
-
-  if (allocation_tx.DidAllocate()) {
-    ABSL_INTERNAL_TRY {
-      inlined_vector_internal::ConstructElements(
-          GetAllocPtr(), allocation_tx.GetData(), &move_values,
-          storage_view.size);
-    }
-    ABSL_INTERNAL_CATCH_ANY {
-      AllocatorTraits::destroy(*GetAllocPtr(), last_ptr);
-      ABSL_INTERNAL_RETHROW;
-    }
-
-    inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
-                                             storage_view.size);
-
-    DeallocateIfAllocated();
-    AcquireAllocatedData(&allocation_tx);
-    SetIsAllocated();
+  // Move elements from old backing store to new backing store.
+  ABSL_INTERNAL_TRY {
+    inlined_vector_internal::ConstructElements(
+        GetAllocPtr(), allocation_tx.GetData(), &move_values,
+        storage_view.size);
   }
+  ABSL_INTERNAL_CATCH_ANY {
+    AllocatorTraits::destroy(*GetAllocPtr(), last_ptr);
+    ABSL_INTERNAL_RETHROW;
+  }
+  // Destroy elements in old backing store.
+  inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
+                                           storage_view.size);
 
+  DeallocateIfAllocated();
+  AcquireAllocatedData(&allocation_tx);
+  SetIsAllocated();
   AddSize(1);
   return *last_ptr;
 }
diff --git a/third_party/abseil-cpp/absl/flags/BUILD.bazel b/third_party/abseil-cpp/absl/flags/BUILD.bazel
index 2bd9478..78d6da74 100644
--- a/third_party/abseil-cpp/absl/flags/BUILD.bazel
+++ b/third_party/abseil-cpp/absl/flags/BUILD.bazel
@@ -416,6 +416,7 @@
         ":flag",
         ":parse",
         ":reflection",
+        ":usage_internal",
         "//absl/base:raw_logging_internal",
         "//absl/base:scoped_set_env",
         "//absl/strings",
diff --git a/third_party/abseil-cpp/absl/flags/CMakeLists.txt b/third_party/abseil-cpp/absl/flags/CMakeLists.txt
index 88551914..e5083d7 100644
--- a/third_party/abseil-cpp/absl/flags/CMakeLists.txt
+++ b/third_party/abseil-cpp/absl/flags/CMakeLists.txt
@@ -366,6 +366,7 @@
     absl::flags
     absl::flags_parse
     absl::flags_reflection
+    absl::flags_usage_internal
     absl::raw_logging_internal
     absl::scoped_set_env
     absl::span
diff --git a/third_party/abseil-cpp/absl/flags/internal/usage.cc b/third_party/abseil-cpp/absl/flags/internal/usage.cc
index 75573227..f29d7c9b 100644
--- a/third_party/abseil-cpp/absl/flags/internal/usage.cc
+++ b/third_party/abseil-cpp/absl/flags/internal/usage.cc
@@ -37,26 +37,26 @@
 #include "absl/strings/str_split.h"
 #include "absl/strings/string_view.h"
 
-ABSL_FLAG(bool, help, false,
-          "show help on important flags for this binary [tip: all flags can "
-          "have two dashes]");
-ABSL_FLAG(bool, helpfull, false, "show help on all flags");
-ABSL_FLAG(bool, helpshort, false,
-          "show help on only the main module for this program");
-ABSL_FLAG(bool, helppackage, false,
-          "show help on all modules in the main package");
-ABSL_FLAG(bool, version, false, "show version and build info and exit");
-ABSL_FLAG(bool, only_check_args, false, "exit after checking all flags");
-ABSL_FLAG(std::string, helpon, "",
-          "show help on the modules named by this flag value");
-ABSL_FLAG(std::string, helpmatch, "",
-          "show help on modules whose name contains the specified substr");
+// Dummy global variables to prevent anyone else defining these.
+bool FLAGS_help = false;
+bool FLAGS_helpfull = false;
+bool FLAGS_helpshort = false;
+bool FLAGS_helppackage = false;
+bool FLAGS_version = false;
+bool FLAGS_only_check_args = false;
+bool FLAGS_helpon = false;
+bool FLAGS_helpmatch = false;
 
 namespace absl {
 ABSL_NAMESPACE_BEGIN
 namespace flags_internal {
 namespace {
 
+using PerFlagFilter = std::function<bool(const absl::CommandLineFlag&)>;
+
+// Maximum length size in a human readable format.
+constexpr size_t kHrfMaxLineLength = 80;
+
 // This class is used to emit an XML element with `tag` and `text`.
 // It adds opening and closing tags and escapes special characters in the text.
 // For example:
@@ -109,9 +109,12 @@
  public:
   // Pretty printer holds on to the std::ostream& reference to direct an output
   // to that stream.
-  FlagHelpPrettyPrinter(int max_line_len, std::ostream& out)
+  FlagHelpPrettyPrinter(size_t max_line_len, size_t min_line_len,
+                        size_t wrapped_line_indent, std::ostream& out)
       : out_(out),
         max_line_len_(max_line_len),
+        min_line_len_(min_line_len),
+        wrapped_line_indent_(wrapped_line_indent),
         line_len_(0),
         first_line_(true) {}
 
@@ -165,13 +168,12 @@
 
   void StartLine() {
     if (first_line_) {
-      out_ << "    ";
-      line_len_ = 4;
+      line_len_ = min_line_len_;
       first_line_ = false;
     } else {
-      out_ << "      ";
-      line_len_ = 6;
+      line_len_ = min_line_len_ + wrapped_line_indent_;
     }
+    out_ << std::string(line_len_, ' ');
   }
   void EndLine() {
     out_ << '\n';
@@ -180,13 +182,15 @@
 
  private:
   std::ostream& out_;
-  const int max_line_len_;
-  int line_len_;
+  const size_t max_line_len_;
+  const size_t min_line_len_;
+  const size_t wrapped_line_indent_;
+  size_t line_len_;
   bool first_line_;
 };
 
 void FlagHelpHumanReadable(const CommandLineFlag& flag, std::ostream& out) {
-  FlagHelpPrettyPrinter printer(80, out);  // Max line length is 80.
+  FlagHelpPrettyPrinter printer(kHrfMaxLineLength, 4, 2, out);
 
   // Flag name.
   printer.Write(absl::StrCat("--", flag.Name()));
@@ -222,7 +226,7 @@
 // If a flag's help message has been stripped (e.g. by adding '#define
 // STRIP_FLAG_HELP 1' then this flag will not be displayed by '--help'
 // and its variants.
-void FlagsHelpImpl(std::ostream& out, flags_internal::FlagKindFilter filter_cb,
+void FlagsHelpImpl(std::ostream& out, PerFlagFilter filter_cb,
                    HelpFormat format, absl::string_view program_usage_message) {
   if (format == HelpFormat::kHumanReadable) {
     out << flags_internal::ShortProgramInvocationName() << ": "
@@ -257,10 +261,10 @@
     // If the flag has been stripped, pretend that it doesn't exist.
     if (flag.Help() == flags_internal::kStrippedFlagHelp) return;
 
-    std::string flag_filename = flag.Filename();
-
     // Make sure flag satisfies the filter
-    if (!filter_cb || !filter_cb(flag_filename)) return;
+    if (!filter_cb(flag)) return;
+
+    std::string flag_filename = flag.Filename();
 
     matching_flags[std::string(flags_internal::Package(flag_filename))]
                   [flag_filename]
@@ -290,15 +294,34 @@
   }
 
   if (format == HelpFormat::kHumanReadable) {
+    FlagHelpPrettyPrinter printer(kHrfMaxLineLength, 0, 0, out);
+
     if (filter_cb && matching_flags.empty()) {
-      out << "  No modules matched: use -helpfull\n";
+      printer.Write("No flags matched.\n", true);
     }
+    printer.EndLine();
+    printer.Write(
+        "Try --helpfull to get a list of all flags or --help=substring "
+        "shows help for flags which include specified substring in either "
+        "in the name, or description or path.\n",
+        true);
   } else {
     // The end of the document.
     out << "</AllFlags>\n";
   }
 }
 
+void FlagsHelpImpl(std::ostream& out,
+                   flags_internal::FlagKindFilter filename_filter_cb,
+                   HelpFormat format, absl::string_view program_usage_message) {
+  FlagsHelpImpl(
+      out,
+      [&](const absl::CommandLineFlag& flag) {
+        return filename_filter_cb && filename_filter_cb(flag.Filename());
+      },
+      format, program_usage_message);
+}
+
 }  // namespace
 
 // --------------------------------------------------------------------
@@ -310,7 +333,7 @@
 }
 
 // --------------------------------------------------------------------
-// Produces the help messages for all flags matching the filter.
+// Produces the help messages for all flags matching the filename filter.
 // If filter is empty produces help messages for all flags.
 void FlagsHelp(std::ostream& out, absl::string_view filter, HelpFormat format,
                absl::string_view program_usage_message) {
@@ -325,68 +348,177 @@
 // If so, handles them appropriately.
 int HandleUsageFlags(std::ostream& out,
                      absl::string_view program_usage_message) {
-  if (absl::GetFlag(FLAGS_helpshort)) {
-    flags_internal::FlagsHelpImpl(
-        out, flags_internal::GetUsageConfig().contains_helpshort_flags,
-        HelpFormat::kHumanReadable, program_usage_message);
-    return 1;
-  }
+  switch (GetFlagsHelpMode()) {
+    case HelpMode::kNone:
+      break;
+    case HelpMode::kImportant:
+      flags_internal::FlagsHelpImpl(
+          out, flags_internal::GetUsageConfig().contains_help_flags,
+          GetFlagsHelpFormat(), program_usage_message);
+      return 1;
 
-  if (absl::GetFlag(FLAGS_helpfull)) {
-    // show all options
-    flags_internal::FlagsHelp(out, "", HelpFormat::kHumanReadable,
-                              program_usage_message);
-    return 1;
-  }
+    case HelpMode::kShort:
+      flags_internal::FlagsHelpImpl(
+          out, flags_internal::GetUsageConfig().contains_helpshort_flags,
+          GetFlagsHelpFormat(), program_usage_message);
+      return 1;
 
-  if (!absl::GetFlag(FLAGS_helpon).empty()) {
-    flags_internal::FlagsHelp(
-        out, absl::StrCat("/", absl::GetFlag(FLAGS_helpon), "."),
-        HelpFormat::kHumanReadable, program_usage_message);
-    return 1;
-  }
+    case HelpMode::kFull:
+      flags_internal::FlagsHelp(out, "", GetFlagsHelpFormat(),
+                                program_usage_message);
+      return 1;
 
-  if (!absl::GetFlag(FLAGS_helpmatch).empty()) {
-    flags_internal::FlagsHelp(out, absl::GetFlag(FLAGS_helpmatch),
-                              HelpFormat::kHumanReadable,
-                              program_usage_message);
-    return 1;
-  }
+    case HelpMode::kPackage:
+      flags_internal::FlagsHelpImpl(
+          out, flags_internal::GetUsageConfig().contains_helppackage_flags,
+          GetFlagsHelpFormat(), program_usage_message);
 
-  if (absl::GetFlag(FLAGS_help)) {
-    flags_internal::FlagsHelpImpl(
-        out, flags_internal::GetUsageConfig().contains_help_flags,
-        HelpFormat::kHumanReadable, program_usage_message);
+      return 1;
 
-    out << "\nTry --helpfull to get a list of all flags.\n";
+    case HelpMode::kMatch: {
+      std::string substr = GetFlagsHelpMatchSubstr();
+      if (substr.empty()) {
+        // show all options
+        flags_internal::FlagsHelp(out, substr, GetFlagsHelpFormat(),
+                                  program_usage_message);
+      } else {
+        auto filter_cb = [&substr](const absl::CommandLineFlag& flag) {
+          if (absl::StrContains(flag.Name(), substr)) return true;
+          if (absl::StrContains(flag.Filename(), substr)) return true;
+          if (absl::StrContains(flag.Help(), substr)) return true;
 
-    return 1;
-  }
+          return false;
+        };
+        flags_internal::FlagsHelpImpl(
+            out, filter_cb, HelpFormat::kHumanReadable, program_usage_message);
+      }
 
-  if (absl::GetFlag(FLAGS_helppackage)) {
-    flags_internal::FlagsHelpImpl(
-        out, flags_internal::GetUsageConfig().contains_helppackage_flags,
-        HelpFormat::kHumanReadable, program_usage_message);
+      return 1;
+    }
+    case HelpMode::kVersion:
+      if (flags_internal::GetUsageConfig().version_string)
+        out << flags_internal::GetUsageConfig().version_string();
+      // Unlike help, we may be asking for version in a script, so return 0
+      return 0;
 
-    out << "\nTry --helpfull to get a list of all flags.\n";
-
-    return 1;
-  }
-
-  if (absl::GetFlag(FLAGS_version)) {
-    if (flags_internal::GetUsageConfig().version_string)
-      out << flags_internal::GetUsageConfig().version_string();
-    // Unlike help, we may be asking for version in a script, so return 0
-    return 0;
-  }
-
-  if (absl::GetFlag(FLAGS_only_check_args)) {
-    return 0;
+    case HelpMode::kOnlyCheckArgs:
+      return 0;
   }
 
   return -1;
 }
 
+// --------------------------------------------------------------------
+// Globals representing usage reporting flags
+
+namespace {
+
+ABSL_CONST_INIT absl::Mutex help_attributes_guard(absl::kConstInit);
+ABSL_CONST_INIT std::string* match_substr
+    ABSL_GUARDED_BY(help_attributes_guard) = nullptr;
+ABSL_CONST_INIT HelpMode help_mode ABSL_GUARDED_BY(help_attributes_guard) =
+    HelpMode::kNone;
+ABSL_CONST_INIT HelpFormat help_format ABSL_GUARDED_BY(help_attributes_guard) =
+    HelpFormat::kHumanReadable;
+
+}  // namespace
+
+std::string GetFlagsHelpMatchSubstr() {
+  absl::MutexLock l(&help_attributes_guard);
+  if (match_substr == nullptr) return "";
+  return *match_substr;
+}
+
+void SetFlagsHelpMatchSubstr(absl::string_view substr) {
+  absl::MutexLock l(&help_attributes_guard);
+  if (match_substr == nullptr) match_substr = new std::string;
+  match_substr->assign(substr.data(), substr.size());
+}
+
+HelpMode GetFlagsHelpMode() {
+  absl::MutexLock l(&help_attributes_guard);
+  // Refer to dummy variales to prevent linker dropping them
+  if (FLAGS_help || FLAGS_helpfull || FLAGS_helpshort || FLAGS_helppackage ||
+      FLAGS_version || FLAGS_only_check_args || FLAGS_helpon ||
+      FLAGS_helpmatch) {
+    help_mode = HelpMode::kNone;
+  }
+  return help_mode;
+}
+
+void SetFlagsHelpMode(HelpMode mode) {
+  absl::MutexLock l(&help_attributes_guard);
+  help_mode = mode;
+}
+
+HelpFormat GetFlagsHelpFormat() {
+  absl::MutexLock l(&help_attributes_guard);
+  return help_format;
+}
+
+void SetFlagsHelpFormat(HelpFormat format) {
+  absl::MutexLock l(&help_attributes_guard);
+  help_format = format;
+}
+
+// Deduces usage flags from the input argument in a form --name=value or
+// --name. argument is already split into name and value before we call this
+// function.
+bool DeduceUsageFlags(absl::string_view name, absl::string_view value) {
+  if (absl::ConsumePrefix(&name, "help")) {
+    if (name == "") {
+      if (value.empty()) {
+        SetFlagsHelpMode(HelpMode::kImportant);
+      } else {
+        SetFlagsHelpMode(HelpMode::kMatch);
+        SetFlagsHelpMatchSubstr(value);
+      }
+      return true;
+    }
+
+    if (name == "match") {
+      SetFlagsHelpMode(HelpMode::kMatch);
+      SetFlagsHelpMatchSubstr(value);
+      return true;
+    }
+
+    if (name == "on") {
+      SetFlagsHelpMode(HelpMode::kMatch);
+      SetFlagsHelpMatchSubstr(absl::StrCat("/", value, "."));
+      return true;
+    }
+
+    if (name == "full") {
+      SetFlagsHelpMode(HelpMode::kFull);
+      return true;
+    }
+
+    if (name == "short") {
+      SetFlagsHelpMode(HelpMode::kShort);
+      return true;
+    }
+
+    if (name == "package") {
+      SetFlagsHelpMode(HelpMode::kPackage);
+      return true;
+    }
+
+    return false;
+  }
+
+  if (name == "version") {
+    SetFlagsHelpMode(HelpMode::kVersion);
+    return true;
+  }
+
+  if (name == "only_check_args") {
+    SetFlagsHelpMode(HelpMode::kOnlyCheckArgs);
+    return true;
+  }
+
+  return false;
+}
+
 }  // namespace flags_internal
 ABSL_NAMESPACE_END
 }  // namespace absl
diff --git a/third_party/abseil-cpp/absl/flags/internal/usage.h b/third_party/abseil-cpp/absl/flags/internal/usage.h
index 619ccce..c0bcac57 100644
--- a/third_party/abseil-cpp/absl/flags/internal/usage.h
+++ b/third_party/abseil-cpp/absl/flags/internal/usage.h
@@ -66,17 +66,39 @@
 int HandleUsageFlags(std::ostream& out,
                      absl::string_view program_usage_message);
 
+// --------------------------------------------------------------------
+// Globals representing usage reporting flags
+
+enum class HelpMode {
+  kNone,
+  kImportant,
+  kShort,
+  kFull,
+  kPackage,
+  kMatch,
+  kVersion,
+  kOnlyCheckArgs
+};
+
+// Returns substring to filter help output (--help=substr argument)
+std::string GetFlagsHelpMatchSubstr();
+// Returns the requested help mode.
+HelpMode GetFlagsHelpMode();
+// Returns the requested help format.
+HelpFormat GetFlagsHelpFormat();
+
+// These are corresponding setters to the attributes above.
+void SetFlagsHelpMatchSubstr(absl::string_view);
+void SetFlagsHelpMode(HelpMode);
+void SetFlagsHelpFormat(HelpFormat);
+
+// Deduces usage flags from the input argument in a form --name=value or
+// --name. argument is already split into name and value before we call this
+// function.
+bool DeduceUsageFlags(absl::string_view name, absl::string_view value);
+
 }  // namespace flags_internal
 ABSL_NAMESPACE_END
 }  // namespace absl
 
-ABSL_DECLARE_FLAG(bool, help);
-ABSL_DECLARE_FLAG(bool, helpfull);
-ABSL_DECLARE_FLAG(bool, helpshort);
-ABSL_DECLARE_FLAG(bool, helppackage);
-ABSL_DECLARE_FLAG(bool, version);
-ABSL_DECLARE_FLAG(bool, only_check_args);
-ABSL_DECLARE_FLAG(std::string, helpon);
-ABSL_DECLARE_FLAG(std::string, helpmatch);
-
 #endif  // ABSL_FLAGS_INTERNAL_USAGE_H_
diff --git a/third_party/abseil-cpp/absl/flags/internal/usage_test.cc b/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
index 6e583fbe..b5c2487 100644
--- a/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
+++ b/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
@@ -87,6 +87,11 @@
     default_config.normalize_filename = &NormalizeFileName;
     absl::SetFlagsUsageConfig(default_config);
   }
+  ~UsageReportingTest() override {
+    flags::SetFlagsHelpMode(flags::HelpMode::kNone);
+    flags::SetFlagsHelpMatchSubstr("");
+    flags::SetFlagsHelpFormat(flags::HelpFormat::kHumanReadable);
+  }
 
  private:
   absl::FlagSaver flag_saver_;
@@ -191,6 +196,10 @@
       Some more help.
       Even more long long long long long long long long long long long long help
       message.); default: "";
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )";
 
   std::stringstream test_buf_01;
@@ -214,7 +223,11 @@
   EXPECT_EQ(test_buf_04.str(),
             R"(usage_test: Custom usage message
 
-  No modules matched: use -helpfull
+No flags matched.
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 
   std::stringstream test_buf_05;
@@ -226,12 +239,8 @@
       absl::StartsWith(test_out_str, "usage_test: Custom usage message"));
   EXPECT_TRUE(absl::StrContains(
       test_out_str, "Flags from absl/flags/internal/usage_test.cc:"));
-  EXPECT_TRUE(absl::StrContains(test_out_str,
-                                "Flags from absl/flags/internal/usage.cc:"));
   EXPECT_TRUE(
       absl::StrContains(test_out_str, "-usage_reporting_test_flag_01 "));
-  EXPECT_TRUE(absl::StrContains(test_out_str, "-help (show help"))
-      << test_out_str;
 }
 
 // --------------------------------------------------------------------
@@ -244,7 +253,7 @@
 // --------------------------------------------------------------------
 
 TEST_F(UsageReportingTest, TestUsageFlag_helpshort) {
-  absl::SetFlag(&FLAGS_helpshort, true);
+  flags::SetFlagsHelpMode(flags::HelpMode::kShort);
 
   std::stringstream test_buf;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 1);
@@ -267,13 +276,17 @@
       Some more help.
       Even more long long long long long long long long long long long long help
       message.); default: "";
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 }
 
 // --------------------------------------------------------------------
 
-TEST_F(UsageReportingTest, TestUsageFlag_help) {
-  absl::SetFlag(&FLAGS_help, true);
+TEST_F(UsageReportingTest, TestUsageFlag_help_simple) {
+  flags::SetFlagsHelpMode(flags::HelpMode::kImportant);
 
   std::stringstream test_buf;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 1);
@@ -297,14 +310,74 @@
       Even more long long long long long long long long long long long long help
       message.); default: "";
 
-Try --helpfull to get a list of all flags.
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
+)");
+}
+
+// --------------------------------------------------------------------
+
+TEST_F(UsageReportingTest, TestUsageFlag_help_one_flag) {
+  flags::SetFlagsHelpMode(flags::HelpMode::kMatch);
+  flags::SetFlagsHelpMatchSubstr("usage_reporting_test_flag_06");
+
+  std::stringstream test_buf;
+  EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 1);
+  EXPECT_EQ(test_buf.str(),
+            R"(usage_test: Custom usage message
+
+  Flags from absl/flags/internal/usage_test.cc:
+    --usage_reporting_test_flag_06 (usage_reporting_test_flag_06 help message.
+
+      Some more help.
+      Even more long long long long long long long long long long long long help
+      message.); default: "";
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
+)");
+}
+
+// --------------------------------------------------------------------
+
+TEST_F(UsageReportingTest, TestUsageFlag_help_multiple_flag) {
+  flags::SetFlagsHelpMode(flags::HelpMode::kMatch);
+  flags::SetFlagsHelpMatchSubstr("test_flag");
+
+  std::stringstream test_buf;
+  EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 1);
+  EXPECT_EQ(test_buf.str(),
+            R"(usage_test: Custom usage message
+
+  Flags from absl/flags/internal/usage_test.cc:
+    --usage_reporting_test_flag_01 (usage_reporting_test_flag_01 help message);
+      default: 101;
+    --usage_reporting_test_flag_02 (usage_reporting_test_flag_02 help message);
+      default: false;
+    --usage_reporting_test_flag_03 (usage_reporting_test_flag_03 help message);
+      default: 1.03;
+    --usage_reporting_test_flag_04 (usage_reporting_test_flag_04 help message);
+      default: 1000000000000004;
+    --usage_reporting_test_flag_05 (usage_reporting_test_flag_05 help message);
+      default: UDT{};
+    --usage_reporting_test_flag_06 (usage_reporting_test_flag_06 help message.
+
+      Some more help.
+      Even more long long long long long long long long long long long long help
+      message.); default: "";
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 }
 
 // --------------------------------------------------------------------
 
 TEST_F(UsageReportingTest, TestUsageFlag_helppackage) {
-  absl::SetFlag(&FLAGS_helppackage, true);
+  flags::SetFlagsHelpMode(flags::HelpMode::kPackage);
 
   std::stringstream test_buf;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 1);
@@ -328,14 +401,16 @@
       Even more long long long long long long long long long long long long help
       message.); default: "";
 
-Try --helpfull to get a list of all flags.
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 }
 
 // --------------------------------------------------------------------
 
 TEST_F(UsageReportingTest, TestUsageFlag_version) {
-  absl::SetFlag(&FLAGS_version, true);
+  flags::SetFlagsHelpMode(flags::HelpMode::kVersion);
 
   std::stringstream test_buf;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 0);
@@ -349,7 +424,7 @@
 // --------------------------------------------------------------------
 
 TEST_F(UsageReportingTest, TestUsageFlag_only_check_args) {
-  absl::SetFlag(&FLAGS_only_check_args, true);
+  flags::SetFlagsHelpMode(flags::HelpMode::kOnlyCheckArgs);
 
   std::stringstream test_buf;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf, kTestUsageMessage), 0);
@@ -359,17 +434,22 @@
 // --------------------------------------------------------------------
 
 TEST_F(UsageReportingTest, TestUsageFlag_helpon) {
-  absl::SetFlag(&FLAGS_helpon, "bla-bla");
+  flags::SetFlagsHelpMode(flags::HelpMode::kMatch);
+  flags::SetFlagsHelpMatchSubstr("/bla-bla.");
 
   std::stringstream test_buf_01;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf_01, kTestUsageMessage), 1);
   EXPECT_EQ(test_buf_01.str(),
             R"(usage_test: Custom usage message
 
-  No modules matched: use -helpfull
+No flags matched.
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 
-  absl::SetFlag(&FLAGS_helpon, "usage_test");
+  flags::SetFlagsHelpMatchSubstr("/usage_test.");
 
   std::stringstream test_buf_02;
   EXPECT_EQ(flags::HandleUsageFlags(test_buf_02, kTestUsageMessage), 1);
@@ -392,6 +472,10 @@
       Some more help.
       Even more long long long long long long long long long long long long help
       message.); default: "";
+
+Try --helpfull to get a list of all flags or --help=substring shows help for
+flags which include specified substring in either in the name, or description or
+path.
 )");
 }
 
diff --git a/third_party/abseil-cpp/absl/flags/parse.cc b/third_party/abseil-cpp/absl/flags/parse.cc
index 1835a837..dd1a679 100644
--- a/third_party/abseil-cpp/absl/flags/parse.cc
+++ b/third_party/abseil-cpp/absl/flags/parse.cc
@@ -713,6 +713,11 @@
     std::tie(flag, is_negative) = LocateFlag(flag_name);
 
     if (flag == nullptr) {
+      // Usage flags are not modeled as Abseil flags. Locate them separately.
+      if (flags_internal::DeduceUsageFlags(flag_name, value)) {
+        continue;
+      }
+
       if (on_undef_flag != OnUndefinedFlag::kIgnoreUndefined) {
         undefined_flag_names.emplace_back(arg_from_argv,
                                           std::string(flag_name));
diff --git a/third_party/abseil-cpp/absl/flags/parse_test.cc b/third_party/abseil-cpp/absl/flags/parse_test.cc
index d35a6e4..41bc0bc 100644
--- a/third_party/abseil-cpp/absl/flags/parse_test.cc
+++ b/third_party/abseil-cpp/absl/flags/parse_test.cc
@@ -28,6 +28,7 @@
 #include "absl/flags/declare.h"
 #include "absl/flags/flag.h"
 #include "absl/flags/internal/parse.h"
+#include "absl/flags/internal/usage.h"
 #include "absl/flags/reflection.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
@@ -207,6 +208,9 @@
 using testing::ElementsAreArray;
 
 class ParseTest : public testing::Test {
+ public:
+  ~ParseTest() override { flags::SetFlagsHelpMode(flags::HelpMode::kNone); }
+
  private:
   absl::FlagSaver flag_saver_;
 };
@@ -851,7 +855,7 @@
 
 // --------------------------------------------------------------------
 
-TEST_F(ParseDeathTest, TestHelpFlagHandling) {
+TEST_F(ParseDeathTest, TestSimpleHelpFlagHandling) {
   const char* in_args1[] = {
       "testbin",
       "--help",
@@ -870,11 +874,38 @@
       flags::UsageFlagsAction::kIgnoreUsage,
       flags::OnUndefinedFlag::kAbortIfUndefined);
 
+  EXPECT_EQ(flags::GetFlagsHelpMode(), flags::HelpMode::kImportant);
   EXPECT_EQ(absl::GetFlag(FLAGS_int_flag), 3);
 }
 
 // --------------------------------------------------------------------
 
+TEST_F(ParseDeathTest, TestSubstringHelpFlagHandling) {
+  const char* in_args1[] = {
+      "testbin",
+      "--help=abcd",
+  };
+
+  auto out_args1 = flags::ParseCommandLineImpl(
+      2, const_cast<char**>(in_args1), flags::ArgvListAction::kRemoveParsedArgs,
+      flags::UsageFlagsAction::kIgnoreUsage,
+      flags::OnUndefinedFlag::kAbortIfUndefined);
+
+  EXPECT_EQ(flags::GetFlagsHelpMode(), flags::HelpMode::kMatch);
+  EXPECT_EQ(flags::GetFlagsHelpMatchSubstr(), "abcd");
+
+  const char* in_args2[] = {"testbin", "--help", "some_positional_arg"};
+
+  auto out_args2 = flags::ParseCommandLineImpl(
+      3, const_cast<char**>(in_args2), flags::ArgvListAction::kRemoveParsedArgs,
+      flags::UsageFlagsAction::kIgnoreUsage,
+      flags::OnUndefinedFlag::kAbortIfUndefined);
+
+  EXPECT_EQ(flags::GetFlagsHelpMode(), flags::HelpMode::kImportant);
+}
+
+// --------------------------------------------------------------------
+
 TEST_F(ParseTest, WasPresentOnCommandLine) {
   const char* in_args1[] = {
       "testbin",        "arg1", "--bool_flag",
diff --git a/third_party/abseil-cpp/absl/flags/reflection_test.cc b/third_party/abseil-cpp/absl/flags/reflection_test.cc
index 8620d14..4c809009 100644
--- a/third_party/abseil-cpp/absl/flags/reflection_test.cc
+++ b/third_party/abseil-cpp/absl/flags/reflection_test.cc
@@ -32,8 +32,6 @@
 ABSL_FLAG(std::string, string_flag, "dflt", "string_flag help");
 ABSL_RETIRED_FLAG(bool, bool_retired_flag, false, "bool_retired_flag help");
 
-ABSL_DECLARE_FLAG(bool, help);
-
 namespace {
 
 namespace flags = absl::flags_internal;
@@ -66,12 +64,9 @@
 // --------------------------------------------------------------------
 
 TEST_F(ReflectionTest, TestGetAllFlags) {
-  (void)absl::GetFlag(FLAGS_help);  // Force linking of usage flags.
-
   auto all_flags = absl::GetAllFlags();
   EXPECT_NE(all_flags.find("int_flag"), all_flags.end());
   EXPECT_EQ(all_flags.find("bool_retired_flag"), all_flags.end());
-  EXPECT_NE(all_flags.find("help"), all_flags.end());
   EXPECT_EQ(all_flags.find("some_undefined_flag"), all_flags.end());
 
   std::vector<absl::string_view> flag_names_first_attempt;
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.bazel b/third_party/abseil-cpp/absl/hash/BUILD.bazel
index 5b1e2d0..40c8f207 100644
--- a/third_party/abseil-cpp/absl/hash/BUILD.bazel
+++ b/third_party/abseil-cpp/absl/hash/BUILD.bazel
@@ -37,6 +37,7 @@
     linkopts = ABSL_DEFAULT_LINKOPTS,
     deps = [
         ":city",
+        ":wyhash",
         "//absl/base:core_headers",
         "//absl/base:endian",
         "//absl/container:fixed_array",
@@ -120,3 +121,30 @@
         "@com_google_googletest//:gtest_main",
     ],
 )
+
+cc_library(
+    name = "wyhash",
+    srcs = ["internal/wyhash.cc"],
+    hdrs = ["internal/wyhash.h"],
+    copts = ABSL_DEFAULT_COPTS,
+    linkopts = ABSL_DEFAULT_LINKOPTS,
+    visibility = ["//visibility:private"],
+    deps = [
+        "//absl/base:config",
+        "//absl/base:endian",
+        "//absl/numeric:int128",
+    ],
+)
+
+cc_test(
+    name = "wyhash_test",
+    srcs = ["internal/wyhash_test.cc"],
+    copts = ABSL_TEST_COPTS,
+    linkopts = ABSL_DEFAULT_LINKOPTS,
+    visibility = ["//visibility:private"],
+    deps = [
+        ":wyhash",
+        "//absl/strings",
+        "@com_google_googletest//:gtest_main",
+    ],
+)
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.gn b/third_party/abseil-cpp/absl/hash/BUILD.gn
index ca4a05b6..7a69e67 100644
--- a/third_party/abseil-cpp/absl/hash/BUILD.gn
+++ b/third_party/abseil-cpp/absl/hash/BUILD.gn
@@ -13,6 +13,7 @@
   public = [ "hash.h" ]
   deps = [
     ":city",
+    ":wyhash",
     "//third_party/abseil-cpp/absl/base:core_headers",
     "//third_party/abseil-cpp/absl/base:endian",
     "//third_party/abseil-cpp/absl/container:fixed_array",
@@ -57,3 +58,14 @@
     "//third_party/abseil-cpp/absl/base:endian",
   ]
 }
+
+absl_source_set("wyhash") {
+  public = [ "internal/wyhash.h" ]
+  sources = [ "internal/wyhash.cc" ]
+  deps = [
+    "//third_party/abseil-cpp/absl/base:config",
+    "//third_party/abseil-cpp/absl/base:endian",
+    "//third_party/abseil-cpp/absl/numeric:int128",
+  ]
+  visibility = [ ":*" ]
+}
diff --git a/third_party/abseil-cpp/absl/hash/CMakeLists.txt b/third_party/abseil-cpp/absl/hash/CMakeLists.txt
index 61365e9..6d19877 100644
--- a/third_party/abseil-cpp/absl/hash/CMakeLists.txt
+++ b/third_party/abseil-cpp/absl/hash/CMakeLists.txt
@@ -24,7 +24,8 @@
     "internal/hash.h"
   COPTS
     ${ABSL_DEFAULT_COPTS}
-  DEPS
+    DEPS
+    absl::city
     absl::core_headers
     absl::endian
     absl::fixed_array
@@ -34,7 +35,7 @@
     absl::optional
     absl::variant
     absl::utility
-    absl::city
+    absl::wyhash
   PUBLIC
 )
 
@@ -114,3 +115,30 @@
     gmock_main
 )
 
+absl_cc_library(
+  NAME
+    wyhash
+  HDRS
+    "internal/wyhash.h"
+  SRCS
+    "internal/wyhash.cc"
+  COPTS
+    ${ABSL_DEFAULT_COPTS}
+  DEPS
+    absl::config
+    absl::endian
+    absl::int128
+)
+
+absl_cc_test(
+  NAME
+    wyhash_test
+  SRCS
+    "internal/wyhash_test.cc"
+  COPTS
+    ${ABSL_TEST_COPTS}
+  DEPS
+    absl::wyhash
+    absl::strings
+    gmock_main
+)
diff --git a/third_party/abseil-cpp/absl/hash/internal/hash.cc b/third_party/abseil-cpp/absl/hash/internal/hash.cc
index b44ecb3..1433eb9 100644
--- a/third_party/abseil-cpp/absl/hash/internal/hash.cc
+++ b/third_party/abseil-cpp/absl/hash/internal/hash.cc
@@ -18,9 +18,9 @@
 ABSL_NAMESPACE_BEGIN
 namespace hash_internal {
 
-uint64_t CityHashState::CombineLargeContiguousImpl32(uint64_t state,
-                                                     const unsigned char* first,
-                                                     size_t len) {
+uint64_t HashState::CombineLargeContiguousImpl32(uint64_t state,
+                                                 const unsigned char* first,
+                                                 size_t len) {
   while (len >= PiecewiseChunkSize()) {
     state =
         Mix(state, absl::hash_internal::CityHash32(reinterpret_cast<const char*>(first),
@@ -33,13 +33,11 @@
                                std::integral_constant<int, 4>{});
 }
 
-uint64_t CityHashState::CombineLargeContiguousImpl64(uint64_t state,
-                                                     const unsigned char* first,
-                                                     size_t len) {
+uint64_t HashState::CombineLargeContiguousImpl64(uint64_t state,
+                                                 const unsigned char* first,
+                                                 size_t len) {
   while (len >= PiecewiseChunkSize()) {
-    state =
-        Mix(state, absl::hash_internal::CityHash64(reinterpret_cast<const char*>(first),
-                                         PiecewiseChunkSize()));
+    state = Mix(state, Hash64(first, PiecewiseChunkSize()));
     len -= PiecewiseChunkSize();
     first += PiecewiseChunkSize();
   }
@@ -48,7 +46,24 @@
                                std::integral_constant<int, 8>{});
 }
 
-ABSL_CONST_INIT const void* const CityHashState::kSeed = &kSeed;
+ABSL_CONST_INIT const void* const HashState::kSeed = &kSeed;
+
+// The salt array used by Wyhash. This array is NOT the mechanism used to make
+// absl::Hash non-deterministic between program invocations.  See `Seed()` for
+// that mechanism.
+//
+// Any random values are fine. These values are just digits from the decimal
+// part of pi.
+// https://en.wikipedia.org/wiki/Nothing-up-my-sleeve_number
+constexpr uint64_t kWyhashSalt[5] = {
+    uint64_t{0x243F6A8885A308D3}, uint64_t{0x13198A2E03707344},
+    uint64_t{0xA4093822299F31D0}, uint64_t{0x082EFA98EC4E6C89},
+    uint64_t{0x452821E638D01377},
+};
+
+uint64_t HashState::WyhashImpl(const unsigned char* data, size_t len) {
+  return Wyhash(data, len, Seed(), kWyhashSalt);
+}
 
 }  // namespace hash_internal
 ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/absl/hash/internal/hash.h b/third_party/abseil-cpp/absl/hash/internal/hash.h
index b0132da..eb3471d 100644
--- a/third_party/abseil-cpp/absl/hash/internal/hash.h
+++ b/third_party/abseil-cpp/absl/hash/internal/hash.h
@@ -41,6 +41,7 @@
 #include "absl/base/internal/endian.h"
 #include "absl/base/port.h"
 #include "absl/container/fixed_array.h"
+#include "absl/hash/internal/wyhash.h"
 #include "absl/meta/type_traits.h"
 #include "absl/numeric/int128.h"
 #include "absl/strings/string_view.h"
@@ -712,9 +713,8 @@
 struct is_hashable
     : std::integral_constant<bool, HashSelect::template Apply<T>::value> {};
 
-// CityHashState
-class ABSL_DLL CityHashState
-    : public HashStateBase<CityHashState> {
+// HashState
+class ABSL_DLL HashState : public HashStateBase<HashState> {
   // absl::uint128 is not an alias or a thin wrapper around the intrinsic.
   // We use the intrinsic when available to improve performance.
 #ifdef ABSL_HAVE_INTRINSIC_INT128
@@ -733,23 +733,22 @@
 
  public:
   // Move only
-  CityHashState(CityHashState&&) = default;
-  CityHashState& operator=(CityHashState&&) = default;
+  HashState(HashState&&) = default;
+  HashState& operator=(HashState&&) = default;
 
-  // CityHashState::combine_contiguous()
+  // HashState::combine_contiguous()
   //
   // Fundamental base case for hash recursion: mixes the given range of bytes
   // into the hash state.
-  static CityHashState combine_contiguous(CityHashState hash_state,
-                                          const unsigned char* first,
-                                          size_t size) {
-    return CityHashState(
+  static HashState combine_contiguous(HashState hash_state,
+                                      const unsigned char* first, size_t size) {
+    return HashState(
         CombineContiguousImpl(hash_state.state_, first, size,
                               std::integral_constant<int, sizeof(size_t)>{}));
   }
-  using CityHashState::HashStateBase::combine_contiguous;
+  using HashState::HashStateBase::combine_contiguous;
 
-  // CityHashState::hash()
+  // HashState::hash()
   //
   // For performance reasons in non-opt mode, we specialize this for
   // integral types.
@@ -761,24 +760,24 @@
     return static_cast<size_t>(Mix(Seed(), static_cast<uint64_t>(value)));
   }
 
-  // Overload of CityHashState::hash()
+  // Overload of HashState::hash()
   template <typename T, absl::enable_if_t<!IntegralFastPath<T>::value, int> = 0>
   static size_t hash(const T& value) {
-    return static_cast<size_t>(combine(CityHashState{}, value).state_);
+    return static_cast<size_t>(combine(HashState{}, value).state_);
   }
 
  private:
   // Invoked only once for a given argument; that plus the fact that this is
   // move-only ensures that there is only one non-moved-from object.
-  CityHashState() : state_(Seed()) {}
+  HashState() : state_(Seed()) {}
 
   // Workaround for MSVC bug.
   // We make the type copyable to fix the calling convention, even though we
   // never actually copy it. Keep it private to not affect the public API of the
   // type.
-  CityHashState(const CityHashState&) = default;
+  HashState(const HashState&) = default;
 
-  explicit CityHashState(uint64_t state) : state_(state) {}
+  explicit HashState(uint64_t state) : state_(state) {}
 
   // Implementation of the base case for combine_contiguous where we actually
   // mix the bytes into the state.
@@ -791,7 +790,8 @@
   static uint64_t CombineContiguousImpl(uint64_t state,
                                         const unsigned char* first, size_t len,
                                         std::integral_constant<int, 8>
-                                        /* sizeof_size_t*/);
+                                        /* sizeof_size_t */);
+
 
   // Slow dispatch path for calls to CombineContiguousImpl with a size argument
   // larger than PiecewiseChunkSize().  Has the same effect as calling
@@ -838,6 +838,19 @@
     return static_cast<uint64_t>(m ^ (m >> (sizeof(m) * 8 / 2)));
   }
 
+  // An extern to avoid bloat on a direct call to Wyhash() with fixed values for
+  // both the seed and salt parameters.
+  static uint64_t WyhashImpl(const unsigned char* data, size_t len);
+
+  ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Hash64(const unsigned char* data,
+                                                      size_t len) {
+#ifdef ABSL_HAVE_INTRINSIC_INT128
+    return WyhashImpl(data, len);
+#else
+    return absl::hash_internal::CityHash64(reinterpret_cast<const char*>(data), len);
+#endif
+  }
+
   // Seed()
   //
   // A non-deterministic seed.
@@ -869,8 +882,8 @@
   uint64_t state_;
 };
 
-// CityHashState::CombineContiguousImpl()
-inline uint64_t CityHashState::CombineContiguousImpl(
+// HashState::CombineContiguousImpl()
+inline uint64_t HashState::CombineContiguousImpl(
     uint64_t state, const unsigned char* first, size_t len,
     std::integral_constant<int, 4> /* sizeof_size_t */) {
   // For large values we use CityHash, for small ones we just use a
@@ -892,18 +905,18 @@
   return Mix(state, v);
 }
 
-// Overload of CityHashState::CombineContiguousImpl()
-inline uint64_t CityHashState::CombineContiguousImpl(
+// Overload of HashState::CombineContiguousImpl()
+inline uint64_t HashState::CombineContiguousImpl(
     uint64_t state, const unsigned char* first, size_t len,
     std::integral_constant<int, 8> /* sizeof_size_t */) {
-  // For large values we use CityHash, for small ones we just use a
-  // multiplicative hash.
+  // For large values we use Wyhash or CityHash depending on the platform, for
+  // small ones we just use a multiplicative hash.
   uint64_t v;
   if (len > 16) {
     if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) {
       return CombineLargeContiguousImpl64(state, first, len);
     }
-    v = absl::hash_internal::CityHash64(reinterpret_cast<const char*>(first), len);
+    v = Hash64(first, len);
   } else if (len > 8) {
     auto p = Read9To16(first, len);
     state = Mix(state, p.first);
@@ -934,7 +947,7 @@
 
 template <typename T>
 struct HashImpl {
-  size_t operator()(const T& value) const { return CityHashState::hash(value); }
+  size_t operator()(const T& value) const { return HashState::hash(value); }
 };
 
 template <typename T>
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash.cc b/third_party/abseil-cpp/absl/hash/internal/wyhash.cc
new file mode 100644
index 0000000..642bde43
--- /dev/null
+++ b/third_party/abseil-cpp/absl/hash/internal/wyhash.cc
@@ -0,0 +1,111 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "absl/hash/internal/wyhash.h"
+
+#include "absl/base/internal/unaligned_access.h"
+#include "absl/numeric/int128.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace hash_internal {
+
+static uint64_t WyhashMix(uint64_t v0, uint64_t v1) {
+  absl::uint128 p = v0;
+  p *= v1;
+  return absl::Uint128Low64(p) ^ absl::Uint128High64(p);
+}
+
+uint64_t Wyhash(const void* data, size_t len, uint64_t seed,
+                const uint64_t salt[]) {
+  const uint8_t* ptr = static_cast<const uint8_t*>(data);
+  uint64_t starting_length = static_cast<uint64_t>(len);
+  uint64_t current_state = seed ^ salt[0];
+
+  if (len > 64) {
+    // If we have more than 64 bytes, we're going to handle chunks of 64
+    // bytes at a time. We're going to build up two separate hash states
+    // which we will then hash together.
+    uint64_t duplicated_state = current_state;
+
+    do {
+      uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
+      uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
+      uint64_t c = absl::base_internal::UnalignedLoad64(ptr + 16);
+      uint64_t d = absl::base_internal::UnalignedLoad64(ptr + 24);
+      uint64_t e = absl::base_internal::UnalignedLoad64(ptr + 32);
+      uint64_t f = absl::base_internal::UnalignedLoad64(ptr + 40);
+      uint64_t g = absl::base_internal::UnalignedLoad64(ptr + 48);
+      uint64_t h = absl::base_internal::UnalignedLoad64(ptr + 56);
+
+      uint64_t cs0 = WyhashMix(a ^ salt[1], b ^ current_state);
+      uint64_t cs1 = WyhashMix(c ^ salt[2], d ^ current_state);
+      current_state = (cs0 ^ cs1);
+
+      uint64_t ds0 = WyhashMix(e ^ salt[3], f ^ duplicated_state);
+      uint64_t ds1 = WyhashMix(g ^ salt[4], h ^ duplicated_state);
+      duplicated_state = (ds0 ^ ds1);
+
+      ptr += 64;
+      len -= 64;
+    } while (len > 64);
+
+    current_state = current_state ^ duplicated_state;
+  }
+
+  // We now have a data `ptr` with at most 64 bytes and the current state
+  // of the hashing state machine stored in current_state.
+  while (len > 16) {
+    uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
+    uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
+
+    current_state = WyhashMix(a ^ salt[1], b ^ current_state);
+
+    ptr += 16;
+    len -= 16;
+  }
+
+  // We now have a data `ptr` with at most 16 bytes.
+  uint64_t a = 0;
+  uint64_t b = 0;
+  if (len > 8) {
+    // When we have at least 9 and at most 16 bytes, set A to the first 64
+    // bits of the input and B to the last 64 bits of the input. Yes, they will
+    // overlap in the middle if we are working with less than the full 16
+    // bytes.
+    a = absl::base_internal::UnalignedLoad64(ptr);
+    b = absl::base_internal::UnalignedLoad64(ptr + len - 8);
+  } else if (len > 3) {
+    // If we have at least 4 and at most 8 bytes, set A to the first 32
+    // bits and B to the last 32 bits.
+    a = absl::base_internal::UnalignedLoad32(ptr);
+    b = absl::base_internal::UnalignedLoad32(ptr + len - 4);
+  } else if (len > 0) {
+    // If we have at least 1 and at most 3 bytes, read all of the provided
+    // bits into A, with some adjustments.
+    a = ((ptr[0] << 16) | (ptr[len >> 1] << 8) | ptr[len - 1]);
+    b = 0;
+  } else {
+    a = 0;
+    b = 0;
+  }
+
+  uint64_t w = WyhashMix(a ^ salt[1], b ^ current_state);
+  uint64_t z = salt[1] ^ starting_length;
+  return WyhashMix(w, z);
+}
+
+}  // namespace hash_internal
+ABSL_NAMESPACE_END
+}  // namespace absl
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash.h b/third_party/abseil-cpp/absl/hash/internal/wyhash.h
new file mode 100644
index 0000000..4aff4e9
--- /dev/null
+++ b/third_party/abseil-cpp/absl/hash/internal/wyhash.h
@@ -0,0 +1,48 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// This file provides the Google-internal implementation of the Wyhash
+// algorithm.
+//
+// Wyhash is a fast hash function for hash tables, the fastest we've currently
+// (late 2020) found that passes the SMHasher tests. The algorithm relies on
+// intrinsic 128-bit multiplication for speed. This is not meant to be secure -
+// just fast.
+
+#ifndef ABSL_HASH_INTERNAL_WYHASH_H_
+#define ABSL_HASH_INTERNAL_WYHASH_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "absl/base/config.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace hash_internal {
+
+// Hash function for a byte array. A 64-bit seed and a set of five 64-bit
+// integers are hashed into the result.
+//
+// To allow all hashable types (including string_view and Span) to depend on
+// this algoritm, we keep the API low-level, with as few dependencies as
+// possible.
+uint64_t Wyhash(const void* data, size_t len, uint64_t seed,
+                const uint64_t salt[5]);
+
+}  // namespace hash_internal
+ABSL_NAMESPACE_END
+}  // namespace absl
+
+#endif  // ABSL_HASH_INTERNAL_WYHASH_H_
diff --git a/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc b/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc
new file mode 100644
index 0000000..30dc9e3
--- /dev/null
+++ b/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc
@@ -0,0 +1,486 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in cokSaltliance with the License.
+// You may obtain a copy of the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ikSaltlied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "absl/hash/internal/wyhash.h"
+
+#include "absl/strings/escaping.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace {
+
+static const uint64_t kCurrentSeed = 0;
+static const uint64_t kSalt[5] = {0xa0761d6478bd642f, 0xe7037ed1a0b428dbl,
+                                  0x8ebc6af09c88c6e3, 0x589965cc75374cc3l,
+                                  0x1d8e4e27c47d124f};
+
+// Note: We don't account for endianness, so the values here are only correct if
+// you're also running on a little endian platform.
+
+TEST(WyhashTest, EmptyString) {
+  const std::string s = "";
+  EXPECT_EQ(
+      absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
+      4808886099364463827);
+}
+
+TEST(WyhashTest, Spaces) {
+  const std::string s = "   ";
+  EXPECT_EQ(
+      absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
+      1686201463024549249);
+}
+
+TEST(WyhashTest, RepeatingString) {
+  const std::string s = "aaaa";
+  EXPECT_EQ(
+      absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
+      6646112255271966632);
+}
+
+TEST(WyhashTest, HexString) {
+  const std::string small = "\x01\x02\x03";
+  const std::string med = "\x01\x02\x03\x04";
+
+  EXPECT_EQ(absl::hash_internal::Wyhash(small.c_str(), small.length(),
+                                        kCurrentSeed, kSalt),
+            11989428023081740911ULL);
+  EXPECT_EQ(absl::hash_internal::Wyhash(med.c_str(), med.length(), kCurrentSeed,
+                                        kSalt),
+            9765997711188871556ULL);
+}
+
+TEST(WyhashTest, Words) {
+  const std::string s = "third_party|wyhash|64";
+  EXPECT_EQ(
+      absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
+      3702018632387611330);
+}
+
+TEST(WyhashTest, LongString) {
+  const std::string s =
+      "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz"
+      "0123456789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOp"
+      "QrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEf"
+      "GhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz012345"
+      "6789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789";
+
+  EXPECT_EQ(
+      absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
+      9245411362605796064ULL);
+}
+
+TEST(WyhashTest, BigReference) {
+  struct ExpectedResult {
+    absl::string_view base64_data;
+    uint64_t seed;
+    uint64_t hash;
+  } expected_results[] = {
+      {"", uint64_t{0xec42b7ab404b8acb}, uint64_t{0xe5a40d39ab796423}},
+      {"Zw==", uint64_t{0xeeee074043a3ee0f}, uint64_t{0xa6564b468248c683}},
+      {"xmk=", uint64_t{0x857902089c393de}, uint64_t{0xef192f401b116e1c}},
+      {"c1H/", uint64_t{0x993df040024ca3af}, uint64_t{0xbe8dc0c54617639d}},
+      {"SuwpzQ==", uint64_t{0xc4e4c2acea740e96}, uint64_t{0x93d7f665b5521c8e}},
+      {"uqvy++M=", uint64_t{0x6a214b3db872d0cf}, uint64_t{0x646d70bb42445f28}},
+      {"RnzCVPgb", uint64_t{0x44343db6a89dba4d}, uint64_t{0x96a7b1e3cc9bd426}},
+      {"6OeNdlouYw==", uint64_t{0x77b5d6d1ae1dd483},
+       uint64_t{0x76020289ab0790c4}},
+      {"M5/JmmYyDbc=", uint64_t{0x89ab8ecb44d221f1},
+       uint64_t{0x39f842e4133b9b44}},
+      {"MVijWiVdBRdY", uint64_t{0x60244b17577ca81b},
+       uint64_t{0x2b8d7047be4bcaab}},
+      {"6V7Uq7LNxpu0VA==", uint64_t{0x59a08dcee0717067},
+       uint64_t{0x99628abef6716a97}},
+      {"EQ6CdEEhPdyHcOk=", uint64_t{0xf5f20db3ade57396},
+       uint64_t{0x4432e02ba42b2740}},
+      {"PqFB4fxnPgF+l+rc", uint64_t{0xbf8dee0751ad3efb},
+       uint64_t{0x74d810efcad7918a}},
+      {"a5aPOFwq7LA7+zKvPA==", uint64_t{0x6b7a06b268d63e30},
+       uint64_t{0x88c84e986002507f}},
+      {"VOwY21wCGv5D+/qqOvs=", uint64_t{0xb8c37f0ae0f54c82},
+       uint64_t{0x4f99acf193cf39b9}},
+      {"KdHmBTx8lHXYvmGJ+Vy7", uint64_t{0x9fcbed0c38e50eef},
+       uint64_t{0xd90e7a3655891e37}},
+      {"qJkPlbHr8bMF7/cA6aE65Q==", uint64_t{0x2af4bade1d8e3a1d},
+       uint64_t{0x3bb378b1d4df8fcf}},
+      {"ygvL0EhHZL0fIx6oHHtkxRQ=", uint64_t{0x714e3aa912da2f2c},
+       uint64_t{0xf78e94045c052d47}},
+      {"c1rFXkt5YztwZCQRngncqtSs", uint64_t{0xf5ee75e3cbb82c1c},
+       uint64_t{0x26da0b2130da6b40}},
+      {"8hsQrzszzeNQSEcVXLtvIhm6mw==", uint64_t{0x620e7007321b93b9},
+       uint64_t{0x30b4d426af8c6986}},
+      {"ffUL4RocfyP4KfikGxO1yk7omDI=", uint64_t{0xc08528cac2e551fc},
+       uint64_t{0x5413b4aaf3baaeae}},
+      {"OOB5TT00vF9Od/rLbAWshiErqhpV", uint64_t{0x6a1debf9cc3ad39},
+       uint64_t{0x756ab265370a1597}},
+      {"or5wtXM7BFzTNpSzr+Lw5J5PMhVJ/Q==", uint64_t{0x7e0a3c88111fc226},
+       uint64_t{0xdaf5f4b7d09814fb}},
+      {"gk6pCHDUsoopVEiaCrzVDhioRKxb844=", uint64_t{0x1301fef15df39edb},
+       uint64_t{0x8f874ae37742b75e}},
+      {"TNctmwlC5QbEM6/No4R/La3UdkfeMhzs", uint64_t{0x64e181f3d5817ab},
+       uint64_t{0x8fecd03956121ce8}},
+      {"SsQw9iAjhWz7sgcE9OwLuSC6hsM+BfHs2Q==", uint64_t{0xafafc44961078ecb},
+       uint64_t{0x229c292ea7a08285}},
+      {"ZzO3mVCj4xTT2TT3XqDyEKj2BZQBvrS8RHg=", uint64_t{0x4f7bb45549250094},
+       uint64_t{0xbb4bf0692d14bae}},
+      {"+klp5iPQGtppan5MflEls0iEUzqU+zGZkDJX", uint64_t{0xa30061abaa2818c},
+       uint64_t{0x207b24ca3bdac1db}},
+      {"RO6bvOnlJc8I9eniXlNgqtKy0IX6VNg16NRmgg==", uint64_t{0xd902ee3e44a5705f},
+       uint64_t{0x64f6cd6745d3825b}},
+      {"ZJjZqId1ZXBaij9igClE3nyliU5XWdNRrayGlYA=", uint64_t{0x316d36da516f583},
+       uint64_t{0xa2b2e1656b58df1e}},
+      {"7BfkhfGMDGbxfMB8uyL85GbaYQtjr2K8g7RpLzr/", uint64_t{0x402d83f9f834f616},
+       uint64_t{0xd01d30d9ee7a148}},
+      {"rycWk6wHH7htETQtje9PidS2YzXBx+Qkg2fY7ZYS7A==",
+       uint64_t{0x9c604164c016b72c}, uint64_t{0x1cb4cd00ab804e3b}},
+      {"RTkC2OUK+J13CdGllsH0H5WqgspsSa6QzRZouqx6pvI=",
+       uint64_t{0x3f4507e01f9e73ba}, uint64_t{0x4697f2637fd90999}},
+      {"tKjKmbLCNyrLCM9hycOAXm4DKNpM12oZ7dLTmUx5iwAi",
+       uint64_t{0xc3fe0d5be8d2c7c7}, uint64_t{0x8383a756b5688c07}},
+      {"VprUGNH+5NnNRaORxgH/ySrZFQFDL+4VAodhfBNinmn8cg==",
+       uint64_t{0x531858a40bfa7ea1}, uint64_t{0x695c29cb3696a975}},
+      {"gc1xZaY+q0nPcUvOOnWnT3bqfmT/geth/f7Dm2e/DemMfk4=",
+       uint64_t{0x86689478a7a7e8fa}, uint64_t{0xda2e5a5a5e971521}},
+      {"Mr35fIxqx1ukPAL0su1yFuzzAU3wABCLZ8+ZUFsXn47UmAph",
+       uint64_t{0x4ec948b8e7f27288}, uint64_t{0x7935d4befa056b2b}},
+      {"A9G8pw2+m7+rDtWYAdbl8tb2fT7FFo4hLi2vAsa5Y8mKH3CX3g==",
+       uint64_t{0xce46c7213c10032}, uint64_t{0x38dd541ca95420fe}},
+      {"DFaJGishGwEHDdj9ixbCoaTjz9KS0phLNWHVVdFsM93CvPft3hM=",
+       uint64_t{0xf63e96ee6f32a8b6}, uint64_t{0xcc06c7a4963f967f}},
+      {"7+Ugx+Kr3aRNgYgcUxru62YkTDt5Hqis+2po81hGBkcrJg4N0uuy",
+       uint64_t{0x1cfe85e65fc5225}, uint64_t{0xbf0f6f66e232fb20}},
+      {"H2w6O8BUKqu6Tvj2xxaecxEI2wRgIgqnTTG1WwOgDSINR13Nm4d4Vg==",
+       uint64_t{0x45c474f1cee1d2e8}, uint64_t{0xf7efb32d373fe71a}},
+      {"1XBMnIbqD5jy65xTDaf6WtiwtdtQwv1dCVoqpeKj+7cTR1SaMWMyI04=",
+       uint64_t{0x6e024e14015f329c}, uint64_t{0xe2e64634b1c12660}},
+      {"znZbdXG2TSFrKHEuJc83gPncYpzXGbAebUpP0XxzH0rpe8BaMQ17nDbt",
+       uint64_t{0x760c40502103ae1c}, uint64_t{0x285b8fd1638e306d}},
+      {"ylu8Atu13j1StlcC1MRMJJXIl7USgDDS22HgVv0WQ8hx/8pNtaiKB17hCQ==",
+       uint64_t{0x17fd05c3c560c320}, uint64_t{0x658e8a4e3b714d6c}},
+      {"M6ZVVzsd7vAvbiACSYHioH/440dp4xG2mLlBnxgiqEvI/aIEGpD0Sf4VS0g=",
+       uint64_t{0x8b34200a6f8e90d9}, uint64_t{0xf391fb968e0eb398}},
+      {"li3oFSXLXI+ubUVGJ4blP6mNinGKLHWkvGruun85AhVn6iuMtocbZPVhqxzn",
+       uint64_t{0x6be89e50818bdf69}, uint64_t{0x744a9ea0cc144bf2}},
+      {"kFuQHuUCqBF3Tc3hO4dgdIp223ShaCoog48d5Do5zMqUXOh5XpGK1t5XtxnfGA==",
+       uint64_t{0xfb389773315b47d8}, uint64_t{0x12636f2be11012f1}},
+      {"jWmOad0v0QhXVJd1OdGuBZtDYYS8wBVHlvOeTQx9ZZnm8wLEItPMeihj72E0nWY=",
+       uint64_t{0x4f2512a23f61efee}, uint64_t{0x29c57de825948f80}},
+      {"z+DHU52HaOQdW4JrZwDQAebEA6rm13Zg/9lPYA3txt3NjTBqFZlOMvTRnVzRbl23",
+       uint64_t{0x59ccd92fc16c6fda}, uint64_t{0x58c6f99ab0d1c021}},
+      {"MmBiGDfYeTayyJa/tVycg+rN7f9mPDFaDc+23j0TlW9094er0ADigsl4QX7V3gG/qw==",
+       uint64_t{0x25c5a7f5bd330919}, uint64_t{0x13e7b5a7b82fe3bb}},
+      {"774RK+9rOL4iFvs1q2qpo/JVc/I39buvNjqEFDtDvyoB0FXxPI2vXqOrk08VPfIHkmU=",
+       uint64_t{0x51df4174d34c97d7}, uint64_t{0x10fbc87901e02b63}},
+      {"+slatXiQ7/2lK0BkVUI1qzNxOOLP3I1iK6OfHaoxgqT63FpzbElwEXSwdsryq3UlHK0I",
+       uint64_t{0x80ce6d76f89cb57}, uint64_t{0xa24c9184901b748b}},
+      {"64mVTbQ47dHjHlOHGS/hjJwr/"
+       "K2frCNpn87exOqMzNUVYiPKmhCbfS7vBUce5tO6Ec9osQ==",
+       uint64_t{0x20961c911965f684}, uint64_t{0xcac4fd4c5080e581}},
+      {"fIsaG1r530SFrBqaDj1kqE0AJnvvK8MNEZbII2Yw1OK77v0V59xabIh0B5axaz/"
+       "+a2V5WpA=",
+       uint64_t{0x4e5b926ec83868e7}, uint64_t{0xc38bdb7483ba68e1}},
+      {"PGih0zDEOWCYGxuHGDFu9Ivbff/"
+       "iE7BNUq65tycTR2R76TerrXALRosnzaNYO5fjFhTi+CiS",
+       uint64_t{0x3927b30b922eecef}, uint64_t{0xdb2a8069b2ceaffa}},
+      {"RnpA/"
+       "zJnEnnLjmICORByRVb9bCOgxF44p3VMiW10G7PvW7IhwsWajlP9kIwNA9FjAD2GoQHk2Q="
+       "=",
+       uint64_t{0xbd0291284a49b61c}, uint64_t{0xdf9fe91d0d1c7887}},
+      {"qFklMceaTHqJpy2qavJE+EVBiNFOi6OxjOA3LeIcBop1K7w8xQi3TrDk+"
+       "BrWPRIbfprszSaPfrI=",
+       uint64_t{0x73a77c575bcc956}, uint64_t{0xe83f49e96e2e6a08}},
+      {"cLbfUtLl3EcQmITWoTskUR8da/VafRDYF/ylPYwk7/"
+       "zazk6ssyrzxMN3mmSyvrXR2yDGNZ3WDrTT",
+       uint64_t{0x766a0e2ade6d09a6}, uint64_t{0xc69e61b62ca2b62}},
+      {"s/"
+       "Jf1+"
+       "FbsbCpXWPTUSeWyMH6e4CvTFvPE5Fs6Z8hvFITGyr0dtukHzkI84oviVLxhM1xMxrMAy1db"
+       "w==",
+       uint64_t{0x2599f4f905115869}, uint64_t{0xb4a4f3f85f8298fe}},
+      {"FvyQ00+j7nmYZVQ8hI1Edxd0AWplhTfWuFGiu34AK5X8u2hLX1bE97sZM0CmeLe+"
+       "7LgoUT1fJ/axybE=",
+       uint64_t{0xd8256e5444d21e53}, uint64_t{0x167a1b39e1e95f41}},
+      {"L8ncxMaYLBH3g9buPu8hfpWZNlOF7nvWLNv9IozH07uQsIBWSKxoPy8+"
+       "LW4tTuzC6CIWbRGRRD1sQV/4",
+       uint64_t{0xf664a91333fb8dfd}, uint64_t{0xf8a2a5649855ee41}},
+      {"CDK0meI07yrgV2kQlZZ+"
+       "wuVqhc2NmzqeLH7bmcA6kchsRWFPeVF5Wqjjaj556ABeUoUr3yBmfU3kWOakkg==",
+       uint64_t{0x9625b859be372cd1}, uint64_t{0x27992565b595c498}},
+      {"d23/vc5ONh/"
+       "HkMiq+gYk4gaCNYyuFKwUkvn46t+dfVcKfBTYykr4kdvAPNXGYLjM4u1YkAEFpJP+"
+       "nX7eOvs=",
+       uint64_t{0x7b99940782e29898}, uint64_t{0x3e08cca5b71f9346}},
+      {"NUR3SRxBkxTSbtQORJpu/GdR6b/h6sSGfsMj/KFd99ahbh+9r7LSgSGmkGVB/"
+       "mGoT0pnMTQst7Lv2q6QN6Vm",
+       uint64_t{0x4fe12fa5383b51a8}, uint64_t{0xad406b10c770a6d2}},
+      {"2BOFlcI3Z0RYDtS9T9Ie9yJoXlOdigpPeeT+CRujb/"
+       "O39Ih5LPC9hP6RQk1kYESGyaLZZi3jtabHs7DiVx/VDg==",
+       uint64_t{0xe2ccb09ac0f5b4b6}, uint64_t{0xd1713ce6e552bcf2}},
+      {"FF2HQE1FxEvWBpg6Z9zAMH+Zlqx8S1JD/"
+       "wIlViL6ZDZY63alMDrxB0GJQahmAtjlm26RGLnjW7jmgQ4Ie3I+014=",
+       uint64_t{0x7d0a37adbd7b753b}, uint64_t{0x753b287194c73ad3}},
+      {"tHmO7mqVL/PX11nZrz50Hc+M17Poj5lpnqHkEN+4bpMx/"
+       "YGbkrGOaYjoQjgmt1X2QyypK7xClFrjeWrCMdlVYtbW",
+       uint64_t{0xd3ae96ef9f7185f2}, uint64_t{0x5ae41a95f600af1c}},
+      {"/WiHi9IQcxRImsudkA/KOTqGe8/"
+       "gXkhKIHkjddv5S9hi02M049dIK3EUyAEjkjpdGLUs+BN0QzPtZqjIYPOgwsYE9g==",
+       uint64_t{0x4fb88ea63f79a0d8}, uint64_t{0x4a61163b86a8bb4c}},
+      {"qds+1ExSnU11L4fTSDz/QE90g4Jh6ioqSh3KDOTOAo2pQGL1k/"
+       "9CCC7J23YF27dUTzrWsCQA2m4epXoCc3yPHb3xElA=",
+       uint64_t{0xed564e259bb5ebe9}, uint64_t{0x42eeaa79e760c7e4}},
+      {"8FVYHx40lSQPTHheh08Oq0/"
+       "pGm2OlG8BEf8ezvAxHuGGdgCkqpXIueJBF2mQJhTfDy5NncO8ntS7vaKs7sCNdDaNGOEi",
+       uint64_t{0x3e3256b60c428000}, uint64_t{0x698df622ef465b0a}},
+      {"4ZoEIrJtstiCkeew3oRzmyJHVt/pAs2pj0HgHFrBPztbQ10NsQ/"
+       "lM6DM439QVxpznnBSiHMgMQJhER+70l72LqFTO1JiIQ==",
+       uint64_t{0xfb05bad59ec8705}, uint64_t{0x157583111e1a6026}},
+      {"hQPtaYI+wJyxXgwD5n8jGIKFKaFA/"
+       "P83KqCKZfPthnjwdOFysqEOYwAaZuaaiv4cDyi9TyS8hk5cEbNP/jrI7q6pYGBLbsM=",
+       uint64_t{0xafdc251dbf97b5f8}, uint64_t{0xaa1388f078e793e0}},
+      {"S4gpMSKzMD7CWPsSfLeYyhSpfWOntyuVZdX1xSBjiGvsspwOZcxNKCRIOqAA0moUfOh3I5+"
+       "juQV4rsqYElMD/gWfDGpsWZKQ",
+       uint64_t{0x10ec9c92ddb5dcbc}, uint64_t{0xf10d68d0f3309360}},
+      {"oswxop+"
+       "bthuDLT4j0PcoSKby4LhF47ZKg8K17xxHf74UsGCzTBbOz0MM8hQEGlyqDT1iUiAYnaPaUp"
+       "L2mRK0rcIUYA4qLt5uOw==",
+       uint64_t{0x9a767d5822c7dac4}, uint64_t{0x2af056184457a3de}},
+      {"0II/"
+       "697p+"
+       "BtLSjxj5989OXI004TogEb94VUnDzOVSgMXie72cuYRvTFNIBgtXlKfkiUjeqVpd4a+"
+       "n5bxNOD1TGrjQtzKU5r7obo=",
+       uint64_t{0xee46254080d6e2db}, uint64_t{0x6d0058e1590b2489}},
+      {"E84YZW2qipAlMPmctrg7TKlwLZ68l4L+c0xRDUfyyFrA4MAti0q9sHq3TDFviH0Y+"
+       "Kq3tEE5srWFA8LM9oomtmvm5PYxoaarWPLc",
+       uint64_t{0xbbb669588d8bf398}, uint64_t{0x638f287f68817f12}},
+      {"x3pa4HIElyZG0Nj7Vdy9IdJIR4izLmypXw5PCmZB5y68QQ4uRaVVi3UthsoJROvbjDJkP2D"
+       "Q6L/eN8pFeLFzNPKBYzcmuMOb5Ull7w==",
+       uint64_t{0xdc2afaa529beef44}, uint64_t{0xc46b71fecefd5467}},
+      {"jVDKGYIuWOP/"
+       "QKLdd2wi8B2VJA8Wh0c8PwrXJVM8FOGM3voPDVPyDJOU6QsBDPseoR8uuKd19OZ/"
+       "zAvSCB+zlf6upAsBlheUKgCfKww=",
+       uint64_t{0xf1f67391d45013a8}, uint64_t{0x2c8e94679d964e0a}},
+      {"mkquunhmYe1aR2wmUz4vcvLEcKBoe6H+kjUok9VUn2+eTSkWs4oDDtJvNCWtY5efJwg/"
+       "j4PgjRYWtqnrCkhaqJaEvkkOwVfgMIwF3e+d",
+       uint64_t{0x16fce2b8c65a3429}, uint64_t{0x8612b797ce22503a}},
+      {"fRelvKYonTQ+s+rnnvQw+JzGfFoPixtna0vzcSjiDqX5s2Kg2//"
+       "UGrK+AVCyMUhO98WoB1DDbrsOYSw2QzrcPe0+3ck9sePvb+Q/IRaHbw==",
+       uint64_t{0xf4b096699f49fe67}, uint64_t{0x59f929babfba7170}},
+      {"DUwXFJzagljo44QeJ7/"
+       "6ZKw4QXV18lhkYT2jglMr8WB3CHUU4vdsytvw6AKv42ZcG6fRkZkq9fpnmXy6xG0aO3WPT1"
+       "eHuyFirAlkW+zKtwg=",
+       uint64_t{0xca584c4bc8198682}, uint64_t{0x9527556923fb49a0}},
+      {"cYmZCrOOBBongNTr7e4nYn52uQUy2mfe48s50JXx2AZ6cRAt/"
+       "xRHJ5QbEoEJOeOHsJyM4nbzwFm++SlT6gFZZHJpkXJ92JkR86uS/eV1hJUR",
+       uint64_t{0xed269fc3818b6aad}, uint64_t{0x1039ab644f5e150b}},
+      {"EXeHBDfhwzAKFhsMcH9+2RHwV+mJaN01+9oacF6vgm8mCXRd6jeN9U2oAb0of5c5cO4i+"
+       "Vb/LlHZSMI490SnHU0bejhSCC2gsC5d2K30ER3iNA==",
+       uint64_t{0x33f253cbb8fe66a8}, uint64_t{0x7816c83f3aa05e6d}},
+      {"FzkzRYoNjkxFhZDso94IHRZaJUP61nFYrh5MwDwv9FNoJ5jyNCY/"
+       "eazPZk+tbmzDyJIGw2h3GxaWZ9bSlsol/vK98SbkMKCQ/wbfrXRLcDzdd/8=",
+       uint64_t{0xd0b76b2c1523d99c}, uint64_t{0xf51d2f564518c619}},
+      {"Re4aXISCMlYY/XsX7zkIFR04ta03u4zkL9dVbLXMa/q6hlY/CImVIIYRN3VKP4pnd0AUr/"
+       "ugkyt36JcstAInb4h9rpAGQ7GMVOgBniiMBZ/MGU7H",
+       uint64_t{0xfd28f0811a2a237f}, uint64_t{0x67d494cff03ac004}},
+      {"ueLyMcqJXX+MhO4UApylCN9WlTQ+"
+       "ltJmItgG7vFUtqs2qNwBMjmAvr5u0sAKd8jpzV0dDPTwchbIeAW5zbtkA2NABJV6hFM48ib"
+       "4/J3A5mseA3cS8w==",
+       uint64_t{0x6261fb136482e84}, uint64_t{0x2802d636ced1cfbb}},
+      {"6Si7Yi11L+jZMkwaN+GUuzXMrlvEqviEkGOilNq0h8TdQyYKuFXzkYc/"
+       "q74gP3pVCyiwz9KpVGMM9vfnq36riMHRknkmhQutxLZs5fbmOgEO69HglCU=",
+       uint64_t{0x458efc750bca7c3a}, uint64_t{0xf64e20bad771cb12}},
+      {"Q6AbOofGuTJOegPh9Clm/"
+       "9crtUMQqylKrTc1fhfJo1tqvpXxhU4k08kntL1RG7woRnFrVh2UoMrL1kjin+s9CanT+"
+       "y4hHwLqRranl9FjvxfVKm3yvg68",
+       uint64_t{0xa7e69ff84e5e7c27}, uint64_t{0xb9a6cf84a83e15e}},
+      {"ieQEbIPvqY2YfIjHnqfJiO1/MIVRk0RoaG/WWi3kFrfIGiNLCczYoklgaecHMm/"
+       "1sZ96AjO+a5stQfZbJQwS7Sc1ODABEdJKcTsxeW2hbh9A6CFzpowP1A==",
+       uint64_t{0x3c59bfd0c29efe9e}, uint64_t{0x8da6630319609301}},
+      {"zQUv8hFB3zh2GGl3KTvCmnfzE+"
+       "SUgQPVaSVIELFX5H9cE3FuVFGmymkPQZJLAyzC90Cmi8GqYCvPqTuAAB//"
+       "XTJxy4bCcVArgZG9zJXpjowpNBfr3ngWrSE=",
+       uint64_t{0x10befacc6afd298d}, uint64_t{0x40946a86e2a996f3}},
+      {"US4hcC1+op5JKGC7eIs8CUgInjKWKlvKQkapulxW262E/"
+       "B2ye79QxOexf188u2mFwwe3WTISJHRZzS61IwljqAWAWoBAqkUnW8SHmIDwHUP31J0p5sGd"
+       "P47L",
+       uint64_t{0x41d5320b0a38efa7}, uint64_t{0xcab7f5997953fa76}},
+      {"9bHUWFna2LNaGF6fQLlkx1Hkt24nrkLE2CmFdWgTQV3FFbUe747SSqYw6ebpTa07MWSpWRP"
+       "sHesVo2B9tqHbe7eQmqYebPDFnNqrhSdZwFm9arLQVs+7a3Ic6A==",
+       uint64_t{0x58db1c7450fe17f3}, uint64_t{0x39129ca0e04fc465}},
+      {"Kb3DpHRUPhtyqgs3RuXjzA08jGb59hjKTOeFt1qhoINfYyfTt2buKhD6YVffRCPsgK9SeqZ"
+       "qRPJSyaqsa0ovyq1WnWW8jI/NhvAkZTVHUrX2pC+cD3OPYT05Dag=",
+       uint64_t{0x6098c055a335b7a6}, uint64_t{0x5238221fd685e1b8}},
+      {"gzxyMJIPlU+bJBwhFUCHSofZ/"
+       "319LxqMoqnt3+L6h2U2+ZXJCSsYpE80xmR0Ta77Jq54o92SMH87HV8dGOaCTuAYF+"
+       "lDL42SY1P316Cl0sZTS2ow3ZqwGbcPNs/1",
+       uint64_t{0x1bbacec67845a801}, uint64_t{0x175130c407dbcaab}},
+      {"uR7V0TW+FGVMpsifnaBAQ3IGlr1wx5sKd7TChuqRe6OvUXTlD4hKWy8S+"
+       "8yyOw8lQabism19vOQxfmocEOW/"
+       "vzY0pEa87qHrAZy4s9fH2Bltu8vaOIe+agYohhYORQ==",
+       uint64_t{0xc419cfc7442190}, uint64_t{0x2f20e7536c0b0df}},
+      {"1UR5eoo2aCwhacjZHaCh9bkOsITp6QunUxHQ2SfeHv0imHetzt/"
+       "Z70mhyWZBalv6eAx+YfWKCUib2SHDtz/"
+       "A2dc3hqUWX5VfAV7FQsghPUAtu6IiRatq4YSLpDvKZBQ=",
+       uint64_t{0xc95e510d94ba270c}, uint64_t{0x2742cb488a04ad56}},
+      {"opubR7H63BH7OtY+Avd7QyQ25UZ8kLBdFDsBTwZlY6gA/"
+       "u+x+"
+       "czC9AaZMgmQrUy15DH7YMGsvdXnviTtI4eVI4aF1H9Rl3NXMKZgwFOsdTfdcZeeHVRzBBKX"
+       "8jUfh1il",
+       uint64_t{0xff1ae05c98089c3f}, uint64_t{0xd6afb593879ff93b}},
+      {"DC0kXcSXtfQ9FbSRwirIn5tgPri0sbzHSa78aDZVDUKCMaBGyFU6BmrulywYX8yzvwprdLs"
+       "oOwTWN2wMjHlPDqrvVHNEjnmufRDblW+nSS+xtKNs3N5xsxXdv6JXDrAB/Q==",
+       uint64_t{0x90c02b8dceced493}, uint64_t{0xf50ad64caac0ca7f}},
+      {"BXRBk+3wEP3Lpm1y75wjoz+PgB0AMzLe8tQ1AYU2/"
+       "oqrQB2YMC6W+9QDbcOfkGbeH+b7IBkt/"
+       "gwCMw2HaQsRFEsurXtcQ3YwRuPz5XNaw5NAvrNa67Fm7eRzdE1+hWLKtA8=",
+       uint64_t{0x9f8a76697ab1aa36}, uint64_t{0x2ade95c4261364ae}},
+      {"RRBSvEGYnzR9E45Aps/+WSnpCo/X7gJLO4DRnUqFrJCV/kzWlusLE/"
+       "6ZU6RoUf2ROwcgEvUiXTGjLs7ts3t9SXnJHxC1KiOzxHdYLMhVvgNd3hVSAXODpKFSkVXND"
+       "55G2L1W",
+       uint64_t{0x6ba1bf3d811a531d}, uint64_t{0x5c4f3299faacd07a}},
+      {"jeh6Qazxmdi57pa9S3XSnnZFIRrnc6s8QLrah5OX3SB/V2ErSPoEAumavzQPkdKF1/"
+       "SfvmdL+qgF1C+Yawy562QaFqwVGq7+tW0yxP8FStb56ZRgNI4IOmI30s1Ei7iops9Uuw==",
+       uint64_t{0x6a418974109c67b4}, uint64_t{0xfffe3bff0ae5e9bc}},
+      {"6QO5nnDrY2/"
+       "wrUXpltlKy2dSBcmK15fOY092CR7KxAjNfaY+"
+       "aAmtWbbzQk3MjBg03x39afSUN1fkrWACdyQKRaGxgwq6MGNxI6W+8DLWJBHzIXrntrE/"
+       "ml6fnNXEpxplWJ1vEs4=",
+       uint64_t{0x8472f1c2b3d230a3}, uint64_t{0x1db785c0005166e4}},
+      {"0oPxeEHhqhcFuwonNfLd5jF3RNATGZS6NPoS0WklnzyokbTqcl4BeBkMn07+fDQv83j/"
+       "BpGUwcWO05f3+DYzocfnizpFjLJemFGsls3gxcBYxcbqWYev51tG3lN9EvRE+X9+Pwww",
+       uint64_t{0x5e06068f884e73a7}, uint64_t{0xea000d962ad18418}},
+      {"naSBSjtOKgAOg8XVbR5cHAW3Y+QL4Pb/JO9/"
+       "oy6L08wvVRZqo0BrssMwhzBP401Um7A4ppAupbQeJFdMrysY34AuSSNvtNUy5VxjNECwiNt"
+       "gwYHw7yakDUv8WvonctmnoSPKENegQg==",
+       uint64_t{0x55290b1a8f170f59}, uint64_t{0xe42aef38359362d9}},
+      {"vPyl8DxVeRe1OpilKb9KNwpGkQRtA94UpAHetNh+"
+       "95V7nIW38v7PpzhnTWIml5kw3So1Si0TXtIUPIbsu32BNhoH7QwFvLM+"
+       "JACgSpc5e3RjsL6Qwxxi11npwxRmRUqATDeMUfRAjxg=",
+       uint64_t{0x5501cfd83dfe706a}, uint64_t{0xc8e95657348a3891}},
+      {"QC9i2GjdTMuNC1xQJ74ngKfrlA4w3o58FhvNCltdIpuMhHP1YsDA78scQPLbZ3OCUgeQguY"
+       "f/vw6zAaVKSgwtaykqg5ka/4vhz4hYqWU5ficdXqClHl+zkWEY26slCNYOM5nnDlly8Cj",
+       uint64_t{0xe43ed13d13a66990}, uint64_t{0xc162eca864f238c6}},
+      {"7CNIgQhAHX27nxI0HeB5oUTnTdgKpRDYDKwRcXfSFGP1XeT9nQF6WKCMjL1tBV6x7KuJ91G"
+       "Zz11F4c+8s+MfqEAEpd4FHzamrMNjGcjCyrVtU6y+7HscMVzr7Q/"
+       "ODLcPEFztFnwjvCjmHw==",
+       uint64_t{0xdf43bc375cf5283f}, uint64_t{0xbe1fb373e20579ad}},
+      {"Qa/hC2RPXhANSospe+gUaPfjdK/yhQvfm4cCV6/pdvCYWPv8p1kMtKOX3h5/"
+       "8oZ31fsmx4Axphu5qXJokuhZKkBUJueuMpxRyXpwSWz2wELx5glxF7CM0Fn+"
+       "OevnkhUn5jsPlG2r5jYlVn8=",
+       uint64_t{0x8112b806d288d7b5}, uint64_t{0x628a1d4f40aa6ffd}},
+      {"kUw/0z4l3a89jTwN5jpG0SHY5km/"
+       "IVhTjgM5xCiPRLncg40aqWrJ5vcF891AOq5hEpSq0bUCJUMFXgct7kvnys905HjerV7Vs1G"
+       "y84tgVJ70/2+pAZTsB/PzNOE/G6sOj4+GbTzkQu819OLB",
+       uint64_t{0xd52a18abb001cb46}, uint64_t{0xa87bdb7456340f90}},
+      {"VDdfSDbO8Tdj3T5W0XM3EI7iHh5xpIutiM6dvcJ/fhe23V/srFEkDy5iZf/"
+       "VnA9kfi2C79ENnFnbOReeuZW1b3MUXB9lgC6U4pOTuC+"
+       "jHK3Qnpyiqzj7h3ISJSuo2pob7vY6VHZo6Fn7exEqHg==",
+       uint64_t{0xe12b76a2433a1236}, uint64_t{0x5960ef3ba982c801}},
+      {"Ldfvy3ORdquM/R2fIkhH/ONi69mcP1AEJ6n/"
+       "oropwecAsLJzQSgezSY8bEiEs0VnFTBBsW+RtZY6tDj03fnb3amNUOq1b7jbqyQkL9hpl+"
+       "2Z2J8IaVSeownWl+bQcsR5/xRktIMckC5AtF4YHfU=",
+       uint64_t{0x175bf7319cf1fa00}, uint64_t{0x5026586df9a431ec}},
+      {"BrbNpb42+"
+       "VzZAjJw6QLirXzhweCVRfwlczzZ0VX2xluskwBqyfnGovz5EuX79JJ31VNXa5hTkAyQat3l"
+       "YKRADTdAdwE5PqM1N7YaMqqsqoAAAeuYVXuk5eWCykYmClNdSspegwgCuT+403JigBzi",
+       uint64_t{0xd63d57b3f67525ae}, uint64_t{0xfe4b8a20fdf0840b}},
+      {"gB3NGHJJvVcuPyF0ZSvHwnWSIfmaI7La24VMPQVoIIWF7Z74NltPZZpx2f+cocESM+"
+       "ILzQW9p+BC8x5IWz7N4Str2WLGKMdgmaBfNkEhSHQDU0IJEOnpUt0HmjhFaBlx0/"
+       "LTmhua+rQ6Wup8ezLwfg==",
+       uint64_t{0x933faea858832b73}, uint64_t{0xdcb761867da7072f}},
+      {"hTKHlRxx6Pl4gjG+6ksvvj0CWFicUg3WrPdSJypDpq91LUWRni2KF6+"
+       "81ZoHBFhEBrCdogKqeK+hy9bLDnx7g6rAFUjtn1+cWzQ2YjiOpz4+"
+       "ROBB7lnwjyTGWzJD1rXtlso1g2qVH8XJVigC5M9AIxM=",
+       uint64_t{0x53d061e5f8e7c04f}, uint64_t{0xc10d4653667275b7}},
+      {"IWQBelSQnhrr0F3BhUpXUIDauhX6f95Qp+A0diFXiUK7irwPG1oqBiqHyK/SH/"
+       "9S+"
+       "rln9DlFROAmeFdH0OCJi2tFm4afxYzJTFR4HnR4cG4x12JqHaZLQx6iiu6CE3rtWBVz99oA"
+       "wCZUOEXIsLU24o2Y",
+       uint64_t{0xdb4124556dd515e0}, uint64_t{0x727720deec13110b}},
+      {"TKo+l+"
+       "1dOXdLvIrFqeLaHdm0HZnbcdEgOoLVcGRiCbAMR0j5pIFw8D36tefckAS1RCFOH5IgP8yiF"
+       "T0Gd0a2hI3+"
+       "fTKA7iK96NekxWeoeqzJyctc6QsoiyBlkZerRxs5RplrxoeNg29kKDTM0K94mnhD9g==",
+       uint64_t{0x4fb31a0dd681ee71}, uint64_t{0x710b009662858dc9}},
+      {"YU4e7G6EfQYvxCFoCrrT0EFgVLHFfOWRTJQJ5gxM3G2b+"
+       "1kJf9YPrpsxF6Xr6nYtS8reEEbDoZJYqnlk9lXSkVArm88Cqn6d25VCx3+"
+       "49MqC0trIlXtb7SXUUhwpJK16T0hJUfPH7s5cMZXc6YmmbFuBNPE=",
+       uint64_t{0x27cc72eefa138e4c}, uint64_t{0xfbf8f7a3ecac1eb7}},
+      {"/I/"
+       "eImMwPo1U6wekNFD1Jxjk9XQVi1D+"
+       "FPdqcHifYXQuP5aScNQfxMAmaPR2XhuOQhADV5tTVbBKwCDCX4E3jcDNHzCiPvViZF1W27t"
+       "xaf2BbFQdwKrNCmrtzcluBFYu0XZfc7RU1RmxK/RtnF1qHsq/O4pp",
+       uint64_t{0x44bc2dfba4bd3ced}, uint64_t{0xb6fc4fcd0722e3df}},
+      {"CJTT9WGcY2XykTdo8KodRIA29qsqY0iHzWZRjKHb9alwyJ7RZAE3V5Juv4MY3MeYEr1EPCC"
+       "MxO7yFXqT8XA8YTjaMp3bafRt17Pw8JC4iKJ1zN+WWKOESrj+"
+       "3aluGQqn8z1EzqY4PH7rLG575PYeWsP98BugdA==",
+       uint64_t{0x242da1e3a439bed8}, uint64_t{0x7cb86dcc55104aac}},
+      {"ZlhyQwLhXQyIUEnMH/"
+       "AEW27vh9xrbNKJxpWGtrEmKhd+nFqAfbeNBQjW0SfG1YI0xQkQMHXjuTt4P/"
+       "EpZRtA47ibZDVS8TtaxwyBjuIDwqcN09eCtpC+Ls+"
+       "vWDTLmBeDM3u4hmzz4DQAYsLiZYSJcldg9Q3wszw=",
+       uint64_t{0xdc559c746e35c139}, uint64_t{0x19e71e9b45c3a51e}},
+      {"v2KU8y0sCrBghmnm8lzGJlwo6D6ObccAxCf10heoDtYLosk4ztTpLlpSFEyu23MLA1tJkcg"
+       "Rko04h19QMG0mOw/"
+       "wc93EXAweriBqXfvdaP85sZABwiKO+6rtS9pacRVpYYhHJeVTQ5NzrvBvi1huxAr+"
+       "xswhVMfL",
+       uint64_t{0xd0b0350275b9989}, uint64_t{0x51de38573c2bea48}},
+      {"QhKlnIS6BuVCTQsnoE67E/"
+       "yrgogE8EwO7xLaEGei26m0gEU4OksefJgppDh3X0x0Cs78Dr9IHK5b977CmZlrTRmwhlP8p"
+       "M+UzXPNRNIZuN3ntOum/QhUWP8SGpirheXENWsXMQ/"
+       "nxtxakyEtrNkKk471Oov9juP8oQ==",
+       uint64_t{0xb04489e41d17730c}, uint64_t{0xa73ab6996d6df158}},
+      {"/ZRMgnoRt+Uo6fUPr9FqQvKX7syhgVqWu+"
+       "WUSsiQ68UlN0efSP6Eced5gJZL6tg9gcYJIkhjuQNITU0Q3TjVAnAcobgbJikCn6qZ6pRxK"
+       "BY4MTiAlfGD3T7R7hwJwx554MAy++Zb/YUFlnCaCJiwQMnowF7aQzwYFCo=",
+       uint64_t{0x2217285eb4572156}, uint64_t{0x55ef2b8c930817b2}},
+      {"NB7tU5fNE8nI+SXGfipc7sRkhnSkUF1krjeo6k+8FITaAtdyz+"
+       "o7mONgXmGLulBPH9bEwyYhKNVY0L+njNQrZ9YC2aXsFD3PdZsxAFaBT3VXEzh+"
+       "NGBTjDASNL3mXyS8Yv1iThGfHoY7T4aR0NYGJ+k+pR6f+KrPC96M",
+       uint64_t{0x12c2e8e68aede73b}, uint64_t{0xb2850bf5fae87157}},
+      {"8T6wrqCtEO6/rwxF6lvMeyuigVOLwPipX/FULvwyu+1wa5sQGav/"
+       "2FsLHUVn6cGSi0LlFwLewGHPFJDLR0u4t7ZUyM//"
+       "x6da0sWgOa5hzDqjsVGmjxEHXiaXKW3i4iSZNuxoNbMQkIbVML+"
+       "DkYu9ND0O2swg4itGeVSzXA==",
+       uint64_t{0x4d612125bdc4fd00}, uint64_t{0xecf3de1acd04651f}},
+      {"Ntf1bMRdondtMv1CYr3G80iDJ4WSAlKy5H34XdGruQiCrnRGDBa+"
+       "eUi7vKp4gp3BBcVGl8eYSasVQQjn7MLvb3BjtXx6c/"
+       "bCL7JtpzQKaDnPr9GWRxpBXVxKREgMM7d8lm35EODv0w+"
+       "hQLfVSh8OGs7fsBb68nNWPLeeSOo=",
+       uint64_t{0x81826b553954464e}, uint64_t{0xcc0a40552559ff32}},
+      {"VsSAw72Ro6xks02kaiLuiTEIWBC5bgqr4WDnmP8vglXzAhixk7td926rm9jNimL+"
+       "kroPSygZ9gl63aF5DCPOACXmsbmhDrAQuUzoh9ZKhWgElLQsrqo1KIjWoZT5b5QfVUXY9lS"
+       "IBg3U75SqORoTPq7HalxxoIT5diWOcJQi",
+       uint64_t{0xc2e5d345dc0ddd2d}, uint64_t{0xc385c374f20315b1}},
+      {"j+loZ+C87+"
+       "bJxNVebg94gU0mSLeDulcHs84tQT7BZM2rzDSLiCNxUedHr1ZWJ9ejTiBa0dqy2I2ABc++"
+       "xzOLcv+//YfibtjKtYggC6/3rv0XCc7xu6d/"
+       "O6xO+XOBhOWAQ+IHJVHf7wZnDxIXB8AUHsnjEISKj7823biqXjyP3g==",
+       uint64_t{0x3da6830a9e32631e}, uint64_t{0xb90208a4c7234183}},
+      {"f3LlpcPElMkspNtDq5xXyWU62erEaKn7RWKlo540gR6mZsNpK1czV/"
+       "sOmqaq8XAQLEn68LKj6/"
+       "cFkJukxRzCa4OF1a7cCAXYFp9+wZDu0bw4y63qbpjhdCl8GO6Z2lkcXy7KOzbPE01ukg7+"
+       "gN+7uKpoohgAhIwpAKQXmX5xtd0=",
+       uint64_t{0xc9ae5c8759b4877a}, uint64_t{0x58aa1ca7a4c075d9}},
+  };
+
+  for (const auto& expected_result : expected_results) {
+    std::string str;
+    ASSERT_TRUE(absl::Base64Unescape(expected_result.base64_data, &str));
+    EXPECT_EQ(absl::hash_internal::Wyhash(str.data(), str.size(),
+                                          expected_result.seed, kSalt),
+              expected_result.hash);
+  }
+}
+
+}  // namespace
diff --git a/third_party/abseil-cpp/absl/meta/type_traits.h b/third_party/abseil-cpp/absl/meta/type_traits.h
index 75689bb6..d5cb5f3be 100644
--- a/third_party/abseil-cpp/absl/meta/type_traits.h
+++ b/third_party/abseil-cpp/absl/meta/type_traits.h
@@ -610,8 +610,22 @@
 template <typename T>
 using underlying_type_t = typename std::underlying_type<T>::type;
 
-template <typename T>
-using result_of_t = typename std::result_of<T>::type;
+
+namespace type_traits_internal {
+
+#if __cplusplus >= 201703L
+// std::result_of is deprecated (C++17) or removed (C++20)
+template<typename> struct result_of;
+template<typename F, typename... Args>
+struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
+#else
+template<typename F> using result_of = std::result_of<F>;
+#endif
+
+}  // namespace type_traits_internal
+
+template<typename F>
+using result_of_t = typename type_traits_internal::result_of<F>::type;
 
 namespace type_traits_internal {
 // In MSVC we can't probe std::hash or stdext::hash because it triggers a
diff --git a/third_party/abseil-cpp/absl/random/internal/randen.cc b/third_party/abseil-cpp/absl/random/internal/randen.cc
index 78a1e00..c1bc04443 100644
--- a/third_party/abseil-cpp/absl/random/internal/randen.cc
+++ b/third_party/abseil-cpp/absl/random/internal/randen.cc
@@ -17,7 +17,7 @@
 #include "absl/base/internal/raw_logging.h"
 #include "absl/random/internal/randen_detect.h"
 
-// RANDen = RANDom generator or beetroots in Swiss German.
+// RANDen = RANDom generator or beetroots in Swiss High German.
 // 'Strong' (well-distributed, unpredictable, backtracking-resistant) random
 // generator, faster in some benchmarks than std::mt19937_64 and pcg64_c32.
 //
diff --git a/third_party/abseil-cpp/absl/random/internal/randen.h b/third_party/abseil-cpp/absl/random/internal/randen.h
index c2834aa..9a3840b8 100644
--- a/third_party/abseil-cpp/absl/random/internal/randen.h
+++ b/third_party/abseil-cpp/absl/random/internal/randen.h
@@ -26,7 +26,7 @@
 ABSL_NAMESPACE_BEGIN
 namespace random_internal {
 
-// RANDen = RANDom generator or beetroots in Swiss German.
+// RANDen = RANDom generator or beetroots in Swiss High German.
 // 'Strong' (well-distributed, unpredictable, backtracking-resistant) random
 // generator, faster in some benchmarks than std::mt19937_64 and pcg64_c32.
 //
diff --git a/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h b/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h
index bce36b5..71a7f69f 100644
--- a/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h
+++ b/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h
@@ -26,7 +26,7 @@
 ABSL_NAMESPACE_BEGIN
 namespace random_internal {
 
-// RANDen = RANDom generator or beetroots in Swiss German.
+// RANDen = RANDom generator or beetroots in Swiss High German.
 // 'Strong' (well-distributed, unpredictable, backtracking-resistant) random
 // generator, faster in some benchmarks than std::mt19937_64 and pcg64_c32.
 //
diff --git a/third_party/abseil-cpp/absl/random/internal/randen_slow.h b/third_party/abseil-cpp/absl/random/internal/randen_slow.h
index b6f137e..532c3a89 100644
--- a/third_party/abseil-cpp/absl/random/internal/randen_slow.h
+++ b/third_party/abseil-cpp/absl/random/internal/randen_slow.h
@@ -23,7 +23,7 @@
 ABSL_NAMESPACE_BEGIN
 namespace random_internal {
 
-// RANDen = RANDom generator or beetroots in Swiss German.
+// RANDen = RANDom generator or beetroots in Swiss High German.
 // RandenSlow implements the basic state manipulation methods for
 // architectures lacking AES hardware acceleration intrinsics.
 class RandenSlow {
diff --git a/third_party/abseil-cpp/absl/random/internal/randen_traits.h b/third_party/abseil-cpp/absl/random/internal/randen_traits.h
index 53caa93..120022c 100644
--- a/third_party/abseil-cpp/absl/random/internal/randen_traits.h
+++ b/third_party/abseil-cpp/absl/random/internal/randen_traits.h
@@ -28,7 +28,7 @@
 ABSL_NAMESPACE_BEGIN
 namespace random_internal {
 
-// RANDen = RANDom generator or beetroots in Swiss German.
+// RANDen = RANDom generator or beetroots in Swiss High German.
 // 'Strong' (well-distributed, unpredictable, backtracking-resistant) random
 // generator, faster in some benchmarks than std::mt19937_64 and pcg64_c32.
 //
diff --git a/third_party/abseil-cpp/absl/status/internal/status_internal.h b/third_party/abseil-cpp/absl/status/internal/status_internal.h
index 1f82b8e..279f8f55 100644
--- a/third_party/abseil-cpp/absl/status/internal/status_internal.h
+++ b/third_party/abseil-cpp/absl/status/internal/status_internal.h
@@ -36,6 +36,13 @@
 
 // Reference-counted representation of Status data.
 struct StatusRep {
+  StatusRep(absl::StatusCode code, std::string message,
+            std::unique_ptr<status_internal::Payloads> payloads)
+      : ref(int32_t{1}),
+        code(code),
+        message(std::move(message)),
+        payloads(std::move(payloads)) {}
+
   std::atomic<int32_t> ref;
   absl::StatusCode code;
   std::string message;
diff --git a/third_party/abseil-cpp/absl/status/status.cc b/third_party/abseil-cpp/absl/status/status.cc
index a27fd8b3..c71de84 100644
--- a/third_party/abseil-cpp/absl/status/status.cc
+++ b/third_party/abseil-cpp/absl/status/status.cc
@@ -209,11 +209,8 @@
 
 uintptr_t Status::NewRep(absl::StatusCode code, absl::string_view msg,
                          std::unique_ptr<status_internal::Payloads> payloads) {
-  status_internal::StatusRep* rep = new status_internal::StatusRep;
-  rep->ref.store(1, std::memory_order_relaxed);
-  rep->code = code;
-  rep->message.assign(msg.data(), msg.size());
-  rep->payloads = std::move(payloads);
+  status_internal::StatusRep* rep = new status_internal::StatusRep(
+      code, std::string(msg.data(), msg.size()), std::move(payloads));
   return PointerToRep(rep);
 }
 
diff --git a/third_party/abseil-cpp/absl/strings/cord.cc b/third_party/abseil-cpp/absl/strings/cord.cc
index 9efd135..ec1e970 100644
--- a/third_party/abseil-cpp/absl/strings/cord.cc
+++ b/third_party/abseil-cpp/absl/strings/cord.cc
@@ -53,6 +53,7 @@
 using ::absl::cord_internal::CONCAT;
 using ::absl::cord_internal::EXTERNAL;
 using ::absl::cord_internal::FLAT;
+using ::absl::cord_internal::MAX_FLAT_TAG;
 using ::absl::cord_internal::SUBSTRING;
 
 namespace cord_internal {
@@ -95,9 +96,21 @@
 // Flat allocation size is stored in tag, which currently can encode sizes up
 // to 4K, encoded as multiple of either 8 or 32 bytes.
 // If we allow for larger sizes, we need to change this to 8/64, 16/128, etc.
+// kMinFlatSize is bounded by tag needing to be at least FLAT * 8 bytes, and
+// ideally a 'nice' size aligning with allocation and cacheline sizes like 32.
+// kMaxFlatSize is bounded by the size resulting in a computed tag no greater
+// than MAX_FLAT_TAG. MAX_FLAT_TAG provides for additional 'high' tag values.
+static constexpr size_t kMinFlatSize = 32;
 static constexpr size_t kMaxFlatSize = 4096;
 static constexpr size_t kMaxFlatLength = kMaxFlatSize - kFlatOverhead;
-static constexpr size_t kMinFlatLength = 32 - kFlatOverhead;
+static constexpr size_t kMinFlatLength = kMinFlatSize - kFlatOverhead;
+
+static constexpr size_t AllocatedSizeToTagUnchecked(size_t size) {
+  return (size <= 1024) ? size / 8 : 128 + size / 32 - 1024 / 32;
+}
+
+static_assert(kMinFlatSize / 8 >= FLAT, "");
+static_assert(AllocatedSizeToTagUnchecked(kMaxFlatSize) <= MAX_FLAT_TAG, "");
 
 // Prefer copying blocks of at most this size, otherwise reference count.
 static const size_t kMaxBytesToCopy = 511;
@@ -117,7 +130,7 @@
 // undefined if the size exceeds the maximum size that can be encoded in
 // a tag, i.e., if size is larger than TagToAllocatedSize(<max tag>).
 static uint8_t AllocatedSizeToTag(size_t size) {
-  const size_t tag = (size <= 1024) ? size / 8 : 128 + size / 32 - 1024 / 32;
+  const size_t tag = AllocatedSizeToTagUnchecked(size);
   assert(tag <= std::numeric_limits<uint8_t>::max());
   return tag;
 }
diff --git a/third_party/abseil-cpp/absl/strings/internal/cord_internal.h b/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
index aa91a69..195a7988 100644
--- a/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
+++ b/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
@@ -116,10 +116,16 @@
   CONCAT        = 0,
   EXTERNAL      = 1,
   SUBSTRING     = 2,
+  RING          = 3,
 
   // We have different tags for different sized flat arrays,
-  // starting with FLAT
-  FLAT          = 3,
+  // starting with FLAT, and limited to MAX_FLAT_TAG. The 224 value is based on
+  // the current 'size to tag' encoding of 8 / 32 bytes. If a new tag is needed
+  // in the future, then 'FLAT' and 'MAX_FLAT_TAG' should be adjusted as well
+  // as the Tag <---> Size logic so that FLAT stil represents the minimum flat
+  // allocation size. (32 bytes as of now).
+  FLAT = 4,
+  MAX_FLAT_TAG = 224,
 };
 
 struct CordRep {
diff --git a/third_party/abseil-cpp/absl/strings/internal/string_constant.h b/third_party/abseil-cpp/absl/strings/internal/string_constant.h
index b15f1d9b..a11336b 100644
--- a/third_party/abseil-cpp/absl/strings/internal/string_constant.h
+++ b/third_party/abseil-cpp/absl/strings/internal/string_constant.h
@@ -35,18 +35,12 @@
 // below.
 template <typename T>
 struct StringConstant {
- private:
-  // Returns true if `view` points to constant data.
-  // Otherwise, it can't be constant evaluated.
-  static constexpr bool ValidateConstant(absl::string_view view) {
-    return view.empty() || 2 * view[0] != 1;
-  }
-
- public:
   static constexpr absl::string_view value = T{}();
   constexpr absl::string_view operator()() const { return value; }
 
-  static_assert(ValidateConstant(value),
+  // Check to be sure `view` points to constant data.
+  // Otherwise, it can't be constant evaluated.
+  static_assert(value.empty() || 2 * value[0] != 1,
                 "The input string_view must point to constant data.");
 };
 
diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def
index d9ffd9d..dc7fd26d 100644
--- a/third_party/abseil-cpp/symbols_arm64_dbg.def
+++ b/third_party/abseil-cpp/symbols_arm64_dbg.def
@@ -274,6 +274,15 @@
     ??$EmplaceBack@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUSubRange@2@$$QEAU32@@Z
+    ??$EmplaceBackSlow@AEBH@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAAAEAHAEBH@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEBUCordRep@cord_internal@absl@@@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEBUCordRep@cord_internal@2@AEBQEBU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUSubRange@2@$$QEAU32@@Z
     ??$ExtractCharSet@$03@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$03@01@@Z
     ??$ExtractCharSet@$0BPOAA@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPOAA@@01@@Z
     ??$ExtractCharSet@$0BPPPL@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPPPL@@01@@Z
@@ -962,7 +971,7 @@
     ??0SpinLockHolder@base_internal@absl@@QEAA@PEAVSpinLock@12@@Z
     ??0Status@absl@@QEAA@$$QEAV01@@Z
     ??0Status@absl@@QEAA@W4StatusCode@1@Vstring_view@1@@Z
-    ??0StatusRep@status_internal@absl@@QEAA@XZ
+    ??0StatusRep@status_internal@absl@@QEAA@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Storage@?$FixedArray@PEAUCordRep@cord_internal@absl@@$0?0V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAA@_KAEBV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@Z
     ??0Streamable@str_format_internal@absl@@QEAA@AEBVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0StringReleaser@?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@Cord@absl@@QEAA@$$QEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z@QEAA@$$QEAU0?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@12@QEAA@0@Z@@Z
@@ -1467,10 +1476,10 @@
     ?ClearSlow@InlineRep@Cord@absl@@AEAAXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
     ?CodeToInlinedRep@Status@absl@@CA_KW4StatusCode@2@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
     ?Compare@Cord@absl@@QEBAHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@AEBAHAEBV12@@Z
     ?CompareSlowPath@Cord@absl@@AEBAHAEBV12@_K1@Z
@@ -1982,9 +1991,9 @@
     ?RandomSeed@container_internal@absl@@YA_KXZ
     ?RawLog@raw_logging_internal@absl@@YAXW4LogSeverity@2@PEBDH1ZZ
     ?RawLoggingFullySupported@raw_logging_internal@absl@@YA_NXZ
-    ?Read1To3@CityHashState@hash_internal@absl@@CAIPEBE_K@Z
-    ?Read4To8@CityHashState@hash_internal@absl@@CA_KPEBE_K@Z
-    ?Read9To16@CityHashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PEBE_K@Z
+    ?Read1To3@HashState@hash_internal@absl@@CAIPEBE_K@Z
+    ?Read4To8@HashState@hash_internal@absl@@CA_KPEBE_K@Z
+    ?Read9To16@HashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PEBE_K@Z
     ?ReadDigits@?$BigUnsigned@$03@strings_internal@absl@@AEAAHPEBD0H@Z
     ?ReadDigits@?$BigUnsigned@$0FE@@strings_internal@absl@@AEAAHPEBD0H@Z
     ?ReadFloatMantissa@?$BigUnsigned@$03@strings_internal@absl@@QEAAHAEBUParsedFloat@23@H@Z
@@ -2273,6 +2282,8 @@
     ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FormatRawSinkImpl@str_format_internal@absl@@QEAAXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPEBE_K@Z
     ?ZeroDuration@absl@@YA?AVDuration@1@XZ
     ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ
     ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QEAAPEAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_arm64_rel.def b/third_party/abseil-cpp/symbols_arm64_rel.def
index c26572c..669460e 100644
--- a/third_party/abseil-cpp/symbols_arm64_rel.def
+++ b/third_party/abseil-cpp/symbols_arm64_rel.def
@@ -42,6 +42,13 @@
     ??$EmplaceBack@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUSubRange@2@$$QEAU32@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEBUCordRep@cord_internal@absl@@@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEBUCordRep@cord_internal@2@AEBQEBU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUSubRange@2@$$QEAU32@@Z
     ??$FindSubstitutions@V?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@std@@@strings_internal@absl@@YA?AV?$vector@UViableSubstitution@strings_internal@absl@@V?$allocator@UViableSubstitution@strings_internal@absl@@@__1@std@@@__1@std@@Vstring_view@1@AEBV?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@4@@Z
     ??$Flush@V?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
     ??$Flush@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
@@ -104,6 +111,7 @@
     ??0Rep@GraphCycles@synchronization_internal@absl@@QEAA@XZ
     ??0SpinLock@base_internal@absl@@QEAA@W4SchedulingMode@12@@Z
     ??0Status@absl@@QEAA@W4StatusCode@1@Vstring_view@1@@Z
+    ??0StatusRep@status_internal@absl@@QEAA@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Streamable@str_format_internal@absl@@QEAA@AEBVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0TimeZoneInfo@cctz@time_internal@absl@@QEAA@XZ
     ??0TimeZoneLibC@cctz@time_internal@absl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
@@ -241,10 +249,10 @@
     ?ClearCurrentThreadIdentity@base_internal@absl@@YAXXZ
     ?ClearSlow@InlineRep@Cord@absl@@AEAAXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
     ?Compare@Cord@absl@@QEBAHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@AEBAHAEBV12@@Z
     ?CompareSlowPath@Cord@absl@@AEBAHAEBV12@_K1@Z
@@ -699,6 +707,8 @@
     ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
     ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPEBE_K@Z
     ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ
     ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
     ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def
index 138512c3..6c2662e 100644
--- a/third_party/abseil-cpp/symbols_x64_dbg.def
+++ b/third_party/abseil-cpp/symbols_x64_dbg.def
@@ -274,6 +274,15 @@
     ??$EmplaceBack@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUSubRange@2@$$QEAU32@@Z
+    ??$EmplaceBackSlow@AEBH@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAAAEAHAEBH@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEBUCordRep@cord_internal@absl@@@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEBUCordRep@cord_internal@2@AEBQEBU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUSubRange@2@$$QEAU32@@Z
     ??$ExtractCharSet@$03@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$03@01@@Z
     ??$ExtractCharSet@$0BPOAA@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPOAA@@01@@Z
     ??$ExtractCharSet@$0BPPPL@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPPPL@@01@@Z
@@ -964,7 +973,7 @@
     ??0SpinLockHolder@base_internal@absl@@QEAA@PEAVSpinLock@12@@Z
     ??0Status@absl@@QEAA@$$QEAV01@@Z
     ??0Status@absl@@QEAA@W4StatusCode@1@Vstring_view@1@@Z
-    ??0StatusRep@status_internal@absl@@QEAA@XZ
+    ??0StatusRep@status_internal@absl@@QEAA@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Storage@?$FixedArray@PEAUCordRep@cord_internal@absl@@$0?0V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAA@_KAEBV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@Z
     ??0Streamable@str_format_internal@absl@@QEAA@AEBVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0StringReleaser@?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@Cord@absl@@QEAA@$$QEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z@QEAA@$$QEAU0?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@12@QEAA@0@Z@@Z
@@ -1468,10 +1477,10 @@
     ?ClearSlow@InlineRep@Cord@absl@@AEAAXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
     ?CodeToInlinedRep@Status@absl@@CA_KW4StatusCode@2@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
     ?Compare@Cord@absl@@QEBAHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@AEBAHAEBV12@@Z
     ?CompareSlowPath@Cord@absl@@AEBAHAEBV12@_K1@Z
@@ -1982,9 +1991,9 @@
     ?RandomSeed@container_internal@absl@@YA_KXZ
     ?RawLog@raw_logging_internal@absl@@YAXW4LogSeverity@2@PEBDH1ZZ
     ?RawLoggingFullySupported@raw_logging_internal@absl@@YA_NXZ
-    ?Read1To3@CityHashState@hash_internal@absl@@CAIPEBE_K@Z
-    ?Read4To8@CityHashState@hash_internal@absl@@CA_KPEBE_K@Z
-    ?Read9To16@CityHashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PEBE_K@Z
+    ?Read1To3@HashState@hash_internal@absl@@CAIPEBE_K@Z
+    ?Read4To8@HashState@hash_internal@absl@@CA_KPEBE_K@Z
+    ?Read9To16@HashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PEBE_K@Z
     ?ReadDigits@?$BigUnsigned@$03@strings_internal@absl@@AEAAHPEBD0H@Z
     ?ReadDigits@?$BigUnsigned@$0FE@@strings_internal@absl@@AEAAHPEBD0H@Z
     ?ReadFloatMantissa@?$BigUnsigned@$03@strings_internal@absl@@QEAAHAEBUParsedFloat@23@H@Z
@@ -2271,6 +2280,8 @@
     ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FormatRawSinkImpl@str_format_internal@absl@@QEAAXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPEBE_K@Z
     ?ZeroDuration@absl@@YA?AVDuration@1@XZ
     ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ
     ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QEAAPEAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_x64_rel.def b/third_party/abseil-cpp/symbols_x64_rel.def
index 55348095..2f91952 100644
--- a/third_party/abseil-cpp/symbols_x64_rel.def
+++ b/third_party/abseil-cpp/symbols_x64_rel.def
@@ -42,6 +42,13 @@
     ??$EmplaceBack@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUSubRange@2@$$QEAU32@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEBUCordRep@cord_internal@absl@@@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEBUCordRep@cord_internal@2@AEBQEBU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUSubRange@2@$$QEAU32@@Z
     ??$FindSubstitutions@V?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@std@@@strings_internal@absl@@YA?AV?$vector@UViableSubstitution@strings_internal@absl@@V?$allocator@UViableSubstitution@strings_internal@absl@@@__1@std@@@__1@std@@Vstring_view@1@AEBV?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@4@@Z
     ??$Flush@V?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
     ??$Flush@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
@@ -106,6 +113,7 @@
     ??0Rep@GraphCycles@synchronization_internal@absl@@QEAA@XZ
     ??0SpinLock@base_internal@absl@@QEAA@W4SchedulingMode@12@@Z
     ??0Status@absl@@QEAA@W4StatusCode@1@Vstring_view@1@@Z
+    ??0StatusRep@status_internal@absl@@QEAA@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Streamable@str_format_internal@absl@@QEAA@AEBVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0TimeZoneInfo@cctz@time_internal@absl@@QEAA@XZ
     ??0TimeZoneLibC@cctz@time_internal@absl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
@@ -242,10 +250,10 @@
     ?ClearCurrentThreadIdentity@base_internal@absl@@YAXXZ
     ?ClearSlow@InlineRep@Cord@absl@@AEAAXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
     ?Compare@Cord@absl@@QEBAHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@AEBAHAEBV12@@Z
     ?CompareSlowPath@Cord@absl@@AEBAHAEBV12@_K1@Z
@@ -700,6 +708,8 @@
     ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
     ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPEBE_K@Z
     ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ
     ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
     ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAX_K@Z
diff --git a/third_party/abseil-cpp/symbols_x64_rel_asan.def b/third_party/abseil-cpp/symbols_x64_rel_asan.def
index 97e39f5e..aa14dc1 100644
--- a/third_party/abseil-cpp/symbols_x64_rel_asan.def
+++ b/third_party/abseil-cpp/symbols_x64_rel_asan.def
@@ -42,6 +42,13 @@
     ??$EmplaceBack@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAAEAUSubRange@2@$$QEAU32@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@AEBQEAU342@@Z
+    ??$EmplaceBackSlow@AEBQEBUCordRep@cord_internal@absl@@@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEBUCordRep@cord_internal@2@AEBQEBU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$03V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@PEAUCordRep@cord_internal@absl@@@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAPEAUCordRep@cord_internal@2@$$QEAPEAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUPayload@status_internal@2@$$QEAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAAEAUSubRange@2@$$QEAU32@@Z
     ??$FindSubstitutions@V?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@std@@@strings_internal@absl@@YA?AV?$vector@UViableSubstitution@strings_internal@absl@@V?$allocator@UViableSubstitution@strings_internal@absl@@@__1@std@@@__1@std@@Vstring_view@1@AEBV?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@4@@Z
     ??$Flush@V?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
     ??$Flush@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPEAXVstring_view@2@@Z
@@ -111,6 +118,7 @@
     ??0Rep@GraphCycles@synchronization_internal@absl@@QEAA@XZ
     ??0SpinLock@base_internal@absl@@QEAA@W4SchedulingMode@12@@Z
     ??0Status@absl@@QEAA@W4StatusCode@1@Vstring_view@1@@Z
+    ??0StatusRep@status_internal@absl@@QEAA@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Streamable@str_format_internal@absl@@QEAA@AEBVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0TimeZoneInfo@cctz@time_internal@absl@@QEAA@XZ
     ??0TimeZoneLibC@cctz@time_internal@absl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
@@ -261,10 +269,10 @@
     ?ClearCurrentThreadIdentity@base_internal@absl@@YAXXZ
     ?ClearSlow@InlineRep@Cord@absl@@AEAAXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPEBE0U?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPEBE0@Z
     ?Compare@Cord@absl@@QEBAHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@AEBAHAEBV12@@Z
     ?CompareSlowPath@Cord@absl@@AEBAHAEBV12@_K1@Z
@@ -718,6 +726,8 @@
     ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
     ?Write@BufferRawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QEAAXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPEBX_K1QEB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPEBE_K@Z
     ?__add_back_capacity@?$deque@PEBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEAAXXZ
     ?__annotate_delete@?$vector@UConversionItem@ParsedFormatBase@str_format_internal@absl@@V?$allocator@UConversionItem@ParsedFormatBase@str_format_internal@absl@@@__1@std@@@__1@std@@AEBAXXZ
     ?__annotate_increase@?$vector@UConversionItem@ParsedFormatBase@str_format_internal@absl@@V?$allocator@UConversionItem@ParsedFormatBase@str_format_internal@absl@@@__1@std@@@__1@std@@AEBAX_K@Z
diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def
index cea7708..cae57523 100644
--- a/third_party/abseil-cpp/symbols_x86_dbg.def
+++ b/third_party/abseil-cpp/symbols_x86_dbg.def
@@ -274,6 +274,15 @@
     ??$EmplaceBack@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAUPayload@status_internal@2@$$QAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAUSubRange@2@$$QAU32@@Z
+    ??$EmplaceBackSlow@ABH@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AAEAAHABH@Z
+    ??$EmplaceBackSlow@ABQAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@ABQAU342@@Z
+    ??$EmplaceBackSlow@ABQAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$03V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@ABQAU342@@Z
+    ??$EmplaceBackSlow@ABQAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@ABQAU342@@Z
+    ??$EmplaceBackSlow@ABQBUCordRep@cord_internal@absl@@@?$Storage@PBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPBUCordRep@cord_internal@2@ABQBU342@@Z
+    ??$EmplaceBackSlow@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$03V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
+    ??$EmplaceBackSlow@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAUPayload@status_internal@2@$$QAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAUSubRange@2@$$QAU32@@Z
     ??$ExtractCharSet@$03@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$03@01@@Z
     ??$ExtractCharSet@$0BPOAA@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPOAA@@01@@Z
     ??$ExtractCharSet@$0BPPPL@@str_format_internal@absl@@YA?AW4FormatConversionCharSet@1@U?$ArgConvertResult@$0BPPPL@@01@@Z
@@ -962,7 +971,7 @@
     ??0SpinLockHolder@base_internal@absl@@QAE@PAVSpinLock@12@@Z
     ??0Status@absl@@QAE@$$QAV01@@Z
     ??0Status@absl@@QAE@W4StatusCode@1@Vstring_view@1@@Z
-    ??0StatusRep@status_internal@absl@@QAE@XZ
+    ??0StatusRep@status_internal@absl@@QAE@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Storage@?$FixedArray@PAUCordRep@cord_internal@absl@@$0PPPPPPPP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QAE@IABV?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@Z
     ??0Streamable@str_format_internal@absl@@QAE@ABVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0StringReleaser@?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@Cord@absl@@QAE@$$QAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z@QAE@$$QAU0?M@???$?0V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@$0A@@12@QAE@0@Z@@Z
@@ -1465,10 +1474,10 @@
     ?ClearSlow@InlineRep@Cord@absl@@AAEXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
     ?CodeToInlinedRep@Status@absl@@CAIW4StatusCode@2@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPBEI@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPBEI@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPBEI@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPBEI@Z
     ?Compare@Cord@absl@@QBEHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@ABEHABV12@@Z
     ?CompareSlowPath@Cord@absl@@ABEHABV12@II@Z
@@ -1979,9 +1988,9 @@
     ?RandomSeed@container_internal@absl@@YAIXZ
     ?RawLog@raw_logging_internal@absl@@YAXW4LogSeverity@2@PBDH1ZZ
     ?RawLoggingFullySupported@raw_logging_internal@absl@@YA_NXZ
-    ?Read1To3@CityHashState@hash_internal@absl@@CAIPBEI@Z
-    ?Read4To8@CityHashState@hash_internal@absl@@CA_KPBEI@Z
-    ?Read9To16@CityHashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PBEI@Z
+    ?Read1To3@HashState@hash_internal@absl@@CAIPBEI@Z
+    ?Read4To8@HashState@hash_internal@absl@@CA_KPBEI@Z
+    ?Read9To16@HashState@hash_internal@absl@@CA?AU?$pair@_K_K@__1@std@@PBEI@Z
     ?ReadDigits@?$BigUnsigned@$03@strings_internal@absl@@AAEHPBD0H@Z
     ?ReadDigits@?$BigUnsigned@$0FE@@strings_internal@absl@@AAEHPBD0H@Z
     ?ReadFloatMantissa@?$BigUnsigned@$03@strings_internal@absl@@QAEHABUParsedFloat@23@H@Z
@@ -2268,6 +2277,8 @@
     ?Write@BufferRawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z
     ?Write@FormatRawSinkImpl@str_format_internal@absl@@QAEXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPBXI_KQB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPBEI@Z
     ?ZeroDuration@absl@@YA?AVDuration@1@XZ
     ?__add_back_capacity@?$deque@PBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXXZ
     ?__addr@?$__temp_value@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@QAEPAUTransition@cctz@time_internal@absl@@XZ
diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def
index e06a6684..8f2ea9c 100644
--- a/third_party/abseil-cpp/symbols_x86_rel.def
+++ b/third_party/abseil-cpp/symbols_x86_rel.def
@@ -42,6 +42,13 @@
     ??$EmplaceBack@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
     ??$EmplaceBack@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAUPayload@status_internal@2@$$QAU342@@Z
     ??$EmplaceBack@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEAAUSubRange@2@$$QAU32@@Z
+    ??$EmplaceBackSlow@ABQAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$03V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@ABQAU342@@Z
+    ??$EmplaceBackSlow@ABQAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@ABQAU342@@Z
+    ??$EmplaceBackSlow@ABQBUCordRep@cord_internal@absl@@@?$Storage@PBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPBUCordRep@cord_internal@2@ABQBU342@@Z
+    ??$EmplaceBackSlow@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$03V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
+    ??$EmplaceBackSlow@PAUCordRep@cord_internal@absl@@@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAPAUCordRep@cord_internal@2@$$QAPAU342@@Z
+    ??$EmplaceBackSlow@UPayload@status_internal@absl@@@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAUPayload@status_internal@2@$$QAU342@@Z
+    ??$EmplaceBackSlow@USubRange@absl@@@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEAAUSubRange@2@$$QAU32@@Z
     ??$FindSubstitutions@V?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@std@@@strings_internal@absl@@YA?AV?$vector@UViableSubstitution@strings_internal@absl@@V?$allocator@UViableSubstitution@strings_internal@absl@@@__1@std@@@__1@std@@Vstring_view@1@ABV?$initializer_list@U?$pair@Vstring_view@absl@@V12@@__1@std@@@4@@Z
     ??$Flush@V?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPAXVstring_view@2@@Z
     ??$Flush@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@FormatRawSinkImpl@str_format_internal@absl@@CAXPAXVstring_view@2@@Z
@@ -104,6 +111,7 @@
     ??0Rep@GraphCycles@synchronization_internal@absl@@QAE@XZ
     ??0SpinLock@base_internal@absl@@QAE@W4SchedulingMode@12@@Z
     ??0Status@absl@@QAE@W4StatusCode@1@Vstring_view@1@@Z
+    ??0StatusRep@status_internal@absl@@QAE@W4StatusCode@2@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@V?$unique_ptr@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@U?$default_delete@V?$InlinedVector@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@absl@@@__1@std@@@56@@Z
     ??0Streamable@str_format_internal@absl@@QAE@ABVUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z
     ??0TimeZoneInfo@cctz@time_internal@absl@@QAE@XZ
     ??0TimeZoneLibC@cctz@time_internal@absl@@QAE@ABV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
@@ -239,10 +247,10 @@
     ?ClearCurrentThreadIdentity@base_internal@absl@@YAXXZ
     ?ClearSlow@InlineRep@Cord@absl@@AAEXXZ
     ?ClearTimeZoneMapTestOnly@Impl@time_zone@cctz@time_internal@absl@@SAXXZ
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$03@__1@std@@@Z
-    ?CombineContiguousImpl@CityHashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$07@__1@std@@@Z
-    ?CombineLargeContiguousImpl32@CityHashState@hash_internal@absl@@CA_K_KPBEI@Z
-    ?CombineLargeContiguousImpl64@CityHashState@hash_internal@absl@@CA_K_KPBEI@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$03@__1@std@@@Z
+    ?CombineContiguousImpl@HashState@hash_internal@absl@@CA_K_KPBEIU?$integral_constant@H$07@__1@std@@@Z
+    ?CombineLargeContiguousImpl32@HashState@hash_internal@absl@@CA_K_KPBEI@Z
+    ?CombineLargeContiguousImpl64@HashState@hash_internal@absl@@CA_K_KPBEI@Z
     ?Compare@Cord@absl@@QBEHVstring_view@2@@Z
     ?CompareImpl@Cord@absl@@ABEHABV12@@Z
     ?CompareSlowPath@Cord@absl@@ABEHABV12@II@Z
@@ -696,6 +704,8 @@
     ?WebSafeBase64Unescape@absl@@YA_NVstring_view@1@PAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z
     ?Write@BufferRawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z
     ?Write@FILERawSink@str_format_internal@absl@@QAEXVstring_view@3@@Z
+    ?Wyhash@hash_internal@absl@@YA_KPBXI_KQB_K@Z
+    ?WyhashImpl@HashState@hash_internal@absl@@CA_KPBEI@Z
     ?__add_back_capacity@?$deque@PBVImpl@time_zone@cctz@time_internal@absl@@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXXZ
     ?__append@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXI@Z
     ?__append@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__1@std@@@__1@std@@AAEXI@Z
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
index f0695afe..7f098d3a 100644
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -598,7 +598,8 @@
 
 # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
 android_aar_prebuilt("androidx_recyclerview_recyclerview_java") {
-  aar_path = "libs/androidx_recyclerview_recyclerview/recyclerview-1.1.0.aar"
+  aar_path =
+      "libs/androidx_recyclerview_recyclerview/recyclerview-1.2.0-alpha06.aar"
   info_path = "libs/androidx_recyclerview_recyclerview/androidx_recyclerview_recyclerview.info"
   deps = [
     ":androidx_annotation_annotation_java",
@@ -850,7 +851,7 @@
 
 # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
 android_aar_prebuilt("androidx_viewpager2_viewpager2_java") {
-  aar_path = "libs/androidx_viewpager2_viewpager2/viewpager2-1.0.0.aar"
+  aar_path = "libs/androidx_viewpager2_viewpager2/viewpager2-1.1.0-SNAPSHOT.aar"
   info_path =
       "libs/androidx_viewpager2_viewpager2/androidx_viewpager2_viewpager2.info"
   deps = [
@@ -865,7 +866,7 @@
 
 # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
 android_aar_prebuilt("androidx_viewpager_viewpager_java") {
-  aar_path = "libs/androidx_viewpager_viewpager/viewpager-1.0.0.aar"
+  aar_path = "libs/androidx_viewpager_viewpager/viewpager-1.1.0-SNAPSHOT.aar"
   info_path =
       "libs/androidx_viewpager_viewpager/androidx_viewpager_viewpager.info"
   deps = [
diff --git a/third_party/android_deps/build.gradle b/third_party/android_deps/build.gradle
index bb6072d..ca71391 100644
--- a/third_party/android_deps/build.gradle
+++ b/third_party/android_deps/build.gradle
@@ -76,13 +76,13 @@
     compile "androidx.preference:preference:1.1.1"
     compile "androidx.slice:slice-core:${androidXSupportLibVersion}"
     compile "androidx.slice:slice-builders:${androidXSupportLibVersion}"
-    compile "androidx.recyclerview:recyclerview:${androidXSupportLibVersion}"
+    compile "androidx.recyclerview:recyclerview:1.2.0-SNAPSHOT"
     compile "androidx.savedstate:savedstate:${androidXSupportLibVersion}"
     compile "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-SNAPSHOT"
     compile "androidx.vectordrawable:vectordrawable:1.2.0-SNAPSHOT"
     compile "androidx.vectordrawable:vectordrawable-animated:1.2.0-SNAPSHOT"
     compile "androidx.tvprovider:tvprovider:1.1.0-SNAPSHOT"
-    compile "androidx.viewpager:viewpager:${androidXSupportLibVersion}"
+    compile "androidx.viewpager:viewpager:1.1.0-SNAPSHOT"
     compile "androidx.window:window:1.0.0-alpha01"
     compile "androidx.exifinterface:exifinterface:1.4.0-SNAPSHOT"
 
@@ -92,7 +92,7 @@
     compile "androidx.legacy:legacy-support-core-utils:1.0.0"
     compile "androidx.lifecycle:lifecycle-runtime:${androidXSupportLibVersion}"
     compile "androidx.transition:transition:1.4.0-SNAPSHOT"
-    compile "androidx.viewpager2:viewpager2:${androidXSupportLibVersion}"
+    compile "androidx.viewpager2:viewpager2:1.1.0-SNAPSHOT"
 
     compile "androidx.multidex:multidex:2.0.0"
     compile "androidx.webkit:webkit:1.3.0-rc01"
diff --git a/third_party/android_deps/libs/androidx_recyclerview_recyclerview/README.chromium b/third_party/android_deps/libs/androidx_recyclerview_recyclerview/README.chromium
index 3a4a34e..b7df8ca 100644
--- a/third_party/android_deps/libs/androidx_recyclerview_recyclerview/README.chromium
+++ b/third_party/android_deps/libs/androidx_recyclerview_recyclerview/README.chromium
@@ -1,13 +1,13 @@
-Name: Android Support RecyclerView v7
+Name: Android Support RecyclerView
 Short Name: recyclerview
-URL: https://developer.android.com/jetpack/androidx
-Version: 1.1.0
+URL: https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0-alpha06
+Version: 1.2.0-alpha06
 License: Apache Version 2.0
 License File: LICENSE
 Security Critical: yes
 
 Description:
-Android Support RecyclerView v7
+Android Support RecyclerView
 
 Local Modifications:
 No modifications.
diff --git a/third_party/android_deps/libs/androidx_recyclerview_recyclerview/cipd.yaml b/third_party/android_deps/libs/androidx_recyclerview_recyclerview/cipd.yaml
index 61b50a0..6e84bdd 100644
--- a/third_party/android_deps/libs/androidx_recyclerview_recyclerview/cipd.yaml
+++ b/third_party/android_deps/libs/androidx_recyclerview_recyclerview/cipd.yaml
@@ -3,8 +3,8 @@
 # found in the LICENSE file.
 
 # To create CIPD package run the following command.
-# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0
+# cipd create --pkg-def cipd.yaml -tag version:1.2.0-alpha06-cr0
 package: chromium/third_party/android_deps/libs/androidx_recyclerview_recyclerview
-description: "Android Support RecyclerView v7"
+description: "Android Support RecyclerView"
 data:
-- file: recyclerview-1.1.0.aar
+- file: recyclerview-1.2.0-alpha06.aar
diff --git a/third_party/android_deps/libs/androidx_viewpager2_viewpager2/README.chromium b/third_party/android_deps/libs/androidx_viewpager2_viewpager2/README.chromium
index 8ed50ca..9ce96e77 100644
--- a/third_party/android_deps/libs/androidx_viewpager2_viewpager2/README.chromium
+++ b/third_party/android_deps/libs/androidx_viewpager2_viewpager2/README.chromium
@@ -1,7 +1,7 @@
 Name: AndroidX Widget ViewPager2
 Short Name: viewpager2
-URL: https://developer.android.com/jetpack/androidx
-Version: 1.0.0
+URL: https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-SNAPSHOT
+Version: 1.1.0-SNAPSHOT
 License: Apache Version 2.0
 License File: LICENSE
 Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_viewpager2_viewpager2/cipd.yaml b/third_party/android_deps/libs/androidx_viewpager2_viewpager2/cipd.yaml
index 139dfb11..14b0a02 100644
--- a/third_party/android_deps/libs/androidx_viewpager2_viewpager2/cipd.yaml
+++ b/third_party/android_deps/libs/androidx_viewpager2_viewpager2/cipd.yaml
@@ -3,8 +3,8 @@
 # found in the LICENSE file.
 
 # To create CIPD package run the following command.
-# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0
+# cipd create --pkg-def cipd.yaml -tag version:1.1.0-SNAPSHOT-cr0
 package: chromium/third_party/android_deps/libs/androidx_viewpager2_viewpager2
 description: "AndroidX Widget ViewPager2"
 data:
-- file: viewpager2-1.0.0.aar
+- file: viewpager2-1.1.0-SNAPSHOT.aar
diff --git a/third_party/android_deps/libs/androidx_viewpager_viewpager/README.chromium b/third_party/android_deps/libs/androidx_viewpager_viewpager/README.chromium
index 83cc045..54d9797 100644
--- a/third_party/android_deps/libs/androidx_viewpager_viewpager/README.chromium
+++ b/third_party/android_deps/libs/androidx_viewpager_viewpager/README.chromium
@@ -1,7 +1,7 @@
 Name: Android Support Library View Pager
 Short Name: viewpager
-URL: http://developer.android.com/tools/extras/support-library.html
-Version: 1.0.0
+URL: https://developer.android.com/jetpack/androidx/releases/viewpager#1.1.0-SNAPSHOT
+Version: 1.1.0-SNAPSHOT
 License: Apache Version 2.0
 License File: LICENSE
 Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_viewpager_viewpager/cipd.yaml b/third_party/android_deps/libs/androidx_viewpager_viewpager/cipd.yaml
index f868e588..02c1c35c 100644
--- a/third_party/android_deps/libs/androidx_viewpager_viewpager/cipd.yaml
+++ b/third_party/android_deps/libs/androidx_viewpager_viewpager/cipd.yaml
@@ -3,8 +3,8 @@
 # found in the LICENSE file.
 
 # To create CIPD package run the following command.
-# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0
+# cipd create --pkg-def cipd.yaml -tag version:1.1.0-SNAPSHOT-cr0
 package: chromium/third_party/android_deps/libs/androidx_viewpager_viewpager
 description: "Android Support Library View Pager"
 data:
-- file: viewpager-1.0.0.aar
+- file: viewpager-1.1.0-SNAPSHOT.aar
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index d9b97cf..127ae0d 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -75,7 +75,7 @@
                                    base::FEATURE_DISABLED_BY_DEFAULT};
 
 // Enable EditingNG by default. This feature is for a kill switch.
-const base::Feature kEditingNG{"EditingNG", base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kEditingNG{"EditingNG", base::FEATURE_ENABLED_BY_DEFAULT};
 
 // Enable LayoutNG.
 const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
@@ -88,7 +88,7 @@
                                          base::FEATURE_DISABLED_BY_DEFAULT};
 
 const base::Feature kFragmentItem{"FragmentItem",
-                                  base::FEATURE_DISABLED_BY_DEFAULT};
+                                  base::FEATURE_ENABLED_BY_DEFAULT};
 
 const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
                                              base::FEATURE_ENABLED_BY_DEFAULT};
@@ -824,5 +824,10 @@
 // noopener behavior by default. TODO(crbug.com/898942): Remove in Chrome 95.
 const base::Feature kTargetBlankImpliesNoOpener{
     "TargetBlankImpliesNoOpener", base::FEATURE_ENABLED_BY_DEFAULT};
+
+// Controls how max frame rates are enforced in MediaStreamTracks.
+// TODO(crbug.com/1152307): Remove in M91.
+const base::Feature kMediaStreamTrackUseConfigMaxFrameRate{
+    "MediaStreamTrackUseConfigMaxFrameRate", base::FEATURE_DISABLED_BY_DEFAULT};
 }  // namespace features
 }  // namespace blink
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h
index 75f7a27..375d833 100644
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -338,6 +338,9 @@
 BLINK_COMMON_EXPORT extern const base::Feature kLoadingTasksUnfreezable;
 
 BLINK_COMMON_EXPORT extern const base::Feature kTargetBlankImpliesNoOpener;
+
+BLINK_COMMON_EXPORT extern const base::Feature
+    kMediaStreamTrackUseConfigMaxFrameRate;
 }  // namespace features
 }  // namespace blink
 
diff --git a/third_party/blink/public/mojom/frame/frame.mojom b/third_party/blink/public/mojom/frame/frame.mojom
index f27ccf3..5b77e7c 100644
--- a/third_party/blink/public/mojom/frame/frame.mojom
+++ b/third_party/blink/public/mojom/frame/frame.mojom
@@ -436,10 +436,6 @@
       mojo_base.mojom.UnguessableToken child_frame_token,
       network.mojom.ContentSecurityPolicy? parsed_csp_attribute);
 
-  // Binds LocalFrame's policy container to RenderFrameHost's one.
-  BindPolicyContainer(
-      pending_associated_receiver<blink.mojom.PolicyContainerHost> receiver);
-
   // Sent by the renderer to request a paint preview of a subframe. |clip_rect|
   // is the size of the frame in it's parent. |guid| is an an identifier for
   // all the capture work (regardless of the process captures are happening in)
diff --git a/third_party/blink/public/platform/cross_variant_mojo_util.h b/third_party/blink/public/platform/cross_variant_mojo_util.h
index 89a8491..2aa7bfe 100644
--- a/third_party/blink/public/platform/cross_variant_mojo_util.h
+++ b/third_party/blink/public/platform/cross_variant_mojo_util.h
@@ -3,25 +3,30 @@
 // found in the LICENSE file.
 //
 // This header defines utilities for converting between Mojo interface variant
-// types. This is useful for maintaining type safety when message pipes need to
-// be passed across the Blink public API boundary.
+// types. Any code that needs to convert interface endpoints between
+// blink::mojom::MyInterface and blink::mojom::blink::MyInterface (such as the
+// Blink public API) should use these helpers to eliminate boilerplate code and
+// improve type safety.
+//
+// Background: Mojo generates two C++ interface classes for a given interface:
+// one using STL types and another using Blink's WTF types. The two are not
+// related to each other in any way. Converting between them previously meant
+// decomposing an interface endpoint into an untyped ScopedMessagePipeHandle,
+// with only comments to document the interface type.
 //
 // Example conversion from the Blink variant into a cross-variant handle:
 //
 // namespace blink {
 //
 // void WebLocalFrameImpl::PassGoatTeleporter() {
+//   // The fully-qualified type of the Blink variant is
+//   // blink::mojom::blink::GoatTeleporter.
 //   mojo::PendingRemote<mojom::blink::GoatTeleporter> remote =
 //       ProcureGoatTeleporter();
 //
-//   // CrossVariantMojoReceiver and CrossVariantMojoRemote may created from
-//   // any interface variant. Note the use of the unrelated *InterfaceBase
-//   // class as the cross-variant handle's template parameter. This is an empty
-//   // helper class defined by the .mojom-shared.h header that is common to all
-//   // variants of a Mojo interface and is useful for implementing type safety
-//   // checks such as this one.
-//   web_local_frame_client->PassGoatTeleporter(
-//       ToCrossVariantMojoRemote(std::move(cross_variant_remote)));
+//   // `PassGoatTeleporter()`'s argument is a `CrossVariantMojoRemote<>`; see
+//   // below example for the other part of this example.
+//   web_local_frame_client->PassGoatTeleporter(std::move(remote)));
 // }
 //
 // }  // namespace blink
@@ -30,12 +35,17 @@
 //
 // namespace content {
 //
+//   // Note the use of the *InterfaceBase class as the cross-variant handle's
+//   // template parameter. This is an empty helper class defined by the
+//   // .mojom-shared.h header that is shared as a nested type alias by all
+//   // generated C++ interface class variants. The cross-variant types key off
+//   // this shared type to provide type safety.
 // void RenderFrameImpl::PassGoatTeleporter(
 //     blink::CrossVariantMojoRemote<GoatTeleporterInterfaceBase>
 //     cross_variant_remote) {
-//   mojo::PendingRemote<blink::mojom::GoatTeleporter> remote =
-//       cross_variant_remote
-//           .PassAsPendingRemote<blink::mojom::GoatTeleporter>();
+//   // Non-Blink code uses the regular variant, so the `SetGoatTeleporter`
+//   // argument has  type `blink::mojom::GoatTeleporter`.
+//   frame_host_remote_->SetGoatTeleporter(std::move(cross_variant_remote));
 // }
 //
 // }  // namespace content
@@ -55,7 +65,8 @@
 
 namespace blink {
 
-// Non-associated helpers
+// Helpers for passing a variant-less non-associated interface across the Blink
+// public API.
 
 template <typename Interface>
 class CrossVariantMojoReceiver {
@@ -122,7 +133,8 @@
   mojo::ScopedMessagePipeHandle pipe_;
 };
 
-// Associated helpers
+// Helpers for passing a variant-less associated interface across the Blink
+// public API.
 
 template <typename Interface>
 class CrossVariantMojoAssociatedReceiver {
@@ -197,10 +209,40 @@
   mojo::ScopedInterfaceEndpointHandle handle_;
 };
 
+// The `ToCrossVariantMojoType` helpers are more convenient to use when there
+// isn't already an explicit CrossVariant{Associated,}{Receiver,Remote} type,
+// e.g. Blink code already has the Blink interface variant but wants to share
+// common code that requires the regular interface variant.
+template <typename VariantBase>
+auto ToCrossVariantMojoType(mojo::PendingReceiver<VariantBase>&& in) {
+  return blink::CrossVariantMojoReceiver<typename VariantBase::Base_>(
+      std::move(in));
+}
+
+template <typename VariantBase>
+auto ToCrossVariantMojoType(mojo::PendingRemote<VariantBase>&& in) {
+  return blink::CrossVariantMojoRemote<typename VariantBase::Base_>(
+      std::move(in));
+}
+
+template <typename VariantBase>
+auto ToCrossVariantMojoType(mojo::PendingAssociatedReceiver<VariantBase>&& in) {
+  return blink::CrossVariantMojoAssociatedReceiver<typename VariantBase::Base_>(
+      std::move(in));
+}
+
+template <typename VariantBase>
+auto ToCrossVariantMojoType(mojo::PendingAssociatedRemote<VariantBase>&& in) {
+  return blink::CrossVariantMojoAssociatedRemote<typename VariantBase::Base_>(
+      std::move(in));
+}
+
 }  // namespace blink
 
 namespace mojo {
 
+// Template specializations so //mojo understands how to convert between
+// Pending{Associated,}{Receiver,Remote} and the cross-variant types.
 template <typename CrossVariantBase>
 struct PendingReceiverConverter<
     blink::CrossVariantMojoReceiver<CrossVariantBase>> {
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index 6d6bc28..157952f64 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -216,13 +216,17 @@
   // to prevent the new child frame from being attached. Otherwise, embedders
   // should create a new WebLocalFrame, insert it into the frame tree, and
   // return the created frame.
-  virtual WebLocalFrame* CreateChildFrame(WebLocalFrame* parent,
-                                          mojom::TreeScopeType,
-                                          const WebString& name,
-                                          const WebString& fallback_name,
-                                          const FramePolicy&,
-                                          const WebFrameOwnerProperties&,
-                                          mojom::FrameOwnerElementType) {
+  virtual WebLocalFrame* CreateChildFrame(
+      WebLocalFrame* parent,
+      mojom::TreeScopeType,
+      const WebString& name,
+      const WebString& fallback_name,
+      const FramePolicy&,
+      const WebFrameOwnerProperties&,
+      mojom::FrameOwnerElementType,
+      CrossVariantMojoAssociatedReceiver<
+          mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) {
     return nullptr;
   }
 
@@ -259,14 +263,6 @@
   // This frame's name has changed.
   virtual void DidChangeName(const WebString& name) {}
 
-  // Called when a Feature-Policy or Document-Policy or Content-Security-Policy
-  // HTTP header (for sandbox flags) is encountered while loading the frame's
-  // document.
-  virtual void DidSetFramePolicyHeaders(
-      network::mojom::WebSandboxFlags flags,
-      const ParsedFeaturePolicy& feature_policy_header,
-      const DocumentPolicyFeatureState& document_policy_header) {}
-
   // Called when a watched CSS selector matches or stops matching.
   virtual void DidMatchCSS(
       const WebVector<WebString>& newly_matching_selectors,
@@ -341,9 +337,12 @@
   // The one exception is if the Window object is reused; in that case, blink
   // passes |should_reset_browser_interface_broker| = false, and the old
   // BrowserInterfaceBroker connection will be reused.
-  virtual void DidCommitNavigation(WebHistoryCommitType,
-                                   bool should_reset_browser_interface_broker) {
-  }
+  virtual void DidCommitNavigation(
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) {}
 
   // The frame's initial empty document has just been initialized.
   virtual void DidCreateInitialEmptyDocument() {}
diff --git a/third_party/blink/public/web/web_performance.h b/third_party/blink/public/web/web_performance.h
index f637dc2..bc77bb0e 100644
--- a/third_party/blink/public/web/web_performance.h
+++ b/third_party/blink/public/web/web_performance.h
@@ -47,9 +47,17 @@
 
 class WebPerformance {
  public:
+  // The count to record the times on requestAnimationFrame after the page is
+  // restored from the back-forward cache.
+  static constexpr int
+      kRequestAnimationFramesToRecordAfterBackForwardCacheRestore = 3;
+
   struct BackForwardCacheRestoreTiming {
     double navigation_start = 0;
     double first_paint = 0;
+    std::array<double,
+               kRequestAnimationFramesToRecordAfterBackForwardCacheRestore>
+        request_animation_frames = {};
     base::Optional<base::TimeDelta> first_input_delay;
   };
 
diff --git a/third_party/blink/renderer/bindings/generated_in_core.gni b/third_party/blink/renderer/bindings/generated_in_core.gni
index 0763ae5..d824770d 100644
--- a/third_party/blink/renderer/bindings/generated_in_core.gni
+++ b/third_party/blink/renderer/bindings/generated_in_core.gni
@@ -191,6 +191,12 @@
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_measure_memory_breakdown.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_media_query_list_event_init.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_media_query_list_event_init.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_attribution.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_attribution.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_breakdown_entry.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_breakdown_entry.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_measurement.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_memory_measurement.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_message_event_init.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_message_event_init.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_mojo_create_data_pipe_options.cc",
diff --git a/third_party/blink/renderer/core/animation/css/css_scroll_timeline.cc b/third_party/blink/renderer/core/animation/css/css_scroll_timeline.cc
index 179646a..bcc37c7 100644
--- a/third_party/blink/renderer/core/animation/css/css_scroll_timeline.cc
+++ b/third_party/blink/renderer/core/animation/css/css_scroll_timeline.cc
@@ -82,8 +82,10 @@
 ScrollTimelineElementBasedOffset* ComputeElementBasedOffset(
     Document& document,
     const cssvalue::CSSElementOffsetValue* value) {
-  auto* offset = MakeGarbageCollected<ScrollTimelineElementBasedOffset>();
-  offset->setTarget(ComputeElementOffsetTarget(document, value->Target()));
+  auto* offset = ScrollTimelineElementBasedOffset::Create();
+  Element* target = ComputeElementOffsetTarget(document, value->Target());
+  if (target)
+    offset->setTarget(target);
   offset->setEdge(ComputeElementOffsetEdge(value->Edge()));
   offset->setThreshold(ComputeElementOffsetThreshold(value->Threshold()));
   return offset;
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline_offset.cc b/third_party/blink/renderer/core/animation/scroll_timeline_offset.cc
index 7555b92..6631be0 100644
--- a/third_party/blink/renderer/core/animation/scroll_timeline_offset.cc
+++ b/third_party/blink/renderer/core/animation/scroll_timeline_offset.cc
@@ -58,8 +58,11 @@
     return true;
   if (!o1 || !o2)
     return false;
-  return (o1->edge() == o2->edge()) && (o1->target() == o2->target()) &&
-         (o1->threshold() == o2->threshold());
+  // TODO(crbug.com/1070871): Use targetOr(nullptr) after migration is done.
+  Element* target_or_null1 = o1->hasTarget() ? o1->target() : nullptr;
+  Element* target_or_null2 = o2->hasTarget() ? o2->target() : nullptr;
+  return target_or_null1 == target_or_null2 && o1->edge() == o2->edge() &&
+         o1->threshold() == o2->threshold();
 }
 
 CSSKeywordValue* GetCSSKeywordValue(const ScrollTimelineOffsetValue& offset) {
diff --git a/third_party/blink/renderer/core/editing/editing_utilities.cc b/third_party/blink/renderer/core/editing/editing_utilities.cc
index 1bf24e39..e83d286 100644
--- a/third_party/blink/renderer/core/editing/editing_utilities.cc
+++ b/third_party/blink/renderer/core/editing/editing_utilities.cc
@@ -1405,7 +1405,7 @@
           !node.IsShadowIncludingInclusiveAncestorOf(*container_node)) {
         return position;
       }
-      return Position::InParentAfterNode(node);
+      return Position::InParentBeforeNode(node);
     case PositionAnchorType::kOffsetInAnchor:
       container_node = position.ComputeContainerNode();
       if (container_node == node.parentNode() &&
@@ -1423,7 +1423,7 @@
       if (!anchor_node ||
           !node.IsShadowIncludingInclusiveAncestorOf(*anchor_node))
         return position;
-      return Position::InParentAfterNode(node);
+      return Position::InParentBeforeNode(node);
     case PositionAnchorType::kBeforeAnchor:
       anchor_node = position.AnchorNode();
       if (!anchor_node ||
diff --git a/third_party/blink/renderer/core/editing/editing_utilities.h b/third_party/blink/renderer/core/editing/editing_utilities.h
index 861779c..15fd671 100644
--- a/third_party/blink/renderer/core/editing/editing_utilities.h
+++ b/third_party/blink/renderer/core/editing/editing_utilities.h
@@ -274,7 +274,8 @@
 //  <editable>|<non-editable>abc</non-editable></editable>
 PositionWithAffinity AdjustForEditingBoundary(const PositionWithAffinity&);
 
-Position ComputePositionForNodeRemoval(const Position&, const Node&);
+CORE_EXPORT Position ComputePositionForNodeRemoval(const Position&,
+                                                   const Node&);
 
 // TODO(editing-dev): These two functions should be eliminated.
 CORE_EXPORT Position PositionBeforeNode(const Node&);
diff --git a/third_party/blink/renderer/core/editing/editing_utilities_test.cc b/third_party/blink/renderer/core/editing/editing_utilities_test.cc
index 3c3a5ea..f029a15 100644
--- a/third_party/blink/renderer/core/editing/editing_utilities_test.cc
+++ b/third_party/blink/renderer/core/editing/editing_utilities_test.cc
@@ -12,6 +12,23 @@
 
 class EditingUtilitiesTest : public EditingTestBase {};
 
+TEST_F(EditingUtilitiesTest, ComputePositionForNodeRemovalAfterChildren) {
+  SetBodyContent("<div id=a><p id=b><img id=c></p></div>");
+  const Position position = Position::LastPositionInNode(*GetElementById("c"));
+  // Simulate <p> will be removed.
+  EXPECT_EQ(Position(*GetElementById("a"), 0),
+            ComputePositionForNodeRemoval(position, *GetElementById("b")));
+}
+
+TEST_F(EditingUtilitiesTest, ComputePositionForNodeRemovalAfterNode) {
+  // "editing/deleting/delete-start-block.html" hits this case.
+  SetBodyContent("<div id=a><p id=b><img id=c></p></div>");
+  const Position position = Position::AfterNode(*GetElementById("c"));
+  // Simulate <p> will be removed.
+  EXPECT_EQ(Position(*GetElementById("a"), 0),
+            ComputePositionForNodeRemoval(position, *GetElementById("b")));
+}
+
 TEST_F(EditingUtilitiesTest, DirectionOfEnclosingBlockOf) {
   const char* body_content =
       "<p id='host'><b id='one'></b><b id='two'>22</b></p>";
diff --git a/third_party/blink/renderer/core/exported/web_document_subresource_filter_test.cc b/third_party/blink/renderer/core/exported/web_document_subresource_filter_test.cc
index bd592295..f72fa28 100644
--- a/third_party/blink/renderer/core/exported/web_document_subresource_filter_test.cc
+++ b/third_party/blink/renderer/core/exported/web_document_subresource_filter_test.cc
@@ -70,7 +70,12 @@
 class SubresourceFilteringWebFrameClient
     : public frame_test_helpers::TestWebFrameClient {
  public:
-  void DidCommitNavigation(WebHistoryCommitType, bool) override {
+  void DidCommitNavigation(
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) override {
     subresource_filter_ =
         new TestDocumentSubresourceFilter(load_policy_for_next_load_);
     subresource_filter_->AddToBlocklist("1x1.png");
diff --git a/third_party/blink/renderer/core/exported/web_performance.cc b/third_party/blink/renderer/core/exported/web_performance.cc
index 0cf84a5f..336dd8c0 100644
--- a/third_party/blink/renderer/core/exported/web_performance.cc
+++ b/third_party/blink/renderer/core/exported/web_performance.cc
@@ -80,6 +80,11 @@
         MillisecondsToSeconds(restore_timings[i].navigation_start);
     timings[i].first_paint =
         MillisecondsToSeconds(restore_timings[i].first_paint);
+    for (size_t j = 0; j < restore_timings[i].request_animation_frames.size();
+         j++) {
+      timings[i].request_animation_frames[j] =
+          MillisecondsToSeconds(restore_timings[i].request_animation_frames[j]);
+    }
     timings[i].first_input_delay = restore_timings[i].first_input_delay;
   }
   return timings;
diff --git a/third_party/blink/renderer/core/exported/web_plugin_container_test.cc b/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
index a5ff8d4..44965521 100644
--- a/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
+++ b/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
@@ -206,7 +206,10 @@
       const WebString& fallback_name,
       const FramePolicy&,
       const WebFrameOwnerProperties&,
-      mojom::blink::FrameOwnerElementType owner_type) override {
+      mojom::blink::FrameOwnerElementType owner_type,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     return CreateLocalChild(*parent, scope,
                             std::make_unique<TestPluginWebFrameClient>());
   }
diff --git a/third_party/blink/renderer/core/exported/web_view_test.cc b/third_party/blink/renderer/core/exported/web_view_test.cc
index 5f18592..22fb03d 100644
--- a/third_party/blink/renderer/core/exported/web_view_test.cc
+++ b/third_party/blink/renderer/core/exported/web_view_test.cc
@@ -4018,13 +4018,17 @@
     : public frame_test_helpers::TestWebFrameClient {
  public:
   CreateChildCounterFrameClient() : count_(0) {}
-  WebLocalFrame* CreateChildFrame(WebLocalFrame* parent,
-                                  mojom::blink::TreeScopeType,
-                                  const WebString& name,
-                                  const WebString& fallback_name,
-                                  const FramePolicy&,
-                                  const WebFrameOwnerProperties&,
-                                  mojom::blink::FrameOwnerElementType) override;
+  WebLocalFrame* CreateChildFrame(
+      WebLocalFrame* parent,
+      mojom::blink::TreeScopeType,
+      const WebString& name,
+      const WebString& fallback_name,
+      const FramePolicy&,
+      const WebFrameOwnerProperties&,
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override;
 
   int Count() const { return count_; }
 
@@ -4039,11 +4043,14 @@
     const WebString& fallback_name,
     const FramePolicy& frame_policy,
     const WebFrameOwnerProperties& frame_owner_properties,
-    mojom::blink::FrameOwnerElementType frame_owner_element_type) {
+    mojom::blink::FrameOwnerElementType frame_owner_element_type,
+    blink::CrossVariantMojoAssociatedReceiver<
+        blink::mojom::PolicyContainerHostInterfaceBase>
+        policy_container_host_receiver) {
   ++count_;
   return TestWebFrameClient::CreateChildFrame(
       parent, scope, name, fallback_name, frame_policy, frame_owner_properties,
-      frame_owner_element_type);
+      frame_owner_element_type, std::move(policy_container_host_receiver));
 }
 
 TEST_F(WebViewTest, ChangeDisplayMode) {
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.cc b/third_party/blink/renderer/core/frame/frame_test_helpers.cc
index 173c59d..2de9f63 100644
--- a/third_party/blink/renderer/core/frame/frame_test_helpers.cc
+++ b/third_party/blink/renderer/core/frame/frame_test_helpers.cc
@@ -664,7 +664,10 @@
     const WebString& fallback_name,
     const FramePolicy&,
     const WebFrameOwnerProperties& frame_owner_properties,
-    mojom::blink::FrameOwnerElementType owner_type) {
+    mojom::blink::FrameOwnerElementType owner_type,
+    blink::CrossVariantMojoAssociatedReceiver<
+        mojom::PolicyContainerHostInterfaceBase>
+        policy_container_host_receiver) {
   return CreateLocalChild(*parent, scope);
 }
 
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.h b/third_party/blink/renderer/core/frame/frame_test_helpers.h
index 20d699e..279b4c4 100644
--- a/third_party/blink/renderer/core/frame/frame_test_helpers.h
+++ b/third_party/blink/renderer/core/frame/frame_test_helpers.h
@@ -441,7 +441,10 @@
                                   const WebString& fallback_name,
                                   const FramePolicy&,
                                   const WebFrameOwnerProperties&,
-                                  mojom::blink::FrameOwnerElementType) override;
+                                  mojom::blink::FrameOwnerElementType,
+                                  blink::CrossVariantMojoAssociatedReceiver<
+                                      mojom::PolicyContainerHostInterfaceBase>
+                                      policy_container_host_receiver) override;
   void DidStartLoading() override;
   void DidStopLoading() override;
   std::unique_ptr<blink::WebURLLoaderFactory> CreateURLLoaderFactory()
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index d83455d1..91737a7 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -39,6 +39,8 @@
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "services/network/public/mojom/content_security_policy.mojom-blink-forward.h"
 #include "services/network/public/mojom/ip_address_space.mojom-blink-forward.h"
+#include "services/network/public/mojom/web_sandbox_flags.mojom-blink-forward.h"
+#include "third_party/blink/public/common/feature_policy/document_policy_features.h"
 #include "third_party/blink/public/common/feature_policy/feature_policy.h"
 #include "third_party/blink/public/common/loader/loading_behavior_flag.h"
 #include "third_party/blink/public/common/navigation/triggering_event_info.h"
@@ -133,9 +135,12 @@
                                                bool content_initiated) {}
   virtual void DispatchDidReceiveTitle(const String&) = 0;
   virtual void DispatchDidCommitLoad(
-      HistoryItem*,
-      WebHistoryCommitType,
-      bool should_reset_browser_interface_broker) = 0;
+      HistoryItem* item,
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header) = 0;
   virtual void DispatchDidFailLoad(const ResourceError&,
                                    WebHistoryCommitType) = 0;
   virtual void DispatchDidFinishDocumentLoad() = 0;
@@ -301,11 +306,6 @@
 
   virtual void DidChangeName(const String&) {}
 
-  virtual void DidSetFramePolicyHeaders(
-      network::mojom::blink::WebSandboxFlags,
-      const ParsedFeaturePolicy& feature_policy_header,
-      const DocumentPolicyFeatureState& document_policy_header) {}
-
   virtual std::unique_ptr<WebServiceWorkerProvider>
   CreateServiceWorkerProvider() = 0;
 
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
index 91a1a67..ac90649 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -535,7 +535,10 @@
 void LocalFrameClientImpl::DispatchDidCommitLoad(
     HistoryItem* item,
     WebHistoryCommitType commit_type,
-    bool should_reset_browser_interface_broker) {
+    bool should_reset_browser_interface_broker,
+    network::mojom::WebSandboxFlags sandbox_flags,
+    const blink::ParsedFeaturePolicy& feature_policy_header,
+    const blink::DocumentPolicyFeatureState& document_policy_header) {
   if (!web_frame_->Parent()) {
     web_frame_->ViewImpl()->DidCommitLoad(commit_type == kWebStandardCommit,
                                           false);
@@ -543,8 +546,8 @@
 
   if (web_frame_->Client()) {
     web_frame_->Client()->DidCommitNavigation(
-        commit_type, should_reset_browser_interface_broker);
-
+        commit_type, should_reset_browser_interface_broker, sandbox_flags,
+        feature_policy_header, document_policy_header);
     if (web_frame_->GetFrame()->IsLocalRoot()) {
       // This update should be sent as soon as loading the new document begins
       // so that the browser and compositor could reset their states. However,
@@ -981,17 +984,6 @@
   web_frame_->Client()->DidChangeName(name);
 }
 
-void LocalFrameClientImpl::DidSetFramePolicyHeaders(
-    network::mojom::blink::WebSandboxFlags sandbox_flags,
-    const ParsedFeaturePolicy& feature_policy_header,
-    const DocumentPolicyFeatureState& document_policy_header) {
-  if (web_frame_->Client()) {
-    web_frame_->Client()->DidSetFramePolicyHeaders(
-        static_cast<network::mojom::blink::WebSandboxFlags>(sandbox_flags),
-        feature_policy_header, document_policy_header);
-  }
-}
-
 std::unique_ptr<WebServiceWorkerProvider>
 LocalFrameClientImpl::CreateServiceWorkerProvider() {
   if (!web_frame_->Client())
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
index 537639f..4070444 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -98,7 +98,10 @@
   void DispatchDidCommitLoad(
       HistoryItem*,
       WebHistoryCommitType,
-      bool should_reset_browser_interface_broker) override;
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header) override;
   void DispatchDidFailLoad(const ResourceError&, WebHistoryCommitType) override;
   void DispatchDidFinishDocumentLoad() override;
   void DispatchDidFinishLoad() override;
@@ -190,10 +193,6 @@
   bool AllowContentInitiatedDataUrlNavigations(const KURL&) override;
 
   void DidChangeName(const String&) override;
-  void DidSetFramePolicyHeaders(
-      network::mojom::blink::WebSandboxFlags,
-      const ParsedFeaturePolicy& fp_header,
-      const blink::DocumentPolicyFeatureState& dp_header) override;
 
   std::unique_ptr<WebServiceWorkerProvider> CreateServiceWorkerProvider()
       override;
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
index 946b2a2a..c911284 100644
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
@@ -4224,7 +4224,12 @@
   ~ClearScrollStateOnCommitWebFrameClient() override = default;
 
   // frame_test_helpers::TestWebFrameClient:
-  void DidCommitNavigation(WebHistoryCommitType, bool) override {
+  void DidCommitNavigation(
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) override {
     Frame()->View()->ResetScrollAndScaleState();
   }
 };
@@ -4443,7 +4448,10 @@
       const WebString& fallback_name,
       const FramePolicy&,
       const WebFrameOwnerProperties&,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     return CreateLocalChild(*parent, scope,
                             std::make_unique<ContextLifetimeTestWebFrameClient>(
                                 create_notifications_, release_notifications_));
@@ -6385,15 +6393,23 @@
 class TestWillInsertBodyWebFrameClient
     : public frame_test_helpers::TestWebFrameClient {
  public:
-  TestWillInsertBodyWebFrameClient() : did_load_(false) {}
-  ~TestWillInsertBodyWebFrameClient() override = default;
+  TestWillInsertBodyWebFrameClient() = default;
+  ~TestWillInsertBodyWebFrameClient() final = default;
+
+  bool did_load() const { return did_load_; }
 
   // frame_test_helpers::TestWebFrameClient:
-  void DidCommitNavigation(WebHistoryCommitType, bool) override {
+  void DidCommitNavigation(
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) final {
     did_load_ = true;
   }
 
-  bool did_load_;
+ private:
+  bool did_load_ = false;
 };
 
 TEST_F(WebFrameTest, HTMLDocument) {
@@ -6404,7 +6420,7 @@
   web_view_helper.InitializeAndLoad(base_url_ + "clipped-body.html",
                                     &web_frame_client);
 
-  EXPECT_TRUE(web_frame_client.did_load_);
+  EXPECT_TRUE(web_frame_client.did_load());
 }
 
 TEST_F(WebFrameTest, EmptyDocument) {
@@ -6414,7 +6430,7 @@
   frame_test_helpers::WebViewHelper web_view_helper;
   web_view_helper.Initialize(&web_frame_client);
 
-  EXPECT_FALSE(web_frame_client.did_load_);
+  EXPECT_FALSE(web_frame_client.did_load());
 }
 
 TEST_F(WebFrameTest, MoveCaretSelectionTowardsWindowPointWithNoSelection) {
@@ -7235,7 +7251,10 @@
       const WebString&,
       const FramePolicy&,
       const WebFrameOwnerProperties& frame_owner_properties,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     auto child = std::make_unique<TestCachePolicyWebFrameClient>();
     auto* child_ptr = child.get();
     child_clients_.push_back(std::move(child));
@@ -7727,7 +7746,10 @@
       const WebString& fallback_name,
       const FramePolicy&,
       const WebFrameOwnerProperties& frame_owner_properties,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     ++call_count_;
     return nullptr;
   }
@@ -8860,7 +8882,10 @@
       const WebString& fallback_name,
       const FramePolicy&,
       const WebFrameOwnerProperties&,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     return CreateLocalChild(*parent, scope,
                             std::make_unique<WebFrameSwapTestClient>(this));
   }
@@ -9478,8 +9503,12 @@
   ~RemoteToLocalSwapWebFrameClient() override = default;
 
   // frame_test_helpers::TestWebFrameClient:
-  void DidCommitNavigation(WebHistoryCommitType history_commit_type,
-                           bool) override {
+  void DidCommitNavigation(
+      WebHistoryCommitType history_commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) override {
     history_commit_type_ = history_commit_type;
     remote_frame_->Swap(Frame());
   }
@@ -9731,21 +9760,25 @@
 
 class CommitTypeWebFrameClient : public frame_test_helpers::TestWebFrameClient {
  public:
-  CommitTypeWebFrameClient() : history_commit_type_(kWebHistoryInertCommit) {}
-  ~CommitTypeWebFrameClient() override = default;
-
-  // frame_test_helpers::TestWebFrameClient:
-  void DidCommitNavigation(WebHistoryCommitType history_commit_type,
-                           bool) override {
-    history_commit_type_ = history_commit_type;
-  }
+  CommitTypeWebFrameClient() = default;
+  ~CommitTypeWebFrameClient() final = default;
 
   WebHistoryCommitType HistoryCommitType() const {
     return history_commit_type_;
   }
 
+  // frame_test_helpers::TestWebFrameClient:
+  void DidCommitNavigation(
+      WebHistoryCommitType history_commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) final {
+    history_commit_type_ = history_commit_type;
+  }
+
  private:
-  WebHistoryCommitType history_commit_type_;
+  WebHistoryCommitType history_commit_type_ = kWebHistoryInertCommit;
 };
 
 TEST_F(WebFrameTest, RemoteFrameInitialCommitType) {
@@ -10995,7 +11028,10 @@
       const WebString& fallback_name,
       const FramePolicy&,
       const WebFrameOwnerProperties&,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     return CreateLocalChild(*parent, scope, &child_client_);
   }
 
@@ -12696,7 +12732,10 @@
         const WebString& fallback_name,
         const FramePolicy&,
         const WebFrameOwnerProperties&,
-        mojom::blink::FrameOwnerElementType) override {
+        mojom::blink::FrameOwnerElementType,
+        blink::CrossVariantMojoAssociatedReceiver<
+            blink::mojom::PolicyContainerHostInterfaceBase>
+            policy_container_host_receiver) override {
       return CreateLocalChild(*parent, scope, &child_client_);
     }
 
@@ -12968,7 +13007,10 @@
       const WebString&,
       const FramePolicy&,
       const WebFrameOwnerProperties& frameOwnerProperties,
-      mojom::blink::FrameOwnerElementType) override {
+      mojom::blink::FrameOwnerElementType,
+      blink::CrossVariantMojoAssociatedReceiver<
+          blink::mojom::PolicyContainerHostInterfaceBase>
+          policy_container_host_receiver) override {
     DCHECK(child_client_);
     return CreateLocalChild(*parent, scope, child_client_);
   }
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_client_test.cc b/third_party/blink/renderer/core/frame/web_local_frame_client_test.cc
index 5d760de..5db517f 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_client_test.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_client_test.cc
@@ -32,11 +32,15 @@
   }
 
   void DidCommitNavigation(
-      WebHistoryCommitType type,
-      bool should_reset_browser_interface_broker) override {
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const ParsedFeaturePolicy& feature_policy_header,
+      const DocumentPolicyFeatureState& document_policy_header) override {
     calls_.push_back("DidCommitNavigation");
     TestWebFrameClient::DidCommitNavigation(
-        type, should_reset_browser_interface_broker);
+        commit_type, should_reset_browser_interface_broker, sandbox_flags,
+        feature_policy_header, document_policy_header);
   }
 
   void DidCreateInitialEmptyDocument() override {
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 9d46d66d..d554a60f 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -2030,25 +2030,28 @@
       owner_element->MarginHeight(), owner_element->AllowFullscreen(),
       owner_element->AllowPaymentRequest(), owner_element->IsDisplayNone(),
       owner_element->GetColorScheme(), owner_element->RequiredCsp());
-  // FIXME: Using subResourceAttributeName as fallback is not a perfect
-  // solution. subResourceAttributeName returns just one attribute name. The
-  // element might not have the attribute, and there might be other attributes
-  // which can identify the element.
-  WebLocalFrameImpl* webframe_child = To<WebLocalFrameImpl>(
-      client_->CreateChildFrame(this, scope, name,
-                                owner_element->getAttribute(
-                                    owner_element->SubResourceAttributeName()),
-                                owner_element->GetFramePolicy(),
-                                owner_properties, owner_element->OwnerType()));
-  if (!webframe_child)
-    return nullptr;
 
-  // Inherit policy container from parent.
   mojo::PendingAssociatedRemote<mojom::blink::PolicyContainerHost>
       policy_container_remote;
   mojo::PendingAssociatedReceiver<mojom::blink::PolicyContainerHost>
       policy_container_receiver =
           policy_container_remote.InitWithNewEndpointAndPassReceiver();
+
+  // FIXME: Using subResourceAttributeName as fallback is not a perfect
+  // solution. subResourceAttributeName returns just one attribute name. The
+  // element might not have the attribute, and there might be other attributes
+  // which can identify the element.
+  WebLocalFrameImpl* webframe_child =
+      To<WebLocalFrameImpl>(client_->CreateChildFrame(
+          this, scope, name,
+          owner_element->getAttribute(
+              owner_element->SubResourceAttributeName()),
+          owner_element->GetFramePolicy(), owner_properties,
+          owner_element->OwnerType(), std::move(policy_container_receiver)));
+  if (!webframe_child)
+    return nullptr;
+
+  // Inherit policy container from parent.
   mojom::blink::PolicyContainerDocumentPoliciesPtr policy_container_data =
       mojo::Clone(GetFrame()->GetPolicyContainer()->GetPolicies());
   std::unique_ptr<PolicyContainer> policy_container =
@@ -2063,15 +2066,6 @@
           : &GetFrame()->window_agent_factory(),
       nullptr, std::move(policy_container));
 
-  // TODO(antoniosartori): Ideally, we could have sent the mojo receiver to the
-  // Browser with the CreateChildFrame IPC. Unfortunately, that's not so easy,
-  // both because that is a legacy (non-mojo) IPC sync call, and because it
-  // starts from the content layer, so it would require additional type
-  // conversions. But we should revisit this after that IPC gets reworked (see
-  // https://crbug.com/1064336).
-  webframe_child->GetFrame()->GetLocalFrameHostRemote().BindPolicyContainer(
-      std::move(policy_container_receiver));
-
   DCHECK(webframe_child->Parent());
   return webframe_child->GetFrame();
 }
diff --git a/third_party/blink/renderer/core/layout/hit_test_result.cc b/third_party/blink/renderer/core/layout/hit_test_result.cc
index 03a61c10..493aec23 100644
--- a/third_party/blink/renderer/core/layout/hit_test_result.cc
+++ b/third_party/blink/renderer/core/layout/hit_test_result.cc
@@ -147,8 +147,8 @@
     Node* node,
     scoped_refptr<const NGPhysicalBoxFragment> box_fragment,
     const PhysicalOffset& position) {
-  SetBoxFragment(std::move(box_fragment));
-  SetNodeAndPosition(node, position);
+  local_point_ = position;
+  SetInnerNodeAndBoxFragment(node, std::move(box_fragment));
 }
 
 void HitTestResult::OverrideNodeAndPosition(Node* node,
@@ -181,9 +181,13 @@
     return PositionWithAffinity(
         MostForwardCaretPosition(Position::FirstPositionInNode(*inner_node_)));
   }
+  // TODO(crbug.com/1152696): We have to use PostLayout() here, but maybe it
+  // should rather be illegal to call GetPosition() on a HitTestResult after
+  // relayout?
   if (box_fragment_ &&
-      RuntimeEnabledFeatures::LayoutNGFullPositionForPointEnabled())
-    return box_fragment_->PositionForPoint(LocalPoint());
+      RuntimeEnabledFeatures::LayoutNGFullPositionForPointEnabled() &&
+      !box_fragment_->IsLayoutObjectDestroyedOrMoved())
+    return box_fragment_->PostLayout()->PositionForPoint(LocalPoint());
   return layout_object->PositionForPoint(LocalPoint());
 }
 
@@ -285,10 +289,17 @@
 }
 
 void HitTestResult::SetInnerNode(Node* n) {
+  SetInnerNodeAndBoxFragment(n, /* box_fragment */ nullptr);
+}
+
+void HitTestResult::SetInnerNodeAndBoxFragment(
+    Node* n,
+    scoped_refptr<const NGPhysicalBoxFragment> box_fragment) {
   if (!n) {
     inner_possibly_pseudo_node_ = nullptr;
     inner_node_ = nullptr;
     inner_element_ = nullptr;
+    DCHECK(!box_fragment);
     box_fragment_ = nullptr;
     return;
   }
@@ -309,7 +320,9 @@
     }
   }
 
-  if (RuntimeEnabledFeatures::LayoutNGFullPositionForPointEnabled()) {
+  if (box_fragment) {
+    SetBoxFragment(std::move(box_fragment));
+  } else if (RuntimeEnabledFeatures::LayoutNGFullPositionForPointEnabled()) {
     if (const LayoutBox* layout_box = n->GetLayoutBox()) {
       // Fragmentation-aware code will set the correct box fragment on its own,
       // but sometimes we enter legacy layout code when hit-testing, e.g. for
diff --git a/third_party/blink/renderer/core/layout/hit_test_result.h b/third_party/blink/renderer/core/layout/hit_test_result.h
index e6b267f..91dccabb 100644
--- a/third_party/blink/renderer/core/layout/hit_test_result.h
+++ b/third_party/blink/renderer/core/layout/hit_test_result.h
@@ -149,6 +149,8 @@
   const HitTestRequest& GetHitTestRequest() const { return hit_test_request_; }
 
   void SetInnerNode(Node*);
+  void SetInnerNodeAndBoxFragment(Node*,
+                                  scoped_refptr<const NGPhysicalBoxFragment>);
   void SetInertNode(Node*);
   HTMLAreaElement* ImageAreaForImage() const;
   void SetURLElement(Element*);
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h
index ef3c594..0bde454 100644
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h
@@ -480,6 +480,8 @@
   // fragmentainers. Use following functions when moving to different
   // fragmentainers.
 
+  bool IsBlockFragmented() const { return max_fragment_index_ > 0; }
+
   // Move to the first item of the first fragmentainer.
   void MoveToFirstIncludingFragmentainer();
 
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
index 4e65c56..6c849a8 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
@@ -1090,6 +1090,11 @@
       // Issue full invalidation, in case the number of column rules have
       // changed.
       needs_full_invalidation = true;
+    } else if (block->IsAnonymous() && !block->IsInline() &&
+               block->IsLayoutBlockFlow() && block->Continuation()) {
+      // When this is a block-in-inline created by |SplineInlines|, we may need
+      // to paint outlines for this. See |NGBoxFragmentPainter|.
+      needs_full_invalidation = true;
     }
 
     block->SetNeedsOverflowRecalc(
diff --git a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc
index 8057940..5bddc9d 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc
@@ -25,28 +25,31 @@
     const NGPhysicalBoxFragment& physical_fragment) {
   if (!physical_fragment.IsInlineBox())
     return true;
+
+  // In order to compute united outlines, collect all rectangles of inline
+  // fragments for |LayoutInline| if |this| is the first inline fragment.
+  // Otherwise return none.
   const LayoutObject* layout_object = physical_fragment.GetLayoutObject();
   DCHECK(layout_object);
   DCHECK(layout_object->IsLayoutInline());
-
-  // A |LayoutInline| can be split across multiple objects. The first fragment
-  // produced should paint the outline for *all* fragments.
-  if (layout_object->IsElementContinuation()) {
-    // If the |LayoutInline|'s continuation-root generated a fragment, we
-    // shouldn't paint the outline.
-    DCHECK(layout_object->ContinuationRoot());
-    NGInlineCursor cursor;
-    cursor.MoveTo(*layout_object->ContinuationRoot());
-    if (cursor)
-      return false;
-  }
-
-  // The first fragment paints all outlines. Check if this is the first fragment
-  // for the |layout_object|.
   NGInlineCursor cursor;
   cursor.MoveTo(*layout_object);
   DCHECK(cursor);
-  return cursor.Current().BoxFragment() == &physical_fragment;
+  if (cursor.Current().BoxFragment() == &physical_fragment)
+    return true;
+  if (!cursor.IsBlockFragmented())
+    return false;
+
+  // When |LayoutInline| is block fragmented, unite rectangles for each block
+  // fragment. To do this, return |true| if |this| is the first inline fragment
+  // of a block fragment.
+  while (true) {
+    wtf_size_t fragment_index = cursor.CurrentContainerFragmentIndex();
+    cursor.MoveToNextForSameLayoutObject();
+    DCHECK(cursor);
+    if (cursor.Current().BoxFragment() == &physical_fragment)
+      return fragment_index != cursor.CurrentContainerFragmentIndex();
+  }
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
index 431aa4f7..dcd7c8b 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
@@ -681,33 +681,31 @@
     const PhysicalOffset& additional_offset,
     NGOutlineType outline_type,
     Vector<PhysicalRect>* outline_rects) const {
+  AddOutlineRects(additional_offset, outline_type,
+                  /* container_relative */ false, outline_rects);
+}
+
+void NGPhysicalBoxFragment::AddOutlineRects(
+    const PhysicalOffset& additional_offset,
+    NGOutlineType outline_type,
+    Vector<PhysicalRect>* outline_rects) const {
+  AddOutlineRects(additional_offset, outline_type,
+                  /* container_relative */ true, outline_rects);
+}
+
+void NGPhysicalBoxFragment::AddOutlineRects(
+    const PhysicalOffset& additional_offset,
+    NGOutlineType outline_type,
+    bool inline_container_relative,
+    Vector<PhysicalRect>* outline_rects) const {
   DCHECK_EQ(PostLayout(), this);
-  if (!NGOutlineUtils::ShouldPaintOutline(*this))
-    return;
 
   if (IsInlineBox()) {
-    const LayoutObject* layout_object = GetLayoutObject();
-    DCHECK(layout_object);
-    DCHECK(layout_object->IsLayoutInline());
-    Vector<PhysicalRect> blockflow_outline_rects =
-        layout_object->OutlineRects(PhysicalOffset(), outline_type);
-    // The rectangles returned are offset from the containing block. We need the
-    // offset from this fragment.
-    if (blockflow_outline_rects.size() > 0) {
-      PhysicalOffset first_fragment_offset = blockflow_outline_rects[0].offset;
-      PhysicalOffset corrected_offset =
-          additional_offset - first_fragment_offset;
-      for (auto& outline : blockflow_outline_rects) {
-        // Skip if both width and height are zero. Containing blocks in empty
-        // linebox is one such case.
-        if (outline.size.IsZero())
-          continue;
-        outline.Move(corrected_offset);
-        outline_rects->push_back(outline);
-      }
-    }
+    AddOutlineRectsForInlineBox(additional_offset, outline_type,
+                                inline_container_relative, outline_rects);
     return;
   }
+  DCHECK(NGOutlineUtils::ShouldPaintOutline(*this));
 
   // For anonymous blocks, the children add outline rects.
   if (!IsAnonymousBlock())
@@ -737,6 +735,72 @@
   // LayoutBlockFlow::AddOutlineRects?
 }
 
+void NGPhysicalBoxFragment::AddOutlineRectsForInlineBox(
+    PhysicalOffset additional_offset,
+    NGOutlineType outline_type,
+    bool container_relative,
+    Vector<PhysicalRect>* rects) const {
+  DCHECK_EQ(PostLayout(), this);
+  DCHECK(IsInlineBox());
+
+  if (!NGOutlineUtils::ShouldPaintOutline(*this))
+    return;
+
+  // In order to compute united outlines, collect all rectangles of inline
+  // fragments for |LayoutInline| if |this| is the first inline fragment.
+  // Otherwise return none.
+  //
+  // When |LayoutInline| is block fragmented, unite rectangles for each block
+  // fragment.
+  DCHECK(GetLayoutObject());
+  DCHECK(GetLayoutObject()->IsLayoutInline());
+  const auto* layout_object = To<LayoutInline>(GetLayoutObject());
+  const wtf_size_t initial_rects_size = rects->size();
+  NGInlineCursor cursor;
+  cursor.MoveTo(*layout_object);
+  DCHECK(cursor);
+  wtf_size_t fragment_index = cursor.CurrentContainerFragmentIndex();
+  bool has_this_fragment = false;
+  for (;; cursor.MoveToNextForSameLayoutObject()) {
+    if (!cursor) {
+      DCHECK(has_this_fragment);
+      break;
+    }
+    if (fragment_index != cursor.CurrentContainerFragmentIndex()) {
+      // If this block fragment has |this|, exit the loop.
+      if (has_this_fragment)
+        break;
+      // Otherwise clear the result and continue to the next block fragment.
+      fragment_index = cursor.CurrentContainerFragmentIndex();
+      rects->Shrink(initial_rects_size);
+    }
+
+    const NGInlineCursorPosition& current = cursor.Current();
+    has_this_fragment = has_this_fragment || current.BoxFragment() == this;
+    if (!current.Size().IsZero())
+      rects->push_back(current.RectInContainerBlock());
+
+    // Add descendants if any, in the container-relative coordinate.
+    if (!current.HasChildren())
+      continue;
+    NGInlineCursor descendants = cursor.CursorForDescendants();
+    AddOutlineRectsForCursor(rects, PhysicalOffset(), outline_type,
+                             layout_object, &descendants);
+  }
+  DCHECK_GE(rects->size(), initial_rects_size);
+  if (rects->size() <= initial_rects_size)
+    return;
+
+  // Adjust the rectangles using |additional_offset| and |container_relative|.
+  if (!container_relative)
+    additional_offset -= (*rects)[initial_rects_size].offset;
+  if (additional_offset.IsZero())
+    return;
+  for (PhysicalRect& rect :
+       base::make_span(rects->begin() + initial_rects_size, rects->end()))
+    rect.offset += additional_offset;
+}
+
 PositionWithAffinity NGPhysicalBoxFragment::PositionForPoint(
     PhysicalOffset point) const {
   if (layout_object_->IsBox() && !layout_object_->IsLayoutNGObject()) {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
index 0d596690..396a64c 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
@@ -231,6 +231,11 @@
   void AddSelfOutlineRects(const PhysicalOffset& additional_offset,
                            NGOutlineType include_block_overflows,
                            Vector<PhysicalRect>* outline_rects) const;
+  // Same as |AddSelfOutlineRects|, except when |this.IsInlineBox()|, in which
+  // case the coordinate system is relative to the inline formatting context.
+  void AddOutlineRects(const PhysicalOffset& additional_offset,
+                       NGOutlineType include_block_overflows,
+                       Vector<PhysicalRect>* outline_rects) const;
 
   PositionWithAffinity PositionForPoint(PhysicalOffset) const;
 
@@ -343,6 +348,15 @@
                               : reinterpret_cast<RareData*>(address);
   }
 
+  void AddOutlineRects(const PhysicalOffset& additional_offset,
+                       NGOutlineType include_block_overflows,
+                       bool inline_container_relative,
+                       Vector<PhysicalRect>* outline_rects) const;
+  void AddOutlineRectsForInlineBox(PhysicalOffset additional_offset,
+                                   NGOutlineType include_block_overflows,
+                                   bool inline_container_relative,
+                                   Vector<PhysicalRect>* outline_rects) const;
+
 #if DCHECK_IS_ON()
   void CheckIntegrity() const;
 #endif
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
index c41013e4..9c63063 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
@@ -140,36 +140,9 @@
   if (const auto* box = DynamicTo<NGPhysicalBoxFragment>(this)) {
     DCHECK_EQ(box->PostLayout(), box);
     if (const NGFragmentItems* items = box->Items()) {
-      for (NGInlineCursor cursor(*box, *items); cursor; cursor.MoveToNext()) {
-        DCHECK(cursor.Current().Item());
-        const NGFragmentItem& item = *cursor.Current().Item();
-        if (UNLIKELY(item.IsLayoutObjectDestroyedOrMoved()))
-          continue;
-        if (item.Type() == NGFragmentItem::kLine) {
-          AddOutlineRectsForDescendant(
-              {item.LineBoxFragment(), item.OffsetInContainerBlock()},
-              outline_rects, additional_offset, outline_type, containing_block);
-          continue;
-        }
-        if (item.IsText()) {
-          if (outline_type == NGOutlineType::kDontIncludeBlockVisualOverflow)
-            continue;
-          outline_rects->push_back(
-              PhysicalRect(additional_offset + item.OffsetInContainerBlock(),
-                           item.Size().ToLayoutSize()));
-          continue;
-        }
-        if (item.Type() == NGFragmentItem::kBox) {
-          if (const NGPhysicalBoxFragment* child_box =
-                  item.PostLayoutBoxFragment()) {
-            DCHECK(!child_box->IsOutOfFlowPositioned());
-            AddOutlineRectsForDescendant(
-                {child_box, item.OffsetInContainerBlock()}, outline_rects,
-                additional_offset, outline_type, containing_block);
-          }
-          continue;
-        }
-      }
+      NGInlineCursor cursor(*box, *items);
+      AddOutlineRectsForCursor(outline_rects, additional_offset, outline_type,
+                               containing_block, &cursor);
       // Don't add |Children()|. If |this| has |NGFragmentItems|, children are
       // either line box, which we already handled in items, or OOF, which we
       // should ignore.
@@ -205,6 +178,44 @@
   }
 }
 
+void NGPhysicalContainerFragment::AddOutlineRectsForCursor(
+    Vector<PhysicalRect>* outline_rects,
+    const PhysicalOffset& additional_offset,
+    NGOutlineType outline_type,
+    const LayoutBoxModelObject* containing_block,
+    NGInlineCursor* cursor) const {
+  for (; *cursor; cursor->MoveToNext()) {
+    DCHECK(cursor->Current().Item());
+    const NGFragmentItem& item = *cursor->Current().Item();
+    if (UNLIKELY(item.IsLayoutObjectDestroyedOrMoved()))
+      continue;
+    if (item.Type() == NGFragmentItem::kLine) {
+      AddOutlineRectsForDescendant(
+          {item.LineBoxFragment(), item.OffsetInContainerBlock()},
+          outline_rects, additional_offset, outline_type, containing_block);
+      continue;
+    }
+    if (item.IsText()) {
+      if (outline_type == NGOutlineType::kDontIncludeBlockVisualOverflow)
+        continue;
+      outline_rects->push_back(
+          PhysicalRect(additional_offset + item.OffsetInContainerBlock(),
+                       item.Size().ToLayoutSize()));
+      continue;
+    }
+    if (item.Type() == NGFragmentItem::kBox) {
+      if (const NGPhysicalBoxFragment* child_box =
+              item.PostLayoutBoxFragment()) {
+        DCHECK(!child_box->IsOutOfFlowPositioned());
+        AddOutlineRectsForDescendant({child_box, item.OffsetInContainerBlock()},
+                                     outline_rects, additional_offset,
+                                     outline_type, containing_block);
+      }
+      continue;
+    }
+  }
+}
+
 void NGPhysicalContainerFragment::AddScrollableOverflowForInlineChild(
     const NGPhysicalBoxFragment& container,
     const ComputedStyle& container_style,
@@ -322,8 +333,8 @@
     if (descendant_box->HasLayer()) {
       DCHECK(descendant_layout_object);
       Vector<PhysicalRect> layer_outline_rects;
-      descendant_box->AddSelfOutlineRects(PhysicalOffset(), outline_type,
-                                          &layer_outline_rects);
+      descendant_box->AddOutlineRects(PhysicalOffset(), outline_type,
+                                      &layer_outline_rects);
 
       // Don't pass additional_offset because LocalToAncestorRects will itself
       // apply it.
@@ -367,20 +378,6 @@
     if (!descendant_line_box->Size().IsEmpty()) {
       outline_rects->emplace_back(additional_offset + descendant.Offset(),
                                   descendant_line_box->Size().ToLayoutSize());
-    } else if (descendant_line_box->Children().empty()) {
-      // Special-case for when the first continuation does not generate
-      // fragments. NGInlineLayoutAlgorithm suppresses box fragments when the
-      // line is "empty". When there is a continuation from the LayoutInline,
-      // the suppression makes such continuation not reachable. Check the
-      // continuation from LayoutInline in such case.
-      DCHECK(GetLayoutObject());
-      if (auto* first_layout_inline =
-              DynamicTo<LayoutInline>(GetLayoutObject()->SlowFirstChild())) {
-        if (!first_layout_inline->IsElementContinuation()) {
-          first_layout_inline->AddOutlineRectsForChildrenAndContinuations(
-              *outline_rects, additional_offset, outline_type);
-        }
-      }
     }
   }
 }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
index fcc71f1..ddf2b82 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
@@ -178,6 +178,11 @@
       const PhysicalOffset& additional_offset,
       NGOutlineType outline_type,
       const LayoutBoxModelObject* containing_block) const;
+  void AddOutlineRectsForCursor(Vector<PhysicalRect>* outline_rects,
+                                const PhysicalOffset& additional_offset,
+                                NGOutlineType outline_type,
+                                const LayoutBoxModelObject* containing_block,
+                                NGInlineCursor* cursor) const;
   void AddOutlineRectsForDescendant(
       const NGLink& descendant,
       Vector<PhysicalRect>* rects,
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_root.h b/third_party/blink/renderer/core/layout/svg/layout_svg_root.h
index caa3008..93039d1 100644
--- a/third_party/blink/renderer/core/layout/svg/layout_svg_root.h
+++ b/third_party/blink/renderer/core/layout/svg/layout_svg_root.h
@@ -74,10 +74,6 @@
     needs_boundaries_or_transform_update_ = true;
   }
 
-  LayoutSize ContainerSize() const {
-    NOT_DESTROYED();
-    return container_size_;
-  }
   void SetContainerSize(const LayoutSize& container_size) {
     NOT_DESTROYED();
     // SVGImage::draw() does a view layout prior to painting,
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.cc
index b6573a4..d471170 100644
--- a/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.cc
+++ b/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.cc
@@ -36,8 +36,7 @@
 
 PathPositionMapper::PositionType PathPositionMapper::PointAndNormalAtLength(
     float length,
-    FloatPoint& point,
-    float& angle) {
+    PointAndTangent& point_and_tangent) {
   if (length < 0)
     return kBeforePath;
   if (length > path_length_)
@@ -45,7 +44,7 @@
   DCHECK_GE(length, 0);
   DCHECK_LE(length, path_length_);
 
-  position_calculator_.PointAndNormalAtLength(length, point, angle);
+  point_and_tangent = position_calculator_.PointAndNormalAtLength(length);
   return kOnPath;
 }
 
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.h b/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.h
index 6661f6d..8ddf0bb 100644
--- a/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.h
+++ b/third_party/blink/renderer/core/layout/svg/layout_svg_text_path.h
@@ -28,6 +28,8 @@
 
 namespace blink {
 
+struct PointAndTangent;
+
 // This class maps a 1D location in the "path space"; [0, path length] to a
 // (2D) point on the path and provides the normal (angle from the x-axis) for
 // said point.
@@ -44,7 +46,7 @@
     kBeforePath,
     kAfterPath,
   };
-  PositionType PointAndNormalAtLength(float length, FloatPoint&, float& angle);
+  PositionType PointAndNormalAtLength(float length, PointAndTangent&);
   float length() const { return path_length_; }
   float StartOffset() const { return path_start_offset_; }
 
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.cc b/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.cc
index 8dcef8d..9219680 100644
--- a/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.cc
+++ b/third_party/blink/renderer/core/layout/svg/svg_text_layout_engine.cc
@@ -441,8 +441,7 @@
     float spacing = spacing_layout.CalculateCSSSpacing(current_character);
 
     FloatPoint text_path_shift;
-    float angle = 0;
-    FloatPoint position;
+    PointAndTangent position;
     if (in_path_layout_) {
       float scaled_glyph_advance = glyph_advance * text_path_scaling_;
       // Setup translations that move to the glyph midpoint.
@@ -460,7 +459,7 @@
                                    spacing * text_path_scaling_;
 
       PathPositionMapper::PositionType position_type =
-          text_path_->PointAndNormalAtLength(text_path_offset, position, angle);
+          text_path_->PointAndNormalAtLength(text_path_offset, position);
 
       // Skip character, if we're before the path.
       if (position_type == PathPositionMapper::kBeforePath) {
@@ -473,24 +472,26 @@
       if (position_type == PathPositionMapper::kAfterPath)
         break;
 
-      text_position_ = position;
+      text_position_ = position.point;
 
       // For vertical text on path, the actual angle has to be rotated 90
       // degrees anti-clockwise, not the orientation angle!
       if (is_vertical_text_)
-        angle -= 90;
+        position.tangent_in_degrees -= 90;
     } else {
-      position = text_position_;
-      position += baseline_shift;
+      position.point = text_position_;
+      position.point += baseline_shift;
     }
 
     if (data.HasRotate())
-      angle += data.rotate;
+      position.tangent_in_degrees += data.rotate;
 
     // Determine whether we have to start a new fragment.
     bool should_start_new_fragment =
-        needs_fragment_per_glyph || has_relative_position || angle ||
-        angle != last_angle || apply_spacing_to_next_character;
+        needs_fragment_per_glyph || has_relative_position ||
+        position.tangent_in_degrees ||
+        position.tangent_in_degrees != last_angle ||
+        apply_spacing_to_next_character;
 
     // If we already started a fragment, close it now.
     if (did_start_text_fragment && should_start_new_fragment) {
@@ -508,16 +509,17 @@
           visual_metrics_iterator_.CharacterOffset();
       current_text_fragment_.metrics_list_offset =
           visual_metrics_iterator_.MetricsListOffset();
-      current_text_fragment_.x = position.X();
-      current_text_fragment_.y = position.Y();
+      current_text_fragment_.x = position.point.X();
+      current_text_fragment_.y = position.point.Y();
 
       // Build fragment transformation.
-      if (angle)
-        current_text_fragment_.transform.Rotate(angle);
+      if (position.tangent_in_degrees)
+        current_text_fragment_.transform.Rotate(position.tangent_in_degrees);
 
-      if (text_path_shift.X() || text_path_shift.Y())
+      if (text_path_shift.X() || text_path_shift.Y()) {
         current_text_fragment_.transform.Translate(text_path_shift.X(),
                                                    text_path_shift.Y());
+      }
 
       // For vertical text, always rotate by 90 degrees regardless of
       // fontOrientation.
@@ -543,7 +545,7 @@
 
     AdvanceToNextLogicalCharacter(logical_metrics);
     visual_metrics_iterator_.Next();
-    last_angle = angle;
+    last_angle = position.tangent_in_degrees;
   }
 
   if (!did_start_text_fragment)
diff --git a/third_party/blink/renderer/core/loader/appcache/application_cache_host_for_frame.cc b/third_party/blink/renderer/core/loader/appcache/application_cache_host_for_frame.cc
index 3895366..68663e9 100644
--- a/third_party/blink/renderer/core/loader/appcache/application_cache_host_for_frame.cc
+++ b/third_party/blink/renderer/core/loader/appcache/application_cache_host_for_frame.cc
@@ -136,11 +136,8 @@
     mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>
         url_loader_factory) {
   auto pending_factories = std::make_unique<PendingURLLoaderFactoryBundle>();
-  // |PassPipe()| invalidates all state, so capture |version()| first.
-  uint32_t version = url_loader_factory.version();
   pending_factories->pending_appcache_factory() =
-      mojo::PendingRemote<network::mojom::URLLoaderFactory>(
-          url_loader_factory.PassPipe(), version);
+      ToCrossVariantMojoType(std::move(url_loader_factory));
   local_frame_->Client()->UpdateSubresourceFactory(
       std::move(pending_factories));
 }
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
index a2b2438..36162e2 100644
--- a/third_party/blink/renderer/core/loader/document_loader.cc
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -1829,7 +1829,9 @@
     } else {
       GetLocalFrameClient().DispatchDidCommitLoad(
           history_item_.Get(), LoadTypeToCommitType(load_type_),
-          previous_window != frame_->DomWindow());
+          previous_window != frame_->DomWindow(),
+          frame_->DomWindow()->GetSandboxFlags(),
+          security_init.FeaturePolicyHeader(), document_policy_.feature_state);
     }
     // TODO(dgozman): make DidCreateScriptContext notification call currently
     // triggered by installing new document happen here, after commit.
@@ -1843,13 +1845,6 @@
       page->HistoryNavigationVirtualTimePauser().UnpauseVirtualTime();
   }
 
-  // FeaturePolicy is reset in the browser process on commit, so this needs to
-  // be initialized and replicated to the browser process after commit messages
-  // are sent.
-  GetLocalFrameClient().DidSetFramePolicyHeaders(
-      frame_->DomWindow()->GetSandboxFlags(),
-      security_init.FeaturePolicyHeader(), document_policy_.feature_state);
-
   // Load the document if needed.
   StartLoadingResponse();
 }
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index ab15a13..4696d82b 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -243,9 +243,14 @@
 
   void DispatchDidHandleOnloadEvents() override {}
   void DispatchDidReceiveTitle(const String&) override {}
-  void DispatchDidCommitLoad(HistoryItem*,
-                             WebHistoryCommitType,
-                             bool) override {}
+  void DispatchDidCommitLoad(
+      HistoryItem* item,
+      WebHistoryCommitType commit_type,
+      bool should_reset_browser_interface_broker,
+      network::mojom::WebSandboxFlags sandbox_flags,
+      const blink::ParsedFeaturePolicy& feature_policy_header,
+      const blink::DocumentPolicyFeatureState& document_policy_header)
+      override {}
   void DispatchDidFailLoad(const ResourceError&,
                            WebHistoryCommitType) override {}
   void DispatchDidFinishDocumentLoad() override {}
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
index 7f9fb75..8edfc08c 100644
--- a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
+++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
@@ -8,14 +8,14 @@
 #include "mojo/public/cpp/base/big_buffer.h"
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "third_party/blink/public/mojom/blob/blob.mojom-blink.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
+#include "third_party/blink/public/web/web_dom_message_event.h"
 #include "third_party/blink/renderer/core/events/message_event.h"
 #include "third_party/blink/renderer/core/frame/user_activation.h"
 #include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h"
 #include "third_party/blink/renderer/platform/blob/blob_data.h"
 #include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
 
-#include "third_party/blink/public/web/web_dom_message_event.h"
-
 namespace blink {
 
 // static
@@ -51,9 +51,7 @@
         blob.value->Uuid(),
         BlobDataHandle::Create(blob.value->Uuid(), blob.value->GetType(),
                                blob.value->size(),
-                               mojo::PendingRemote<mojom::blink::Blob>(
-                                   blob.value->CloneBlobRemote().PassPipe(),
-                                   mojom::blink::Blob::Version_)));
+                               blob.value->CloneBlobRemote()));
   }
 
   // Stream channels.
@@ -112,11 +110,7 @@
 
   // Native file system transfer tokens.
   for (auto& token : serialized_script_value->NativeFileSystemTokens()) {
-    uint32_t token_version = token.version();
-    mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken>
-        converted_token(token.PassPipe(), token_version);
-    result.message->NativeFileSystemTokens().push_back(
-        std::move(converted_token));
+    result.message->NativeFileSystemTokens().push_back(std::move(token));
   }
 
   return result;
@@ -132,11 +126,9 @@
   for (auto& blob : message.blobs) {
     result.message->BlobDataHandles().Set(
         String::FromUTF8(blob->uuid),
-        BlobDataHandle::Create(
-            String::FromUTF8(blob->uuid), String::FromUTF8(blob->content_type),
-            blob->size,
-            mojo::PendingRemote<mojom::blink::Blob>(blob->blob.PassPipe(),
-                                                    mojom::Blob::Version_)));
+        BlobDataHandle::Create(String::FromUTF8(blob->uuid),
+                               String::FromUTF8(blob->content_type), blob->size,
+                               ToCrossVariantMojoType(std::move(blob->blob))));
   }
   if (message.sender_origin) {
     result.sender_origin =
@@ -199,12 +191,9 @@
 
   // Convert the PendingRemote<NativeFileSystemTransferToken> from the
   // blink::mojom namespace to the blink::mojom::blink namespace.
-  for (auto& native_file_system_token : message.native_file_system_tokens) {
-    uint32_t token_version = native_file_system_token.version();
-    mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken>
-        converted_token(native_file_system_token.PassPipe(), token_version);
+  for (auto& token : message.native_file_system_tokens) {
     result.message->NativeFileSystemTokens().push_back(
-        std::move(converted_token));
+        ToCrossVariantMojoType(std::move(token)));
   }
   return result;
 }
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
index c236c868..1402910c 100644
--- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
+++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -20,6 +20,7 @@
 #include "third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h"
 #include "third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h"
 #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h"
+#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h"
 #include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h"
 #include "third_party/blink/renderer/core/page/page.h"
 #include "third_party/blink/renderer/core/paint/background_image_geometry.h"
@@ -364,8 +365,8 @@
 
   // We may already have set an inner node, but not a box fragment, if the inner
   // node was text or non-atomic inline content. Set the containing box fragment
-  // now.
-  if (!result.BoxFragment())
+  // now, unless it's an anonymous CSS box.
+  if (!result.BoxFragment() && (!fragment.IsCSSBox() || fragment.GetNode()))
     result.SetBoxFragment(&fragment);
 
   if (!result.InnerNode())
@@ -381,6 +382,35 @@
   return 0;
 }
 
+// Returns the |ComputedStyle| to use for painting outlines. When |fragment| is
+// a block in a continuation-chain, it may need to paint outlines if its
+// ancestor inline boxes in the DOM tree has outlines.
+const ComputedStyle* StyleForContinuationOutline(
+    const NGPhysicalBoxFragment& fragment) {
+  // Fail fast if |fragment| is not a anonymous block.
+  const LayoutObject* layout_object = fragment.GetLayoutObject();
+  if (!layout_object || !layout_object->IsAnonymous() ||
+      layout_object->IsInline())
+    return nullptr;
+
+  // Check ancestors of the continuation in case nested inline boxes; e.g.
+  // <span style="outline: auto">
+  //   <span>
+  //     <div>block</div>
+  //   </span>
+  // </span>
+  for (const LayoutObject* continuation =
+           To<LayoutBoxModelObject>(layout_object)->Continuation();
+       continuation && continuation->IsLayoutInline();
+       continuation = continuation->Parent()) {
+    const ComputedStyle& style = continuation->StyleRef();
+    if (style.OutlineStyleIsAuto() &&
+        NGOutlineUtils::HasPaintedOutline(style, continuation->GetNode()))
+      return &style;
+  }
+  return nullptr;
+}
+
 }  // anonymous namespace
 
 PhysicalRect NGBoxFragmentPainter::SelfInkOverflow() const {
@@ -646,9 +676,19 @@
     }
   }
 
-  if (is_visible && ShouldPaintSelfOutline(paint_phase)) {
-    NGFragmentPainter(fragment, GetDisplayItemClient())
-        .PaintOutline(paint_info, paint_offset);
+  if (!is_visible)
+    return;
+  if (ShouldPaintSelfOutline(paint_phase)) {
+    if (NGOutlineUtils::HasPaintedOutline(style, fragment.GetNode())) {
+      NGFragmentPainter(fragment, GetDisplayItemClient())
+          .PaintOutline(paint_info, paint_offset, style);
+    }
+  } else if (ShouldPaintDescendantOutlines(paint_phase)) {
+    if (const ComputedStyle* outline_style =
+            StyleForContinuationOutline(fragment)) {
+      NGFragmentPainter(fragment, GetDisplayItemClient())
+          .PaintOutline(paint_info, paint_offset, *outline_style);
+    }
   }
 }
 
diff --git a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc
index 4b345403..b8aa544b 100644
--- a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc
+++ b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc
@@ -14,17 +14,13 @@
 namespace blink {
 
 void NGFragmentPainter::PaintOutline(const PaintInfo& paint_info,
-                                     const PhysicalOffset& paint_offset) {
-  DCHECK(ShouldPaintSelfOutline(paint_info.phase));
-
+                                     const PhysicalOffset& paint_offset,
+                                     const ComputedStyle& style_to_use) {
   const NGPhysicalBoxFragment& fragment = PhysicalFragment();
-  const ComputedStyle& style = fragment.Style();
-  if (!NGOutlineUtils::HasPaintedOutline(style, fragment.GetNode()))
-    return;
-
+  DCHECK(NGOutlineUtils::HasPaintedOutline(style_to_use, fragment.GetNode()));
   Vector<PhysicalRect> outline_rects;
   fragment.AddSelfOutlineRects(
-      paint_offset, style.OutlineRectsShouldIncludeBlockVisualOverflow(),
+      paint_offset, style_to_use.OutlineRectsShouldIncludeBlockVisualOverflow(),
       &outline_rects);
 
   if (outline_rects.IsEmpty())
@@ -37,10 +33,10 @@
 
   IntRect visual_rect =
       PixelSnappedIntRect(UnionRectEvenIfEmpty(outline_rects));
-  visual_rect.Inflate(fragment.Style().OutlineOutsetExtent());
+  visual_rect.Inflate(style_to_use.OutlineOutsetExtent());
   DrawingRecorder recorder(paint_info.context, display_item_client,
                            paint_info.phase, visual_rect);
-  PaintOutlineRects(paint_info, outline_rects, fragment.Style());
+  PaintOutlineRects(paint_info, outline_rects, style_to_use);
 }
 
 void NGFragmentPainter::AddURLRectIfNeeded(const PaintInfo& paint_info,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h
index 60a21cf0..82d8f59 100644
--- a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h
+++ b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h
@@ -25,7 +25,12 @@
                     const DisplayItemClient& display_item_client)
       : box_fragment_(box), display_item_client_(display_item_client) {}
 
-  void PaintOutline(const PaintInfo&, const PhysicalOffset& paint_offset);
+  // |style_to_use| may be from other objects than |box_fragment_|. When
+  // painting outlines for a block in a continuation chain, its style does not
+  // have the `outline` property set.
+  void PaintOutline(const PaintInfo&,
+                    const PhysicalOffset& paint_offset,
+                    const ComputedStyle& style_to_use);
 
   void AddURLRectIfNeeded(const PaintInfo&, const PhysicalOffset& paint_offset);
 
diff --git a/third_party/blink/renderer/core/paint/paint_invalidator.cc b/third_party/blink/renderer/core/paint/paint_invalidator.cc
index a3669a90..a5444d2 100644
--- a/third_party/blink/renderer/core/paint/paint_invalidator.cc
+++ b/third_party/blink/renderer/core/paint/paint_invalidator.cc
@@ -64,8 +64,13 @@
        IsLayoutNGContainingBlock(object.ContainingBlock())))
     context.painting_layer->SetNeedsPaintPhaseFloat();
 
-  if (object != context.painting_layer->GetLayoutObject() &&
-      object.StyleRef().HasOutline())
+  if (!context.painting_layer->NeedsPaintPhaseDescendantOutlines() &&
+      ((object != context.painting_layer->GetLayoutObject() &&
+        object.StyleRef().HasOutline()) ||
+       // If this is a block-in-inline, it may need to paint outline.
+       // See |StyleForContinuationOutline|.
+       (layout_block_flow && layout_block_flow->IsAnonymous() &&
+        !layout_block_flow->IsInline() && layout_block_flow->Continuation())))
     context.painting_layer->SetNeedsPaintPhaseDescendantOutlines();
 }
 
diff --git a/third_party/blink/renderer/core/paint/paint_timing.cc b/third_party/blink/renderer/core/paint/paint_timing.cc
index 6d9337b86..2358d32 100644
--- a/third_party/blink/renderer/core/paint/paint_timing.cc
+++ b/third_party/blink/renderer/core/paint/paint_timing.cc
@@ -10,6 +10,7 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/time/default_tick_clock.h"
 #include "third_party/blink/renderer/core/dom/document.h"
+#include "third_party/blink/renderer/core/dom/frame_request_callback_collection.h"
 #include "third_party/blink/renderer/core/frame/local_dom_window.h"
 #include "third_party/blink/renderer/core/frame/local_frame.h"
 #include "third_party/blink/renderer/core/frame/local_frame_view.h"
@@ -42,6 +43,47 @@
 
 }  // namespace
 
+class RecodingTimeAfterBackForwardCacheRestoreFrameCallback
+    : public FrameCallback {
+ public:
+  RecodingTimeAfterBackForwardCacheRestoreFrameCallback(
+      PaintTiming* paint_timing,
+      size_t record_index)
+      : paint_timing_(paint_timing), record_index_(record_index) {}
+  ~RecodingTimeAfterBackForwardCacheRestoreFrameCallback() override = default;
+
+  void Invoke(double high_res_time_ms) override {
+    // Instead of |high_res_time_ms|, use PaintTiming's |clock_->NowTicks()| for
+    // consistency and testability.
+    paint_timing_->SetRequestAnimationFrameAfterBackForwardCacheRestore(
+        record_index_, count_);
+
+    count_++;
+    if (count_ ==
+        WebPerformance::
+            kRequestAnimationFramesToRecordAfterBackForwardCacheRestore) {
+      paint_timing_->NotifyPaintTimingChanged();
+      return;
+    }
+
+    if (auto* frame = paint_timing_->GetFrame()) {
+      if (auto* document = frame->GetDocument()) {
+        document->RequestAnimationFrame(this);
+      }
+    }
+  }
+
+  void Trace(Visitor* visitor) const override {
+    visitor->Trace(paint_timing_);
+    FrameCallback::Trace(visitor);
+  }
+
+ private:
+  Member<PaintTiming> paint_timing_;
+  const size_t record_index_;
+  size_t count_ = 0;
+};
+
 // static
 const char PaintTiming::kSupplementName[] = "PaintTiming";
 
@@ -334,6 +376,21 @@
   NotifyPaintTimingChanged();
 }
 
+void PaintTiming::SetRequestAnimationFrameAfterBackForwardCacheRestore(
+    size_t index,
+    size_t count) {
+  auto now = clock_->NowTicks();
+
+  // The elements are allocated when the page is restored from the cache.
+  DCHECK_LT(index,
+            request_animation_frames_after_back_forward_cache_restore_.size());
+  auto& current_rafs =
+      request_animation_frames_after_back_forward_cache_restore_[index];
+  DCHECK_LT(count, current_rafs.size());
+  DCHECK_EQ(current_rafs[count], base::TimeTicks());
+  current_rafs[count] = now;
+}
+
 void PaintTiming::ReportSwapResultHistogram(WebSwapResult result) {
   UMA_HISTOGRAM_ENUMERATION("PageLoad.Internal.Renderer.PaintTiming.SwapResult",
                             result);
@@ -343,9 +400,36 @@
   // Allocate the last element with 0, which indicates that the first paint
   // after this navigation doesn't happen yet.
   size_t index = first_paints_after_back_forward_cache_restore_swap_.size();
+  DCHECK_EQ(index,
+            request_animation_frames_after_back_forward_cache_restore_.size());
+
   first_paints_after_back_forward_cache_restore_swap_.push_back(
       base::TimeTicks());
   RegisterNotifyFirstPaintAfterBackForwardCacheRestoreSwapTime(index);
+
+  request_animation_frames_after_back_forward_cache_restore_.push_back(
+      RequestAnimationFrameTimesAfterBackForwardCacheRestore{});
+
+  LocalFrame* frame = GetFrame();
+  if (!frame->IsMainFrame()) {
+    return;
+  }
+
+  Document* document = frame->GetDocument();
+  DCHECK(document);
+
+  // Cancel if there is already a registered callback.
+  if (raf_after_bfcache_restore_measurement_callback_id_) {
+    document->CancelAnimationFrame(
+        raf_after_bfcache_restore_measurement_callback_id_);
+    raf_after_bfcache_restore_measurement_callback_id_ = 0;
+  }
+
+  raf_after_bfcache_restore_measurement_callback_id_ =
+      document->RequestAnimationFrame(
+          MakeGarbageCollected<
+              RecodingTimeAfterBackForwardCacheRestoreFrameCallback>(this,
+                                                                     index));
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/paint/paint_timing.h b/third_party/blink/renderer/core/paint/paint_timing.h
index 7dc62b9a..747b52a 100644
--- a/third_party/blink/renderer/core/paint/paint_timing.h
+++ b/third_party/blink/renderer/core/paint/paint_timing.h
@@ -7,6 +7,7 @@
 
 #include <memory>
 
+#include "third_party/blink/public/web/web_performance.h"
 #include "third_party/blink/public/web/web_swap_result.h"
 #include "third_party/blink/renderer/core/dom/document.h"
 #include "third_party/blink/renderer/core/paint/first_meaningful_paint_detector.h"
@@ -30,6 +31,10 @@
   friend class FirstMeaningfulPaintDetector;
   using ReportTimeCallback =
       WTF::CrossThreadOnceFunction<void(WebSwapResult, base::TimeTicks)>;
+  using RequestAnimationFrameTimesAfterBackForwardCacheRestore = std::array<
+      base::TimeTicks,
+      WebPerformance::
+          kRequestAnimationFramesToRecordAfterBackForwardCacheRestore>;
 
  public:
   static const char kSupplementName[];
@@ -90,6 +95,11 @@
     return first_paints_after_back_forward_cache_restore_swap_;
   }
 
+  WTF::Vector<RequestAnimationFrameTimesAfterBackForwardCacheRestore>
+  RequestAnimationFramesAfterBackForwardCacheRestore() const {
+    return request_animation_frames_after_back_forward_cache_restore_;
+  }
+
   // FirstContentfulPaint returns the first time that 'contentful' content was
   // painted. For instance, the first time that text or image content was
   // painted.
@@ -146,6 +156,8 @@
   void Trace(Visitor*) const override;
 
  private:
+  friend class RecodingTimeAfterBackForwardCacheRestoreFrameCallback;
+
   LocalFrame* GetFrame() const;
   void NotifyPaintTimingChanged();
 
@@ -175,6 +187,8 @@
   // index to avoid confusing the data from different navigations.
   void SetFirstPaintAfterBackForwardCacheRestoreSwap(base::TimeTicks stamp,
                                                      size_t index);
+  void SetRequestAnimationFrameAfterBackForwardCacheRestore(size_t index,
+                                                            size_t count);
 
   void RegisterNotifySwapTime(PaintEvent);
   void RegisterNotifyFirstPaintAfterBackForwardCacheRestoreSwapTime(
@@ -193,6 +207,8 @@
   base::TimeTicks first_paint_swap_;
   WTF::Vector<base::TimeTicks>
       first_paints_after_back_forward_cache_restore_swap_;
+  WTF::Vector<RequestAnimationFrameTimesAfterBackForwardCacheRestore>
+      request_animation_frames_after_back_forward_cache_restore_;
   base::TimeTicks first_image_paint_;
   base::TimeTicks first_image_paint_swap_;
   base::TimeTicks first_contentful_paint_;
@@ -205,6 +221,10 @@
 
   Member<FirstMeaningfulPaintDetector> fmp_detector_;
 
+  // The callback ID for requestAnimationFrame to record its time after the page
+  // is restored from the back-forward cache.
+  int raf_after_bfcache_restore_measurement_callback_id_ = 0;
+
   const base::TickClock* clock_;
 
   FRIEND_TEST_ALL_PREFIXES(FirstMeaningfulPaintDetectorTest, NoFirstPaint);
diff --git a/third_party/blink/renderer/core/style/computed_style.cc b/third_party/blink/renderer/core/style/computed_style.cc
index e3a3951..5710a0d 100644
--- a/third_party/blink/renderer/core/style/computed_style.cc
+++ b/third_party/blink/renderer/core/style/computed_style.cc
@@ -1265,15 +1265,16 @@
   const BasicShape* path = OffsetPath();
   const StyleOffsetRotation& rotate = OffsetRotate();
 
-  FloatPoint point;
-  float angle;
+  PointAndTangent path_position;
   if (path->GetType() == BasicShape::kStyleRayType) {
     // TODO(ericwilligers): crbug.com/641245 Support <size> for ray paths.
     float float_distance = FloatValueForLength(distance, 0);
 
-    angle = To<StyleRay>(*path).Angle() - 90;
-    point.SetX(float_distance * cos(deg2rad(angle)));
-    point.SetY(float_distance * sin(deg2rad(angle)));
+    path_position.tangent_in_degrees = To<StyleRay>(*path).Angle() - 90;
+    path_position.point.SetX(float_distance *
+                             cos(deg2rad(path_position.tangent_in_degrees)));
+    path_position.point.SetY(float_distance *
+                             sin(deg2rad(path_position.tangent_in_degrees)));
   } else {
     float zoom = EffectiveZoom();
     const StylePath& motion_path = To<StylePath>(*path);
@@ -1289,14 +1290,13 @@
       computed_distance = clampTo<float>(float_distance, 0, path_length);
     }
 
-    motion_path.GetPath().PointAndNormalAtLength(computed_distance, point,
-                                                 angle);
-
-    point.Scale(zoom, zoom);
+    path_position =
+        motion_path.GetPath().PointAndNormalAtLength(computed_distance);
+    path_position.point.Scale(zoom, zoom);
   }
 
   if (rotate.type == OffsetRotationType::kFixed)
-    angle = 0;
+    path_position.tangent_in_degrees = 0;
 
   float origin_shift_x = 0;
   float origin_shift_y = 0;
@@ -1312,9 +1312,10 @@
     origin_shift_y = anchor_point.Y() - origin_y;
   }
 
-  transform.Translate(point.X() - anchor_point.X() + origin_shift_x,
-                      point.Y() - anchor_point.Y() + origin_shift_y);
-  transform.Rotate(angle + rotate.angle);
+  transform.Translate(
+      path_position.point.X() - anchor_point.X() + origin_shift_x,
+      path_position.point.Y() - anchor_point.Y() + origin_shift_y);
+  transform.Rotate(path_position.tangent_in_degrees + rotate.angle);
 
   if (!position.X().IsAuto() || !anchor.X().IsAuto())
     // Shift the origin back to transform-origin.
diff --git a/third_party/blink/renderer/core/svg/graphics/svg_image.cc b/third_party/blink/renderer/core/svg/graphics/svg_image.cc
index eb7cdb9..4de4f2ab 100644
--- a/third_party/blink/renderer/core/svg/graphics/svg_image.cc
+++ b/third_party/blink/renderer/core/svg/graphics/svg_image.cc
@@ -268,23 +268,6 @@
   return true;
 }
 
-LayoutSize SVGImage::ContainerSize() const {
-  const LayoutSVGRoot* layout_root = LayoutRoot();
-  if (!layout_root)
-    return LayoutSize();
-
-  // If a container size is available it has precedence.
-  LayoutSize container_size = layout_root->ContainerSize();
-  if (!container_size.IsEmpty())
-    return container_size;
-
-  // Assure that a container size is always given for a non-identity zoom level.
-  DCHECK_EQ(layout_root->StyleRef().EffectiveZoom(), 1);
-
-  // No set container size; use concrete object size.
-  return intrinsic_size_;
-}
-
 IntSize SVGImage::Size() const {
   return RoundedIntSize(intrinsic_size_);
 }
@@ -375,25 +358,14 @@
 SVGImage::DrawInfo::DrawInfo(const FloatSize& container_size,
                              float zoom,
                              const KURL& url)
-    : container_size_(container_size), zoom_(zoom), url_(url) {}
+    : container_size_(container_size),
+      rounded_container_size_(RoundedLayoutSize(container_size)),
+      zoom_(zoom),
+      url_(url) {}
 
-template <typename Func>
-void SVGImage::ForContainer(const DrawInfo& draw_info, Func&& func) {
-  if (!page_)
-    return;
-
-  // Temporarily disable the image observer to prevent changeInRect() calls due
-  // re-laying out the image.
-  ImageObserverDisabler image_observer_disabler(this);
-
-  FloatSize container_size = draw_info.ContainerSize();
-  LayoutSize rounded_container_size = RoundedLayoutSize(container_size);
-
-  if (LayoutSVGRoot* layout_root = LayoutRoot())
-    layout_root->SetContainerSize(rounded_container_size);
-
-  func(FloatSize(rounded_container_size.Width() / container_size.Width(),
-                 rounded_container_size.Height() / container_size.Height()));
+FloatSize SVGImage::DrawInfo::CalculateResidualScale() const {
+  return FloatSize(rounded_container_size_.Width() / container_size_.Width(),
+                   rounded_container_size_.Height() / container_size_.Height());
 }
 
 void SVGImage::DrawForContainer(const DrawInfo& draw_info,
@@ -401,17 +373,15 @@
                                 const PaintFlags& flags,
                                 const FloatRect& dst_rect,
                                 const FloatRect& src_rect) {
-  ForContainer(draw_info, [&](const FloatSize& residual_scale) {
-    FloatRect scaled_src = src_rect;
-    scaled_src.Scale(1 / draw_info.Zoom());
+  FloatRect unzoomed_src = src_rect;
+  unzoomed_src.Scale(1 / draw_info.Zoom());
 
-    // Compensate for the container size rounding by adjusting the source rect.
-    FloatSize adjusted_src_size = scaled_src.Size();
-    adjusted_src_size.Scale(residual_scale.Width(), residual_scale.Height());
-    scaled_src.SetSize(adjusted_src_size);
+  // Compensate for the container size rounding by adjusting the source rect.
+  FloatSize residual_scale = draw_info.CalculateResidualScale();
+  unzoomed_src.SetSize(unzoomed_src.Size().ScaledBy(residual_scale.Width(),
+                                                    residual_scale.Height()));
 
-    DrawInternal(draw_info, canvas, flags, dst_rect, scaled_src);
-  });
+  DrawInternal(draw_info, canvas, flags, dst_rect, unzoomed_src);
 }
 
 PaintImage SVGImage::PaintImageForCurrentFrame() {
@@ -473,13 +443,6 @@
 void SVGImage::PopulatePaintRecordForCurrentFrameForContainer(
     const DrawInfo& draw_info,
     PaintImageBuilder& builder) {
-  builder.set_completion_state(
-      load_state_ == LoadState::kLoadCompleted
-          ? PaintImage::CompletionState::DONE
-          : PaintImage::CompletionState::PARTIALLY_DONE);
-  if (!page_)
-    return;
-
   PaintRecorder recorder;
   const FloatSize size(draw_info.ContainerSize().ScaledBy(draw_info.Zoom()));
   const IntRect dest_rect(IntPoint(), RoundedIntSize(size));
@@ -488,31 +451,34 @@
                    FloatRect(FloatPoint(), size));
   builder.set_paint_record(recorder.finishRecordingAsPicture(), dest_rect,
                            PaintImage::GetNextContentId());
+
+  builder.set_completion_state(
+      load_state_ == LoadState::kLoadCompleted
+          ? PaintImage::CompletionState::DONE
+          : PaintImage::CompletionState::PARTIALLY_DONE);
 }
 
 bool SVGImage::ApplyShaderInternal(const DrawInfo& draw_info,
                                    PaintFlags& flags,
                                    const SkMatrix& local_matrix) {
-  const FloatSize size(ContainerSize());
-  if (size.IsEmpty())
+  if (draw_info.ContainerSize().IsEmpty())
+    return false;
+  sk_sp<PaintRecord> record = PaintRecordForCurrentFrame(draw_info);
+  if (!record)
     return false;
 
-  FloatRect bounds(FloatPoint(), size);
+  const FloatRect bounds(FloatPoint(), draw_info.ContainerSize());
   flags.setShader(PaintShader::MakePaintRecord(
-      PaintRecordForCurrentFrame(draw_info), bounds, SkTileMode::kRepeat,
-      SkTileMode::kRepeat, &local_matrix));
+      std::move(record), bounds, SkTileMode::kRepeat, SkTileMode::kRepeat,
+      &local_matrix));
 
-  // Animation is normally refreshed in draw() impls, which we don't reach when
+  // Animation is normally refreshed in Draw() impls, which we don't reach when
   // painting via shaders.
   StartAnimation();
-
   return true;
 }
 
 bool SVGImage::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) {
-  // TODO(fs): Passing |intrinsic_size_| even though it shouldn't be used in
-  // this code-path ATM. (It'll read the currently set container size from the
-  // SVG root which is a bit iffy/non-deterministic.)
   const DrawInfo draw_info(FloatSize(intrinsic_size_), 1, NullURL());
   return ApplyShaderInternal(draw_info, flags, local_matrix);
 }
@@ -520,18 +486,13 @@
 bool SVGImage::ApplyShaderForContainer(const DrawInfo& draw_info,
                                        PaintFlags& flags,
                                        const SkMatrix& local_matrix) {
-  bool result = false;
-  ForContainer(draw_info, [&](const FloatSize& residual_scale) {
-    FloatSize zoomed_residual_scale = residual_scale.ScaledBy(draw_info.Zoom());
-    // Compensate for the container size rounding.
-    auto adjusted_local_matrix = local_matrix;
-    adjusted_local_matrix.preScale(zoomed_residual_scale.Width(),
-                                   zoomed_residual_scale.Height());
-
-    result = ApplyShaderInternal(draw_info, flags, adjusted_local_matrix);
-  });
-
-  return result;
+  // Compensate for the container size rounding.
+  FloatSize residual_scale =
+      draw_info.CalculateResidualScale().ScaledBy(draw_info.Zoom());
+  auto adjusted_local_matrix = local_matrix;
+  adjusted_local_matrix.preScale(residual_scale.Width(),
+                                 residual_scale.Height());
+  return ApplyShaderInternal(draw_info, flags, adjusted_local_matrix);
 }
 
 void SVGImage::Draw(cc::PaintCanvas* canvas,
@@ -541,20 +502,23 @@
                     RespectImageOrientationEnum,
                     ImageClampingMode,
                     ImageDecodingMode) {
-  if (!page_)
-    return;
-  // TODO(fs): Passing |intrinsic_size_| even though it shouldn't be used in
-  // this code-path ATM. (It'll read the currently set container size from the
-  // SVG root which is a bit iffy/non-deterministic.)
   const DrawInfo draw_info(FloatSize(intrinsic_size_), 1, NullURL());
   DrawInternal(draw_info, canvas, flags, dst_rect, src_rect);
 }
 
 sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(
     const DrawInfo& draw_info) {
-  DCHECK(page_);
+  if (!page_)
+    return nullptr;
+  // Temporarily disable the image observer to prevent ChangeInRect() calls due
+  // re-laying out the image.
+  ImageObserverDisabler disable_image_observer(this);
+
+  const LayoutSize layout_container_size = draw_info.RoundedContainerSize();
+  if (LayoutSVGRoot* layout_root = LayoutRoot())
+    layout_root->SetContainerSize(layout_container_size);
   LocalFrameView* view = GetFrame()->View();
-  IntSize rounded_container_size = RoundedIntSize(ContainerSize());
+  const IntSize rounded_container_size = RoundedIntSize(layout_container_size);
   view->Resize(rounded_container_size);
   page_->GetVisualViewport().SetSize(rounded_container_size);
 
@@ -596,7 +560,11 @@
                             cc::PaintCanvas* canvas,
                             const PaintFlags& flags,
                             const FloatRect& dst_rect,
-                            const FloatRect& src_rect) {
+                            const FloatRect& unzoomed_src_rect) {
+  sk_sp<PaintRecord> record = PaintRecordForCurrentFrame(draw_info);
+  if (!record)
+    return;
+
   {
     PaintCanvasAutoRestore ar(canvas, false);
     if (DrawNeedsLayer(flags)) {
@@ -608,9 +576,9 @@
     // without clipping, and translate accordingly.
     canvas->save();
     canvas->clipRect(EnclosingIntRect(dst_rect));
-    canvas->concat(SkMatrix::MakeRectToRect(src_rect, dst_rect,
+    canvas->concat(SkMatrix::MakeRectToRect(unzoomed_src_rect, dst_rect,
                                             SkMatrix::kFill_ScaleToFit));
-    canvas->drawPicture(PaintRecordForCurrentFrame(draw_info));
+    canvas->drawPicture(std::move(record));
     canvas->restore();
   }
 
diff --git a/third_party/blink/renderer/core/svg/graphics/svg_image.h b/third_party/blink/renderer/core/svg/graphics/svg_image.h
index da2eeb12..74616ad 100644
--- a/third_party/blink/renderer/core/svg/graphics/svg_image.h
+++ b/third_party/blink/renderer/core/svg/graphics/svg_image.h
@@ -133,8 +133,6 @@
 
   String FilenameExtension() const override;
 
-  LayoutSize ContainerSize() const;
-
   SizeAvailability DataChanged(bool all_data_received) override;
 
   // FIXME: SVGImages are underreporting decoded sizes and will be unable
@@ -150,12 +148,17 @@
    public:
     DrawInfo(const FloatSize& container_size, float zoom, const KURL& url);
 
+    FloatSize CalculateResidualScale() const;
     float Zoom() const { return zoom_; }
     const FloatSize& ContainerSize() const { return container_size_; }
+    const LayoutSize& RoundedContainerSize() const {
+      return rounded_container_size_;
+    }
     const KURL& Url() const { return url_; }
 
    private:
     const FloatSize container_size_;
+    const LayoutSize rounded_container_size_;
     const float zoom_;
     const KURL& url_;
   };
@@ -190,11 +193,7 @@
                     cc::PaintCanvas*,
                     const cc::PaintFlags&,
                     const FloatRect& dst_rect,
-                    const FloatRect& src_rect);
-
-  template <typename Func>
-  void ForContainer(const DrawInfo&, Func&&);
-
+                    const FloatRect& unzoomed_src_rect);
   bool ApplyShader(cc::PaintFlags&, const SkMatrix& local_matrix) override;
   bool ApplyShaderForContainer(const DrawInfo&,
                                cc::PaintFlags&,
diff --git a/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc b/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc
index afd4128..47c7480 100644
--- a/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc
+++ b/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc
@@ -219,26 +219,25 @@
 
   DCHECK(!animation_path_.IsEmpty());
 
-  float position_on_path = animation_path_.length() * percentage;
-  FloatPoint position;
-  float angle;
-  animation_path_.PointAndNormalAtLength(position_on_path, position, angle);
+  const float path_length = animation_path_.length();
+  float position_on_path = path_length * percentage;
+  PointAndTangent position =
+      animation_path_.PointAndNormalAtLength(position_on_path);
 
   // Handle accumulate="sum".
   if (repeat_count && parameters.is_cumulative) {
     FloatPoint position_at_end_of_duration =
-        animation_path_.PointAtLength(animation_path_.length());
-    position.Move(position_at_end_of_duration.X() * repeat_count,
-                  position_at_end_of_duration.Y() * repeat_count);
+        animation_path_.PointAtLength(path_length);
+    position.point.MoveBy(position_at_end_of_duration.ScaledBy(repeat_count));
   }
 
-  transform->Translate(position.X(), position.Y());
+  transform->Translate(position.point.X(), position.point.Y());
   RotateMode rotate_mode = GetRotateMode();
   if (rotate_mode != kRotateAuto && rotate_mode != kRotateAutoReverse)
     return;
   if (rotate_mode == kRotateAutoReverse)
-    angle += 180;
-  transform->Rotate(angle);
+    position.tangent_in_degrees += 180;
+  transform->Rotate(position.tangent_in_degrees);
 }
 
 void SVGAnimateMotionElement::ApplyResultsToTarget(
diff --git a/third_party/blink/renderer/core/testing/fake_local_frame_host.cc b/third_party/blink/renderer/core/testing/fake_local_frame_host.cc
index 96c7d31..6e5101d 100644
--- a/third_party/blink/renderer/core/testing/fake_local_frame_host.cc
+++ b/third_party/blink/renderer/core/testing/fake_local_frame_host.cc
@@ -196,10 +196,6 @@
     const base::UnguessableToken& child_frame_token,
     const FramePolicy& frame_policy) {}
 
-void FakeLocalFrameHost::BindPolicyContainer(
-    mojo::PendingAssociatedReceiver<mojom::blink::PolicyContainerHost>
-        receiver) {}
-
 void FakeLocalFrameHost::CapturePaintPreviewOfSubframe(
     const gfx::Rect& clip_rect,
     const base::UnguessableToken& guid) {}
diff --git a/third_party/blink/renderer/core/testing/fake_local_frame_host.h b/third_party/blink/renderer/core/testing/fake_local_frame_host.h
index 70eb840..4f0c8ff 100644
--- a/third_party/blink/renderer/core/testing/fake_local_frame_host.h
+++ b/third_party/blink/renderer/core/testing/fake_local_frame_host.h
@@ -126,9 +126,6 @@
                                  parsed_csp_attribute) override;
   void DidChangeFramePolicy(const base::UnguessableToken& child_frame_token,
                             const FramePolicy& frame_policy) override;
-  void BindPolicyContainer(
-      mojo::PendingAssociatedReceiver<mojom::blink::PolicyContainerHost>
-          receiver) override;
   void CapturePaintPreviewOfSubframe(
       const gfx::Rect& clip_rect,
       const base::UnguessableToken& guid) override;
diff --git a/third_party/blink/renderer/core/timing/performance_timing.cc b/third_party/blink/renderer/core/timing/performance_timing.cc
index d51b945b..70e85f9 100644
--- a/third_party/blink/renderer/core/timing/performance_timing.cc
+++ b/third_party/blink/renderer/core/timing/performance_timing.cc
@@ -337,9 +337,16 @@
       load_timing->BackForwardCacheRestoreNavigationStarts();
   WTF::Vector<base::TimeTicks> first_paints =
       paint_timing->FirstPaintsAfterBackForwardCacheRestore();
+  WTF::Vector<std::array<
+      base::TimeTicks,
+      WebPerformance::
+          kRequestAnimationFramesToRecordAfterBackForwardCacheRestore>>
+      request_animation_frames =
+          paint_timing->RequestAnimationFramesAfterBackForwardCacheRestore();
   WTF::Vector<base::Optional<base::TimeDelta>> first_input_delays =
       interactive_detector->GetFirstInputDelaysAfterBackForwardCacheRestore();
   DCHECK_EQ(navigation_starts.size(), first_paints.size());
+  DCHECK_EQ(navigation_starts.size(), request_animation_frames.size());
   DCHECK_EQ(navigation_starts.size(), first_input_delays.size());
 
   WTF::Vector<BackForwardCacheRestoreTiming> restore_timings(
@@ -349,6 +356,10 @@
         MonotonicTimeToIntegerMilliseconds(navigation_starts[i]);
     restore_timings[i].first_paint =
         MonotonicTimeToIntegerMilliseconds(first_paints[i]);
+    for (size_t j = 0; j < request_animation_frames[i].size(); j++) {
+      restore_timings[i].request_animation_frames[j] =
+          MonotonicTimeToIntegerMilliseconds(request_animation_frames[i][j]);
+    }
     restore_timings[i].first_input_delay = first_input_delays[i];
   }
   return restore_timings;
diff --git a/third_party/blink/renderer/core/timing/performance_timing.h b/third_party/blink/renderer/core/timing/performance_timing.h
index 0ee1e9ba..7334d3f 100644
--- a/third_party/blink/renderer/core/timing/performance_timing.h
+++ b/third_party/blink/renderer/core/timing/performance_timing.h
@@ -32,6 +32,7 @@
 #define THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_PERFORMANCE_TIMING_H_
 
 #include "base/time/time.h"
+#include "third_party/blink/public/web/web_performance.h"
 #include "third_party/blink/renderer/core/core_export.h"
 #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
 #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
@@ -61,6 +62,10 @@
   struct BackForwardCacheRestoreTiming {
     uint64_t navigation_start;
     uint64_t first_paint;
+    std::array<uint64_t,
+               WebPerformance::
+                   kRequestAnimationFramesToRecordAfterBackForwardCacheRestore>
+        request_animation_frames;
     base::Optional<base::TimeDelta> first_input_delay;
   };
 
diff --git a/third_party/blink/renderer/core/workers/shared_worker_client_holder.cc b/third_party/blink/renderer/core/workers/shared_worker_client_holder.cc
index 9968508a..312a089 100644
--- a/third_party/blink/renderer/core/workers/shared_worker_client_holder.cc
+++ b/third_party/blink/renderer/core/workers/shared_worker_client_holder.cc
@@ -134,12 +134,9 @@
   connector_->Connect(
       std::move(info), std::move(client),
       worker->GetExecutionContext()->IsSecureContext()
-          ? mojom::SharedWorkerCreationContextType::kSecure
-          : mojom::SharedWorkerCreationContextType::kNonsecure,
-      port.ReleaseHandle(),
-      mojo::PendingRemote<mojom::blink::BlobURLToken>(
-          blob_url_token.PassPipe(), mojom::blink::BlobURLToken::Version_),
-      client_ukm_source_id);
+          ? mojom::blink::SharedWorkerCreationContextType::kSecure
+          : mojom::blink::SharedWorkerCreationContextType::kNonsecure,
+      port.ReleaseHandle(), std::move(blob_url_token), client_ukm_source_id);
 }
 
 void SharedWorkerClientHolder::Trace(Visitor* visitor) const {
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc
index c9bf4898..d685872 100644
--- a/third_party/blink/renderer/core/workers/worker_global_scope.cc
+++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
@@ -31,6 +31,7 @@
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "services/metrics/public/cpp/mojo_ukm_recorder.h"
 #include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
+#include "third_party/blink/public/mojom/browser_interface_broker.mojom-blink.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/public/platform/web_url_request.h"
@@ -563,10 +564,9 @@
   // once all worker types provide a valid
   // |creation_params->browser_interface_broker|.
   if (creation_params->browser_interface_broker.is_valid()) {
-    auto pipe = creation_params->browser_interface_broker.PassPipe();
     browser_interface_broker_proxy_.Bind(
-        mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker>(
-            std::move(pipe), blink::mojom::BrowserInterfaceBroker::Version_),
+        ToCrossVariantMojoType(
+            std::move(creation_params->browser_interface_broker)),
         GetTaskRunner(TaskType::kInternalDefault));
   }
 
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
index 71e0e29..bfba8a7 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -2479,51 +2479,6 @@
   }
 }
 
-//
-// ARIA live-region features.
-//
-
-const AtomicString& AXNodeObject::LiveRegionStatus() const {
-  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_assertive,
-                      ("assertive"));
-  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_polite,
-                      ("polite"));
-  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_off, ("off"));
-
-  const AtomicString& live_region_status =
-      GetAOMPropertyOrARIAAttribute(AOMStringProperty::kLive);
-  // These roles have implicit live region status.
-  if (live_region_status.IsEmpty()) {
-    switch (RoleValue()) {
-      case ax::mojom::blink::Role::kAlert:
-        return live_region_status_assertive;
-      case ax::mojom::blink::Role::kLog:
-      case ax::mojom::blink::Role::kStatus:
-        return live_region_status_polite;
-      case ax::mojom::blink::Role::kTimer:
-      case ax::mojom::blink::Role::kMarquee:
-        return live_region_status_off;
-      default:
-        break;
-    }
-  }
-
-  return live_region_status;
-}
-
-const AtomicString& AXNodeObject::LiveRegionRelevant() const {
-  DEFINE_STATIC_LOCAL(const AtomicString, default_live_region_relevant,
-                      ("additions text"));
-  const AtomicString& relevant =
-      GetAOMPropertyOrARIAAttribute(AOMStringProperty::kRelevant);
-
-  // Default aria-relevant = "additions text".
-  if (relevant.IsEmpty())
-    return default_live_region_relevant;
-
-  return relevant;
-}
-
 ax::mojom::blink::HasPopup AXNodeObject::HasPopup() const {
   const AtomicString& has_popup =
       GetAOMPropertyOrARIAAttribute(AOMStringProperty::kHasPopUp);
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.h b/third_party/blink/renderer/modules/accessibility/ax_node_object.h
index 6f03bf3..4715599 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.h
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.h
@@ -183,10 +183,6 @@
   void Dropeffects(
       Vector<ax::mojom::blink::Dropeffect>& dropeffects) const override;
 
-  // ARIA live-region features.
-  const AtomicString& LiveRegionStatus() const override;
-  const AtomicString& LiveRegionRelevant() const override;
-
   ax::mojom::blink::HasPopup HasPopup() const override;
 
   // AX name calculation.
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc
index ee0aecd..e2551f53 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -2873,6 +2873,47 @@
   return !live_region.IsEmpty() && !EqualIgnoringASCIICase(live_region, "off");
 }
 
+const AtomicString& AXObject::LiveRegionStatus() const {
+  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_assertive,
+                      ("assertive"));
+  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_polite,
+                      ("polite"));
+  DEFINE_STATIC_LOCAL(const AtomicString, live_region_status_off, ("off"));
+
+  const AtomicString& live_region_status =
+      GetAOMPropertyOrARIAAttribute(AOMStringProperty::kLive);
+  // These roles have implicit live region status.
+  if (live_region_status.IsEmpty()) {
+    switch (RoleValue()) {
+      case ax::mojom::blink::Role::kAlert:
+        return live_region_status_assertive;
+      case ax::mojom::blink::Role::kLog:
+      case ax::mojom::blink::Role::kStatus:
+        return live_region_status_polite;
+      case ax::mojom::blink::Role::kTimer:
+      case ax::mojom::blink::Role::kMarquee:
+        return live_region_status_off;
+      default:
+        break;
+    }
+  }
+
+  return live_region_status;
+}
+
+const AtomicString& AXObject::LiveRegionRelevant() const {
+  DEFINE_STATIC_LOCAL(const AtomicString, default_live_region_relevant,
+                      ("additions text"));
+  const AtomicString& relevant =
+      GetAOMPropertyOrARIAAttribute(AOMStringProperty::kRelevant);
+
+  // Default aria-relevant = "additions text".
+  if (relevant.IsEmpty())
+    return default_live_region_relevant;
+
+  return relevant;
+}
+
 AXRestriction AXObject::Restriction() const {
   // According to ARIA, all elements of the base markup can be disabled.
   // According to CORE-AAM, any focusable descendant of aria-disabled
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.h b/third_party/blink/renderer/modules/accessibility/ax_object.h
index bb760a4..d97c3da 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_object.h
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.h
@@ -822,8 +822,8 @@
   bool IsLiveRegionRoot() const;  // Any live region, including polite="off".
   bool IsActiveLiveRegionRoot() const;  // Live region that is not polite="off".
   AXObject* LiveRegionRoot() const;  // Container that controls live politeness.
-  virtual const AtomicString& LiveRegionStatus() const { return g_null_atom; }
-  virtual const AtomicString& LiveRegionRelevant() const { return g_null_atom; }
+  virtual const AtomicString& LiveRegionStatus() const;
+  virtual const AtomicString& LiveRegionRelevant() const;
   bool LiveRegionAtomic() const;
 
   const AtomicString& ContainerLiveRegionStatus() const;
diff --git a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
index af2bb0c..49349f6 100644
--- a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
+++ b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
@@ -321,12 +321,15 @@
 }
 
 // static
-LargeBlobSupport TypeConverter<LargeBlobSupport, String>::Convert(
-    const String& large_blob_support) {
-  if (large_blob_support == "required")
-    return LargeBlobSupport::REQUIRED;
-  if (large_blob_support == "preferred")
-    return LargeBlobSupport::PREFERRED;
+LargeBlobSupport
+TypeConverter<LargeBlobSupport, base::Optional<String>>::Convert(
+    const base::Optional<String>& large_blob_support) {
+  if (large_blob_support) {
+    if (*large_blob_support == "required")
+      return LargeBlobSupport::REQUIRED;
+    if (*large_blob_support == "preferred")
+      return LargeBlobSupport::PREFERRED;
+  }
 
   // Unknown values are treated as preferred.
   return LargeBlobSupport::PREFERRED;
@@ -570,9 +573,12 @@
                  WebAuthenticationResidentKeyRequirementEnabled());
       mojo_options->cred_props = true;
     }
-    if (extensions->largeBlob()) {
-      mojo_options->large_blob_enable =
-          ConvertTo<LargeBlobSupport>(extensions->largeBlob()->support());
+    if (extensions->hasLargeBlob()) {
+      base::Optional<WTF::String> support;
+      if (extensions->largeBlob()->hasSupport()) {
+        support = extensions->largeBlob()->support();
+      }
+      mojo_options->large_blob_enable = ConvertTo<LargeBlobSupport>(support);
     }
   }
 
diff --git a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.h b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.h
index 70bf4951..3b95eaaf 100644
--- a/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.h
+++ b/third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.h
@@ -106,8 +106,10 @@
 };
 
 template <>
-struct TypeConverter<blink::mojom::blink::LargeBlobSupport, String> {
-  static blink::mojom::blink::LargeBlobSupport Convert(const String&);
+struct TypeConverter<blink::mojom::blink::LargeBlobSupport,
+                     base::Optional<String>> {
+  static blink::mojom::blink::LargeBlobSupport Convert(
+      const base::Optional<String>&);
 };
 
 template <>
diff --git a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc
index 39c9f5ca..feb0ec4b 100644
--- a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc
+++ b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc
@@ -10,6 +10,7 @@
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "services/device/public/cpp/test/fake_sensor_and_provider.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/renderer/core/frame/local_dom_window.h"
 #include "third_party/blink/renderer/core/frame/platform_event_controller.h"
@@ -84,9 +85,7 @@
     auto* motion_pump =
         MakeGarbageCollected<DeviceMotionEventPump>(page_holder_->GetFrame());
     motion_pump->SetSensorProviderForTesting(
-        mojo::PendingRemote<device::mojom::blink::SensorProvider>(
-            sensor_provider.PassPipe(),
-            device::mojom::SensorProvider::Version_));
+        ToCrossVariantMojoType(std::move(sensor_provider)));
 
     controller_ = MakeGarbageCollected<MockDeviceMotionController>(
         motion_pump, *page_holder_->GetFrame().DomWindow());
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc
index 38accdd..67577c4 100644
--- a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc
+++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc
@@ -10,6 +10,7 @@
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "services/device/public/cpp/test/fake_sensor_and_provider.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/renderer/core/frame/local_dom_window.h"
 #include "third_party/blink/renderer/core/frame/platform_event_controller.h"
@@ -90,14 +91,12 @@
   void SetUp() override {
     page_holder_ = std::make_unique<DummyPageHolder>();
 
-    mojo::PendingRemote<device::mojom::SensorProvider> sensor_provider;
-    sensor_provider_.Bind(sensor_provider.InitWithNewPipeAndPassReceiver());
+    mojo::PendingRemote<device::mojom::blink::SensorProvider> sensor_provider;
+    sensor_provider_.Bind(ToCrossVariantMojoType(
+        sensor_provider.InitWithNewPipeAndPassReceiver()));
     auto* orientation_pump = MakeGarbageCollected<DeviceOrientationEventPump>(
         page_holder_->GetFrame(), false /* absolute */);
-    orientation_pump->SetSensorProviderForTesting(
-        mojo::PendingRemote<device::mojom::blink::SensorProvider>(
-            sensor_provider.PassPipe(),
-            device::mojom::SensorProvider::Version_));
+    orientation_pump->SetSensorProviderForTesting(std::move(sensor_provider));
 
     controller_ = MakeGarbageCollected<MockDeviceOrientationController>(
         orientation_pump, *page_holder_->GetFrame().DomWindow());
@@ -497,15 +496,14 @@
   void SetUp() override {
     page_holder_ = std::make_unique<DummyPageHolder>();
 
-    mojo::PendingRemote<device::mojom::SensorProvider> sensor_provider;
-    sensor_provider_.Bind(sensor_provider.InitWithNewPipeAndPassReceiver());
+    mojo::PendingRemote<device::mojom::blink::SensorProvider> sensor_provider;
+    sensor_provider_.Bind(ToCrossVariantMojoType(
+        sensor_provider.InitWithNewPipeAndPassReceiver()));
     auto* absolute_orientation_pump =
         MakeGarbageCollected<DeviceOrientationEventPump>(
             page_holder_->GetFrame(), true /* absolute */);
     absolute_orientation_pump->SetSensorProviderForTesting(
-        mojo::PendingRemote<device::mojom::blink::SensorProvider>(
-            sensor_provider.PassPipe(),
-            device::mojom::SensorProvider::Version_));
+        std::move(sensor_provider));
 
     controller_ = MakeGarbageCollected<MockDeviceOrientationController>(
         absolute_orientation_pump, *page_holder_->GetFrame().DomWindow());
diff --git a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc
index 947b155..cccd87a 100644
--- a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc
+++ b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc
@@ -509,50 +509,6 @@
 }
 
 // static
-scoped_refptr<media::VideoFrame>
-VideoTrackRecorderImpl::Encoder::WrapMappedGpuMemoryBufferVideoFrame(
-    scoped_refptr<media::VideoFrame> video_frame) {
-  DCHECK(video_frame);
-  DCHECK_EQ(video_frame->storage_type(),
-            media::VideoFrame::StorageType::STORAGE_GPU_MEMORY_BUFFER);
-
-  auto* gmb = video_frame->GetGpuMemoryBuffer();
-  DCHECK(gmb);
-
-  if (!gmb->Map()) {
-    LOG(WARNING) << "Failed to map GpuMemoryBuffer";
-    return nullptr;
-  }
-
-  const size_t num_planes = media::VideoFrame::NumPlanes(video_frame->format());
-  uint8_t* plane_addrs[media::VideoFrame::kMaxPlanes] = {};
-  for (size_t i = 0; i < num_planes; i++)
-    plane_addrs[i] = static_cast<uint8_t*>(gmb->memory(i));
-
-  auto mapped_frame = media::VideoFrame::WrapExternalYuvDataWithLayout(
-      video_frame->layout(), video_frame->visible_rect(),
-      video_frame->natural_size(), plane_addrs[0], plane_addrs[1],
-      plane_addrs[2], video_frame->timestamp());
-
-  if (!mapped_frame) {
-    gmb->Unmap();
-    return nullptr;
-  }
-
-  mapped_frame->set_color_space(video_frame->ColorSpace());
-
-  // Pass |video_frame| so that it outlives |mapped_frame| and the mapped buffer
-  // is unmapped on destruction.
-  mapped_frame->AddDestructionObserver(WTF::Bind(
-      [](scoped_refptr<media::VideoFrame> frame) {
-        DCHECK(frame->HasGpuMemoryBuffer());
-        frame->GetGpuMemoryBuffer()->Unmap();
-      },
-      std::move(video_frame)));
-  return mapped_frame;
-}
-
-// static
 VideoTrackRecorderImpl::CodecId VideoTrackRecorderImpl::GetPreferredCodecId() {
   return GetCodecEnumerator()->GetPreferredCodecId();
 }
diff --git a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h
index 0e381b0..8c28e14f 100644
--- a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h
+++ b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h
@@ -203,12 +203,6 @@
     scoped_refptr<media::VideoFrame> ConvertToI420ForSoftwareEncoder(
         scoped_refptr<media::VideoFrame> frame);
 
-    // A helper function to map GpuMemoryBuffer-based VideoFrame. This function
-    // maps the given GpuMemoryBuffer of |frame| as-is without converting pixel
-    // format. The returned VideoFrame owns the |frame|.
-    static scoped_refptr<media::VideoFrame> WrapMappedGpuMemoryBufferVideoFrame(
-        scoped_refptr<media::VideoFrame> frame);
-
     // Used to shutdown properly on the same thread we were created.
     const scoped_refptr<base::SequencedTaskRunner> main_task_runner_;
 
diff --git a/third_party/blink/renderer/modules/mediarecorder/vpx_encoder.cc b/third_party/blink/renderer/modules/mediarecorder/vpx_encoder.cc
index 93c25da..79b1610c 100644
--- a/third_party/blink/renderer/modules/mediarecorder/vpx_encoder.cc
+++ b/third_party/blink/renderer/modules/mediarecorder/vpx_encoder.cc
@@ -8,6 +8,7 @@
 
 #include "base/system/sys_info.h"
 #include "media/base/video_frame.h"
+#include "media/base/video_util.h"
 #include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
 #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
 #include "third_party/blink/renderer/platform/scheduler/public/thread.h"
@@ -74,7 +75,7 @@
 
   if (frame->format() == media::PIXEL_FORMAT_NV12 &&
       frame->storage_type() == media::VideoFrame::STORAGE_GPU_MEMORY_BUFFER)
-    frame = WrapMappedGpuMemoryBufferVideoFrame(frame);
+    frame = media::ConvertToMemoryMappedFrame(frame);
   if (!frame) {
     LOG(WARNING) << "Invalid video frame to encode";
     return;
diff --git a/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc b/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc
index b084b7b..4a691e8 100644
--- a/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc
+++ b/third_party/blink/renderer/modules/mediastream/video_track_adapter.cc
@@ -22,6 +22,7 @@
 #include "media/base/bind_to_current_loop.h"
 #include "media/base/limits.h"
 #include "media/base/video_util.h"
+#include "third_party/blink/public/common/features.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/renderer/modules/mediastream/video_track_adapter_settings.h"
 #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
@@ -409,7 +410,11 @@
   DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_);
 
   // Do not drop frames if max frame rate hasn't been specified.
-  if (settings_.max_frame_rate() == 0.0f) {
+  if (settings_.max_frame_rate() == 0.0f ||
+      (base::FeatureList::IsEnabled(
+           features::kMediaStreamTrackUseConfigMaxFrameRate) &&
+       source_frame_rate > 0 &&
+       source_frame_rate <= settings_.max_frame_rate())) {
     last_time_stamp_ = frame.timestamp();
     return false;
   }
diff --git a/third_party/blink/renderer/modules/service_worker/cross_origin_resource_policy_checker.cc b/third_party/blink/renderer/modules/service_worker/cross_origin_resource_policy_checker.cc
index 04ddb638..da1d20a 100644
--- a/third_party/blink/renderer/modules/service_worker/cross_origin_resource_policy_checker.cc
+++ b/third_party/blink/renderer/modules/service_worker/cross_origin_resource_policy_checker.cc
@@ -5,6 +5,7 @@
 #include "third_party/blink/renderer/modules/service_worker/cross_origin_resource_policy_checker.h"
 
 #include "services/network/public/cpp/cross_origin_resource_policy.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
 #include "third_party/blink/renderer/core/fetch/response.h"
 
 namespace blink {
@@ -15,11 +16,7 @@
         network::mojom::blink::CrossOriginEmbedderPolicyReporter> reporter)
     : policy_(std::move(policy)) {
   if (reporter) {
-    mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter>
-        pending_reporter_non_blink{
-            reporter.PassPipe(),
-            network::mojom::CrossOriginEmbedderPolicyReporter::Version_};
-    reporter_.Bind(std::move(pending_reporter_non_blink));
+    reporter_.Bind(ToCrossVariantMojoType(std::move(reporter)));
   }
 }
 
diff --git a/third_party/blink/renderer/platform/graphics/path.cc b/third_party/blink/renderer/platform/graphics/path.cc
index 3fa64ff..7c9fc54 100644
--- a/third_party/blink/renderer/platform/graphics/path.cc
+++ b/third_party/blink/renderer/platform/graphics/path.cc
@@ -201,17 +201,13 @@
 }
 
 FloatPoint Path::PointAtLength(float length) const {
-  FloatPoint point;
-  float normal;
-  PointAndNormalAtLength(length, point, normal);
-  return point;
+  return PointAndNormalAtLength(length).point;
 }
 
-static bool CalculatePointAndNormalOnPath(SkPathMeasure& measure,
-                                          SkScalar& contour_start,
-                                          SkScalar length,
-                                          FloatPoint& point,
-                                          float& normal_angle) {
+static base::Optional<PointAndTangent> CalculatePointAndNormalOnPath(
+    SkPathMeasure& measure,
+    SkScalar& contour_start,
+    SkScalar length) {
   do {
     SkScalar contour_end = contour_start + measure.getLength();
     if (length <= contour_end) {
@@ -220,31 +216,25 @@
 
       SkScalar pos_in_contour = length - contour_start;
       if (measure.getPosTan(pos_in_contour, &position, &tangent)) {
-        normal_angle =
+        PointAndTangent result;
+        result.point = FloatPoint(position);
+        result.tangent_in_degrees =
             rad2deg(SkScalarToFloat(SkScalarATan2(tangent.fY, tangent.fX)));
-        point = FloatPoint(SkScalarToFloat(position.fX),
-                           SkScalarToFloat(position.fY));
-        return true;
+        return result;
       }
     }
     contour_start = contour_end;
   } while (measure.nextContour());
-  return false;
+  return base::nullopt;
 }
 
-void Path::PointAndNormalAtLength(float length,
-                                  FloatPoint& point,
-                                  float& normal) const {
+PointAndTangent Path::PointAndNormalAtLength(float length) const {
   SkPathMeasure measure(path_, false);
   SkScalar start = 0;
-  if (CalculatePointAndNormalOnPath(
-          measure, start, WebCoreFloatToSkScalar(length), point, normal))
-    return;
-
-  SkPoint position = path_.getPoint(0);
-  point =
-      FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
-  normal = 0;
+  if (base::Optional<PointAndTangent> result = CalculatePointAndNormalOnPath(
+          measure, start, WebCoreFloatToSkScalar(length)))
+    return *result;
+  return {FloatPoint(path_.getPoint(0)), 0};
 }
 
 Path::PositionCalculator::PositionCalculator(const Path& path)
@@ -252,9 +242,7 @@
       path_measure_(path.GetSkPath(), false),
       accumulated_length_(0) {}
 
-void Path::PositionCalculator::PointAndNormalAtLength(float length,
-                                                      FloatPoint& point,
-                                                      float& normal_angle) {
+PointAndTangent Path::PositionCalculator::PointAndNormalAtLength(float length) {
   SkScalar sk_length = WebCoreFloatToSkScalar(length);
   if (sk_length >= 0) {
     if (sk_length < accumulated_length_) {
@@ -263,15 +251,12 @@
       accumulated_length_ = 0;
     }
 
-    if (CalculatePointAndNormalOnPath(path_measure_, accumulated_length_,
-                                      sk_length, point, normal_angle))
-      return;
+    base::Optional<PointAndTangent> result = CalculatePointAndNormalOnPath(
+        path_measure_, accumulated_length_, sk_length);
+    if (result)
+      return *result;
   }
-
-  SkPoint position = path_.getPoint(0);
-  point =
-      FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
-  normal_angle = 0;
+  return {FloatPoint(path_.getPoint(0)), 0};
 }
 
 void Path::Clear() {
diff --git a/third_party/blink/renderer/platform/graphics/path.h b/third_party/blink/renderer/platform/graphics/path.h
index 6e8f3b5d..94d8003 100644
--- a/third_party/blink/renderer/platform/graphics/path.h
+++ b/third_party/blink/renderer/platform/graphics/path.h
@@ -65,6 +65,12 @@
   FloatPoint* points;
 };
 
+// Result structure from Path::PointAndNormalAtLength() (and similar).
+struct PointAndTangent {
+  FloatPoint point;
+  float tangent_in_degrees = 0;
+};
+
 typedef void (*PathApplierFunction)(void* info, const PathElement*);
 
 class PLATFORM_EXPORT Path {
@@ -97,7 +103,7 @@
 
   float length() const;
   FloatPoint PointAtLength(float length) const;
-  void PointAndNormalAtLength(float length, FloatPoint&, float&) const;
+  PointAndTangent PointAndNormalAtLength(float length) const;
 
   // Helper for computing a sequence of positions and normals (normal angles) on
   // a path. The best possible access pattern will be one where the |length|
@@ -111,7 +117,7 @@
    public:
     explicit PositionCalculator(const Path&);
 
-    void PointAndNormalAtLength(float length, FloatPoint&, float&);
+    PointAndTangent PointAndNormalAtLength(float length);
 
    private:
     SkPath path_;
diff --git a/third_party/blink/renderer/platform/graphics/path_test.cc b/third_party/blink/renderer/platform/graphics/path_test.cc
index fbf1af6..6c0bce0 100644
--- a/third_party/blink/renderer/platform/graphics/path_test.cc
+++ b/third_party/blink/renderer/platform/graphics/path_test.cc
@@ -17,10 +17,9 @@
   path.AddBezierCurveTo(FloatPoint(324, 196), FloatPoint(472, 370),
                         FloatPoint(460, 470));
 
-  FloatPoint point;
-  float angle;
-  path.PointAndNormalAtLength(path.length(), point, angle);
-  EXPECT_EQ(point, FloatPoint(460, 470));
+  PointAndTangent point_and_tangent =
+      path.PointAndNormalAtLength(path.length());
+  EXPECT_EQ(point_and_tangent.point, FloatPoint(460, 470));
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/instrumentation/histogram.cc b/third_party/blink/renderer/platform/instrumentation/histogram.cc
index 0a8270d..699cd428 100644
--- a/third_party/blink/renderer/platform/instrumentation/histogram.cc
+++ b/third_party/blink/renderer/platform/instrumentation/histogram.cc
@@ -41,16 +41,6 @@
       delta.InMilliseconds()));
 }
 
-EnumerationHistogram::EnumerationHistogram(
-    const char* name,
-    base::HistogramBase::Sample boundary_value)
-    : CustomCountHistogram(base::LinearHistogram::FactoryGet(
-          name,
-          1,
-          boundary_value,
-          boundary_value + 1,
-          base::HistogramBase::kUmaTargetedHistogramFlag)) {}
-
 LinearHistogram::LinearHistogram(const char* name,
                                  base::HistogramBase::Sample min,
                                  base::HistogramBase::Sample max,
diff --git a/third_party/blink/renderer/platform/instrumentation/histogram.h b/third_party/blink/renderer/platform/instrumentation/histogram.h
index 8747d1f..e68f194 100644
--- a/third_party/blink/renderer/platform/instrumentation/histogram.h
+++ b/third_party/blink/renderer/platform/instrumentation/histogram.h
@@ -39,13 +39,6 @@
   base::HistogramBase* histogram_;
 };
 
-class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram {
- public:
-  // |boundaryValue| must be strictly greater than samples passed to |count|.
-  EnumerationHistogram(const char* name,
-                       base::HistogramBase::Sample boundary_value);
-};
-
 class PLATFORM_EXPORT LinearHistogram : public CustomCountHistogram {
  public:
   explicit LinearHistogram(const char* name,
diff --git a/third_party/blink/renderer/platform/loader/fetch/fetch_api_request_body_mojom_traits.cc b/third_party/blink/renderer/platform/loader/fetch/fetch_api_request_body_mojom_traits.cc
index 4558e086..c053f18 100644
--- a/third_party/blink/renderer/platform/loader/fetch/fetch_api_request_body_mojom_traits.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/fetch_api_request_body_mojom_traits.cc
@@ -58,10 +58,7 @@
         out->length = element.optional_blob_data_handle_->size();
 
         mojo::Remote<blink::mojom::blink::Blob> blob_remote(
-            mojo::PendingRemote<blink::mojom::blink::Blob>(
-                element.optional_blob_data_handle_->CloneBlobRemote()
-                    .PassPipe(),
-                blink::mojom::blink::Blob::Version_));
+            element.optional_blob_data_handle_->CloneBlobRemote());
         blob_remote->AsDataPipeGetter(
             out->data_pipe_getter.InitWithNewPipeAndPassReceiver());
         break;
diff --git a/third_party/blink/renderer/platform/loader/fetch/url_loader/request_conversion.cc b/third_party/blink/renderer/platform/loader/fetch/url_loader/request_conversion.cc
index fb258384..f8ec1ef 100644
--- a/third_party/blink/renderer/platform/loader/fetch/url_loader/request_conversion.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/url_loader/request_conversion.cc
@@ -23,6 +23,7 @@
 #include "third_party/blink/public/mojom/blob/blob.mojom.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
 #include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
 #include "third_party/blink/public/platform/file_path_conversion.h"
 #include "third_party/blink/public/platform/url_conversion.h"
 #include "third_party/blink/public/platform/web_string.h"
@@ -216,26 +217,23 @@
         break;
       case FormDataElement::kEncodedBlob: {
         DCHECK(element.optional_blob_data_handle_);
-        mojo::Remote<mojom::Blob> blob_remote(mojo::PendingRemote<mojom::Blob>(
-            element.optional_blob_data_handle_->CloneBlobRemote().PassPipe(),
-            mojom::Blob::Version_));
-        mojo::PendingRemote<network::mojom::DataPipeGetter>
+        mojo::Remote<mojom::blink::Blob> blob_remote(
+            element.optional_blob_data_handle_->CloneBlobRemote());
+        mojo::PendingRemote<network::mojom::blink::DataPipeGetter>
             data_pipe_getter_remote;
         blob_remote->AsDataPipeGetter(
             data_pipe_getter_remote.InitWithNewPipeAndPassReceiver());
-        dest->AppendDataPipe(std::move(data_pipe_getter_remote));
+        dest->AppendDataPipe(
+            ToCrossVariantMojoType(std::move(data_pipe_getter_remote)));
         break;
       }
       case FormDataElement::kDataPipe: {
-        // Convert network::mojom::blink::DataPipeGetter to
-        // network::mojom::DataPipeGetter through a raw message pipe.
         mojo::PendingRemote<network::mojom::blink::DataPipeGetter>
             pending_data_pipe_getter;
         element.data_pipe_getter_->GetDataPipeGetter()->Clone(
             pending_data_pipe_getter.InitWithNewPipeAndPassReceiver());
         dest->AppendDataPipe(
-            mojo::PendingRemote<network::mojom::DataPipeGetter>(
-                pending_data_pipe_getter.PassPipe(), 0u));
+            ToCrossVariantMojoType(std::move(pending_data_pipe_getter)));
         break;
       }
     }
@@ -363,9 +361,8 @@
     mojo::PendingRemote<network::mojom::blink::ChunkedDataPipeGetter>
         stream_body = src_body.TakeStreamBody();
     dest->request_body = base::MakeRefCounted<network::ResourceRequestBody>();
-    mojo::PendingRemote<network::mojom::ChunkedDataPipeGetter>
-        network_stream_body(stream_body.PassPipe(), 0u);
-    dest->request_body->SetToReadOnceStream(std::move(network_stream_body));
+    dest->request_body->SetToReadOnceStream(
+        ToCrossVariantMojoType(std::move(stream_body)));
     dest->request_body->SetAllowHTTP1ForStreamingUpload(
         src.AllowHTTP1ForStreamingUpload());
   }
diff --git a/third_party/blink/renderer/platform/loader/web_url_request_util.cc b/third_party/blink/renderer/platform/loader/web_url_request_util.cc
index d89f39a..1aedbbac 100644
--- a/third_party/blink/renderer/platform/loader/web_url_request_util.cc
+++ b/third_party/blink/renderer/platform/loader/web_url_request_util.cc
@@ -16,6 +16,7 @@
 #include "third_party/blink/public/mojom/blob/blob_registry.mojom-blink.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
 #include "third_party/blink/public/mojom/loader/resource_load_info.mojom-blink.h"
+#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
 #include "third_party/blink/public/platform/file_path_conversion.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/public/platform/web_data.h"
@@ -148,24 +149,19 @@
       case HTTPBodyElementType::kTypeBlob: {
         DCHECK(element.optional_blob);
         mojo::Remote<mojom::blink::Blob> blob_remote(
-            mojo::PendingRemote<mojom::blink::Blob>(
-                std::move(element.optional_blob)));
+            std::move(element.optional_blob));
 
         mojo::PendingRemote<network::mojom::blink::DataPipeGetter>
             data_pipe_getter_remote;
         blob_remote->AsDataPipeGetter(
             data_pipe_getter_remote.InitWithNewPipeAndPassReceiver());
         request_body->AppendDataPipe(
-            mojo::PendingRemote<network::mojom::DataPipeGetter>(
-                data_pipe_getter_remote.PassPipe(), 0u));
+            ToCrossVariantMojoType(std::move(data_pipe_getter_remote)));
         break;
       }
       case HTTPBodyElementType::kTypeDataPipe: {
-        // Convert the raw message pipe to
-        // mojo::Remote<network::mojom::DataPipeGetter> data_pipe_getter.
         mojo::Remote<network::mojom::blink::DataPipeGetter> data_pipe_getter(
-            mojo::PendingRemote<network::mojom::blink::DataPipeGetter>(
-                std::move(element.data_pipe_getter)));
+            std::move(element.data_pipe_getter));
 
         // Set the cloned DataPipeGetter to the output |request_body|, while
         // keeping the original message pipe back in the input |httpBody|. This
@@ -175,8 +171,7 @@
             cloned_getter;
         data_pipe_getter->Clone(cloned_getter.InitWithNewPipeAndPassReceiver());
         request_body->AppendDataPipe(
-            mojo::PendingRemote<network::mojom::DataPipeGetter>(
-                cloned_getter.PassPipe(), 0u));
+            ToCrossVariantMojoType(std::move(cloned_getter)));
         element.data_pipe_getter = data_pipe_getter.Unbind();
         break;
       }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index cadb603..e6c2bb0 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -767,7 +767,7 @@
     {
       // http://crbug.com/707656 content editable in LayoutNG.
       name: "EditingNG",
-      status: "experimental",
+      status: "stable",
     },
     {
       name: "EncryptedMediaEncryptionSchemeQuery",
diff --git a/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc b/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc
index 10bc8029..97cb4c2 100644
--- a/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc
+++ b/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc
@@ -7,6 +7,7 @@
 #include "base/callback_helpers.h"
 #include "base/logging.h"
 #include "base/strings/stringprintf.h"
+#include "media/base/video_util.h"
 #include "third_party/blink/public/common/features.h"
 #include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
 #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
@@ -195,38 +196,6 @@
   }
 }
 
-scoped_refptr<media::VideoFrame> WrapGmbVideoFrameForMappedMemoryAccess(
-    scoped_refptr<media::VideoFrame> source_frame) {
-  DCHECK_EQ(source_frame->natural_size(), source_frame->visible_rect().size());
-  gfx::GpuMemoryBuffer* gmb = source_frame->GetGpuMemoryBuffer();
-  if (!gmb || !gmb->Map()) {
-    return nullptr;
-  }
-  // Y and UV planes from the gmb.
-  uint8_t* plane_addresses[2] = {static_cast<uint8_t*>(gmb->memory(0)),
-                                 static_cast<uint8_t*>(gmb->memory(1))};
-  scoped_refptr<media::VideoFrame> destination_frame =
-      media::VideoFrame::WrapExternalYuvData(
-          media::VideoPixelFormat::PIXEL_FORMAT_NV12,
-          source_frame->coded_size(), source_frame->visible_rect(),
-          source_frame->natural_size(), gmb->stride(0), gmb->stride(1),
-          plane_addresses[0], plane_addresses[1], source_frame->timestamp());
-  if (!destination_frame) {
-    gmb->Unmap();
-    LOG(ERROR) << "Failed to wrap gmb buffer";
-    return nullptr;
-  }
-  destination_frame->set_color_space(source_frame->ColorSpace());
-  destination_frame->metadata()->MergeMetadataFrom(source_frame->metadata());
-  destination_frame->AddDestructionObserver(WTF::Bind(
-      [](scoped_refptr<media::VideoFrame> frame) {
-        CHECK(frame->HasGpuMemoryBuffer());
-        frame->GetGpuMemoryBuffer()->Unmap();
-      },
-      std::move(source_frame)));
-  return destination_frame;
-}
-
 scoped_refptr<media::VideoFrame> MakeScaledI420VideoFrame(
     scoped_refptr<media::VideoFrame> source_frame,
     scoped_refptr<blink::WebRtcVideoFrameAdapter::BufferPoolOwner>
@@ -328,7 +297,7 @@
                                     std::move(scaled_frame_pool));
   } else if (source_frame->natural_size() ==
              source_frame->visible_rect().size()) {
-    return WrapGmbVideoFrameForMappedMemoryAccess(std::move(source_frame));
+    return media::ConvertToMemoryMappedFrame(std::move(source_frame));
   } else {
     return MakeScaledNV12VideoFrame(std::move(source_frame),
                                     std::move(scaled_frame_pool));
diff --git a/third_party/blink/tools/blinkpy/w3c/export_notifier.py b/third_party/blink/tools/blinkpy/w3c/export_notifier.py
index 21b6717..de0e018 100644
--- a/third_party/blink/tools/blinkpy/w3c/export_notifier.py
+++ b/third_party/blink/tools/blinkpy/w3c/export_notifier.py
@@ -19,7 +19,8 @@
 
 _log = logging.getLogger(__name__)
 RELEVANT_TASKCLUSTER_CHECKS = [
-    'wpt-chrome-dev-stability', 'wpt-firefox-nightly-stability', 'lint'
+    'wpt-chrome-dev-stability', 'wpt-firefox-nightly-stability', 'lint',
+    'infrastructure/ tests'
 ]
 
 
@@ -93,11 +94,13 @@
         _log.info('Processing %d CLs with failed Taskcluster checks.',
                   len(gerrit_dict))
         for change_id, pr_status_info in gerrit_dict.items():
+            _log.info('Change-Id: %s', change_id)
             try:
                 cl = self.gerrit.query_cl_comments_and_revisions(change_id)
                 has_commented = self.has_latest_taskcluster_status_commented(
                     cl.messages, pr_status_info)
                 if has_commented:
+                    _log.info('Comment is up-to-date. Nothing to do here.')
                     continue
 
                 revision = cl.revisions.get(pr_status_info.gerrit_sha)
@@ -131,6 +134,7 @@
             cl_gerrit_sha = PRStatusInfo.get_gerrit_sha_from_comment(
                 message['message'])
             if cl_gerrit_sha:
+                _log.debug('Found latest comment: %s', message['message'])
                 return cl_gerrit_sha == pr_status_info.gerrit_sha
 
         return False
diff --git a/third_party/blink/tools/blinkpy/w3c/export_notifier_unittest.py b/third_party/blink/tools/blinkpy/w3c/export_notifier_unittest.py
index 185d9c1..791c6753 100644
--- a/third_party/blink/tools/blinkpy/w3c/export_notifier_unittest.py
+++ b/third_party/blink/tools/blinkpy/w3c/export_notifier_unittest.py
@@ -78,12 +78,26 @@
                 "conclusion": "failure",
                 "name": "wpt-firefox-nightly-stability"
             },
+            {
+                "id": "3",
+                "conclusion": "failure",
+                "name": "lint"
+            },
+            {
+                "id": "4",
+                "conclusion": "failure",
+                "name": "infrastructure/ tests"
+            },
         ]
         expected = {
             'wpt-chrome-dev-stability':
             'https://github.com/web-platform-tests/wpt/pull/123/checks?check_run_id=1',
             'wpt-firefox-nightly-stability':
-            'https://github.com/web-platform-tests/wpt/pull/123/checks?check_run_id=2'
+            'https://github.com/web-platform-tests/wpt/pull/123/checks?check_run_id=2',
+            'lint':
+            'https://github.com/web-platform-tests/wpt/pull/123/checks?check_run_id=3',
+            'infrastructure/ tests':
+            'https://github.com/web-platform-tests/wpt/pull/123/checks?check_run_id=4',
         }
 
         self.assertEqual(
@@ -294,7 +308,8 @@
         self.assertEqual(self.notifier.gerrit.request_posted, [])
         self.assertLog([
             'INFO: Processing 1 CLs with failed Taskcluster checks.\n',
-            'ERROR: Could not process Gerrit CL abc: Error from query_cl\n'
+            'INFO: Change-Id: abc\n',
+            'ERROR: Could not process Gerrit CL abc: Error from query_cl\n',
         ])
 
     def test_export_notifier_success(self):
diff --git a/third_party/blink/web_tests/MSANExpectations b/third_party/blink/web_tests/MSANExpectations
index d0b9b067..39b5ade6 100644
--- a/third_party/blink/web_tests/MSANExpectations
+++ b/third_party/blink/web_tests/MSANExpectations
@@ -150,3 +150,6 @@
 
 # Sheriff 2020-10-05
 crbug.com/1134580 [ Linux ] virtual/eye-dropper/color-picker-show-eye-dropper.html [ Pass Timeout ]
+
+# Sheriff 2020-11-25
+crbug.com/1152088 [ Linux ] fast/dom/cssTarget-crash.html [ Pass Timeout ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations
index 8d000c9..0179c87 100644
--- a/third_party/blink/web_tests/TestExpectations
+++ b/third_party/blink/web_tests/TestExpectations
@@ -6013,9 +6013,6 @@
 crbug.com/1150518 [ Win ] virtual/gpu/fast/canvas/canvas-composite-shadow.html [ Pass Timeout ]
 crbug.com/1150475 fast/dom/open-and-close-by-DOM.html [ Pass Failure ]
 
-# Skip to land change in frontend (https://crrev.com/c/2550061) before this layout test can be updated
-crbug.com/1150854 http/tests/devtools/unit/soft-context-menu.js [ Skip ]
-
 #Sheriff 2020-11-23
 crbug.com/1151861 external/wpt/workers/semantics/multiple-workers/003.html [ Timeout Crash ]
 crbug.com/1152088 [ Mac10.13 Debug ] fast/dom/cssTarget-crash.html [ Pass Timeout ]
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/protocol/RTCPeerConnection-payloadTypes.html b/third_party/blink/web_tests/external/wpt/webrtc/protocol/RTCPeerConnection-payloadTypes.html
new file mode 100644
index 0000000..eacbf38a
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/webrtc/protocol/RTCPeerConnection-payloadTypes.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>RTCPeerConnection RTP payload types</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+
+// Test that when creating an offer we do not run out of valid payload types.
+promise_test(async t => {
+  const pc1 = new RTCPeerConnection();
+  t.add_cleanup(() => pc1.close());
+
+  const offer = await pc1.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true});
+
+  // Extract all payload types from the m= lines.
+  const payloadTypes = offer.sdp.split('\n')
+    .map(line => line.trim())
+    .filter(line => line.startsWith('m='))
+    .map(line => line.split(' ').slice(3).join(' '))
+    .join(' ')
+    .split(' ')
+    .map(payloadType => parseInt(payloadType, 10));
+
+  // The list of allowed payload types is taken from here
+  // https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-1.
+  const forbiddenPayloadTypes = payloadTypes
+    .filter(payloadType => {
+      if (payloadType >= 96 && payloadType <= 127) {
+        return false;
+      }
+      if (payloadType >= 72 && payloadType < 96) {
+        return true;
+      }
+      if (payloadType >= 35 && payloadType < 72) {
+        return false;
+      }
+      // TODO: Check against static payload type list.
+      return false;
+    });
+  assert_equals(forbiddenPayloadTypes.length, 0)
+}, 'createOffer with the maximum set of codecs does not generate invalid payload types');
+</script>
+</body>
+</html>
diff --git a/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-payloadTypes.html b/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-payloadTypes.html
new file mode 100644
index 0000000..b94def6
--- /dev/null
+++ b/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-payloadTypes.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>RTCPeerConnection RTP payload types</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+
+// Test that when creating an offer we do not run out of valid payload types.
+// This uses the deprecated RTP datachannels which means an extra payload
+// type is allocated.
+const legacy_datachannel_constraint = {
+    optional: [{ RtpDataChannels: true }]
+}
+
+promise_test(async t => {
+  const pc1 = new RTCPeerConnection(null, legacy_datachannel_constraint);
+  t.add_cleanup(() => pc1.close());
+
+  const offer = await pc1.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true});
+
+  // Extract all payload types from the m= lines.
+  const payloadTypes = offer.sdp.split('\n')
+    .map(line => line.trim())
+    .filter(line => line.startsWith('m='))
+    .map(line => line.split(' ').slice(3).join(' '))
+    .join(' ')
+    .split(' ')
+    .map(payloadType => parseInt(payloadType, 10));
+
+  // The list of allowed payload types is taken from here
+  // https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-1.
+  const forbiddenPayloadTypes = payloadTypes
+    .filter(payloadType => {
+      if (payloadType >= 96 && payloadType <= 127) {
+        return false;
+      }
+      if (payloadType >= 72 && payloadType < 96) {
+        return true;
+      }
+      if (payloadType >= 35 && payloadType < 72) {
+        return false;
+      }
+      // TODO: Check against static payload type list.
+      return false;
+    });
+  assert_equals(forbiddenPayloadTypes.length, 0)
+}, 'createOffer with the maximum set of codecs and RTP datachannels does not generate invalid payload types');
+</script>
+</body>
+</html>
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/outline/outline-continuations-expected.txt
index 45c5275..16ee037 100644
--- a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/outline/outline-continuations-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/outline/outline-continuations-expected.txt
@@ -6,7 +6,8 @@
       "contentsOpaque": true,
       "backgroundColor": "#FFFFFF",
       "invalidations": [
-        [16, 108, 90, 63]
+        [16, 148, 90, 23],
+        [16, 108, 90, 23]
       ]
     }
   ]
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/focus-ring-continuations-expected.png
new file mode 100644
index 0000000..146a698
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/inline/continuation-outlines-with-layers-2-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/inline/continuation-outlines-with-layers-2-expected.png
new file mode 100644
index 0000000..d6320f5
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/inline/continuation-outlines-with-layers-2-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/table/table-continuation-outline-paint-crash-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/table/table-continuation-outline-paint-crash-expected.png
new file mode 100644
index 0000000..2ce1e89b
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/table/table-continuation-outline-paint-crash-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/outline/outline-continuations-expected.txt
new file mode 100644
index 0000000..32df285
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/outline/outline-continuations-expected.txt
@@ -0,0 +1,14 @@
+{
+  "layers": [
+    {
+      "name": "Scrolling Contents Layer",
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "backgroundColor": "#FFFFFF",
+      "invalidations": [
+        [16, 108, 90, 63]
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png
new file mode 100644
index 0000000..146a698
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/focus-ring-continuations-expected.png
index 146a698..c3b21bc 100644
--- a/third_party/blink/web_tests/platform/linux/fast/css/focus-ring-continuations-expected.png
+++ b/third_party/blink/web_tests/platform/linux/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-expected.png
index 838b491f..30c05533 100644
--- a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-expected.png
+++ b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-2-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-2-expected.png
index d6320f5..2e24edbe 100644
--- a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-2-expected.png
+++ b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-2-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-expected.png
index 20334da..30c05533 100644
--- a/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-expected.png
+++ b/third_party/blink/web_tests/platform/linux/fast/inline/continuation-outlines-with-layers-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/table-continuation-outline-paint-crash-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/table-continuation-outline-paint-crash-expected.png
index 2ce1e89b..e625352 100644
--- a/third_party/blink/web_tests/platform/linux/fast/table/table-continuation-outline-paint-crash-expected.png
+++ b/third_party/blink/web_tests/platform/linux/fast/table/table-continuation-outline-paint-crash-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/platform/linux/paint/invalidation/outline/outline-continuations-expected.txt
index 32df285..844240f 100644
--- a/third_party/blink/web_tests/platform/linux/paint/invalidation/outline/outline-continuations-expected.txt
+++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/outline/outline-continuations-expected.txt
@@ -6,7 +6,8 @@
       "contentsOpaque": true,
       "backgroundColor": "#FFFFFF",
       "invalidations": [
-        [16, 108, 90, 63]
+        [16, 148, 90, 23],
+        [16, 108, 90, 23]
       ]
     }
   ]
diff --git a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_fragment_traversal/fast/table/table-continuation-outline-paint-crash-expected.png b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_fragment_traversal/fast/table/table-continuation-outline-paint-crash-expected.png
new file mode 100644
index 0000000..e625352
--- /dev/null
+++ b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_fragment_traversal/fast/table/table-continuation-outline-paint-crash-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png
new file mode 100644
index 0000000..c3b21bc
--- /dev/null
+++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/platform/mac/fast/css/focus-ring-continuations-expected.png
index 8b0bc2e..5a0e150 100644
--- a/third_party/blink/web_tests/platform/mac/fast/css/focus-ring-continuations-expected.png
+++ b/third_party/blink/web_tests/platform/mac/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-expected.png b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-expected.png
index 25a7a51..a5ba529 100644
--- a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-expected.png
+++ b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-2-expected.png b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-2-expected.png
index 69e9c35b..e77c2816 100644
--- a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-2-expected.png
+++ b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-2-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.png b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.png
index b973b89..a5ba529 100644
--- a/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.png
+++ b/third_party/blink/web_tests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/table/table-continuation-outline-paint-crash-expected.png b/third_party/blink/web_tests/platform/mac/fast/table/table-continuation-outline-paint-crash-expected.png
index 42d9e0e..a2a7b4a 100644
--- a/third_party/blink/web_tests/platform/mac/fast/table/table-continuation-outline-paint-crash-expected.png
+++ b/third_party/blink/web_tests/platform/mac/fast/table/table-continuation-outline-paint-crash-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/outline/outline-continuations-expected.txt
index 34ef42f..e275846 100644
--- a/third_party/blink/web_tests/platform/mac/paint/invalidation/outline/outline-continuations-expected.txt
+++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/outline/outline-continuations-expected.txt
@@ -6,7 +6,8 @@
       "contentsOpaque": true,
       "backgroundColor": "#FFFFFF",
       "invalidations": [
-        [16, 108, 88, 60]
+        [16, 146, 88, 22],
+        [16, 108, 88, 22]
       ]
     }
   ]
diff --git a/third_party/blink/web_tests/platform/win/fast/css/focus-ring-continuations-expected.png b/third_party/blink/web_tests/platform/win/fast/css/focus-ring-continuations-expected.png
index 4d69b45..136c2b2c 100644
--- a/third_party/blink/web_tests/platform/win/fast/css/focus-ring-continuations-expected.png
+++ b/third_party/blink/web_tests/platform/win/fast/css/focus-ring-continuations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-expected.png
index ed9dee31..6d006139 100644
--- a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-expected.png
+++ b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-2-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-2-expected.png
index 4d1e4c98..1a33ac63 100644
--- a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-2-expected.png
+++ b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-2-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-expected.png
index f250101a..6d006139 100644
--- a/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-expected.png
+++ b/third_party/blink/web_tests/platform/win/fast/inline/continuation-outlines-with-layers-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/table-continuation-outline-paint-crash-expected.png b/third_party/blink/web_tests/platform/win/fast/table/table-continuation-outline-paint-crash-expected.png
index fb9918c..d888118 100644
--- a/third_party/blink/web_tests/platform/win/fast/table/table-continuation-outline-paint-crash-expected.png
+++ b/third_party/blink/web_tests/platform/win/fast/table/table-continuation-outline-paint-crash-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/platform/win/paint/invalidation/outline/outline-continuations-expected.txt
index c10c2fea7..bfd93bb 100644
--- a/third_party/blink/web_tests/platform/win/paint/invalidation/outline/outline-continuations-expected.txt
+++ b/third_party/blink/web_tests/platform/win/paint/invalidation/outline/outline-continuations-expected.txt
@@ -6,7 +6,8 @@
       "contentsOpaque": true,
       "backgroundColor": "#FFFFFF",
       "invalidations": [
-        [16, 108, 87, 63]
+        [16, 148, 87, 23],
+        [16, 108, 87, 23]
       ]
     }
   ]
diff --git a/third_party/freetype/README.chromium b/third_party/freetype/README.chromium
index 2a2f58e..98d02b9 100644
--- a/third_party/freetype/README.chromium
+++ b/third_party/freetype/README.chromium
@@ -1,7 +1,7 @@
 Name: FreeType
 URL: http://www.freetype.org/
-Version: VER-2-10-4-16-g5abd252a0
-Revision: 5abd252a0a26a878c6b7830f10e0611f1d6c0425
+Version: VER-2-10-4-17-g3facafa44
+Revision: 3facafa44e2ac49ac15359bf6c83110614a6cbf7
 CPEPrefix: cpe:/a:freetype:freetype:2.10.1
 License: Custom license "inspired by the BSD, Artistic, and IJG (Independent
          JPEG Group) licenses"
diff --git a/tools/grit/grit/format/data_pack.py b/tools/grit/grit/format/data_pack.py
index 2876462b..cfb0156 100755
--- a/tools/grit/grit/format/data_pack.py
+++ b/tools/grit/grit/format/data_pack.py
@@ -283,7 +283,10 @@
     # Make sure we have no dups.
     duplicate_keys = set(input_resources.keys()) & set(resources.keys())
     if duplicate_keys:
-      raise KeyError('Duplicate keys: ' + str(list(duplicate_keys)))
+      raise KeyError(
+        'Duplicate resource IDs: ' + str(list(duplicate_keys)) + '. '
+        'This is likely because the reserved ID ranges defined in' +
+        'tools/gritsettings/resource_ids.spec have been exhausted.')
 
     # Make sure encoding is consistent.
     if encoding in (None, BINARY):
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 5c9fdad..5650586 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -672,7 +672,9 @@
 
   # This file is generated during the build.
   "<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": {
-    "META": {"sizes": {"includes": [1000],}},
+    # In debug build, devtools frontend sources are not bundled and therefore
+    # includes a lot of individual resources
+    "META": {"sizes": {"includes": [2000],}},
     "includes": [3860],
   },
 
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index ba23f93..139a34d 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -956,7 +956,7 @@
   <int value="1" label="DismissedBack">
     User has dismissed the promo by tapping back button.
   </int>
-  <int value="2" label="AddAccount">
+  <int value="2" label="AddAccountStarted">
     User has tapped |Add account to device| from expanded account list.
   </int>
   <int value="3" label="StartedIncognitoSession">
@@ -997,6 +997,10 @@
     User has dismissed the promo by tapping on the dismissal button in the
     bottom sheet.
   </int>
+  <int value="15" label="AddAccountCompleted">
+    User has completed the account addition flow triggered from the bottom
+    sheet.
+  </int>
 </enum>
 
 <enum name="AccountManagerAccountAdditionSource">
@@ -17178,6 +17182,8 @@
   <int value="103" label="Crostini Recovery Dialog"/>
   <int value="104" label="Parent Permission ChromeOS"/>
   <int value="105" label="Signin Reauth Dialog"/>
+  <int value="106"
+      label="Confirmation Box for getCurrentBrowsingContextMedia API"/>
 </enum>
 
 <enum name="DialogOriginRelationship">
@@ -43455,6 +43461,7 @@
   <int value="-433879402"
       label="EnableAmbientAuthenticationInIncognito:disabled"/>
   <int value="-432612065" label="AImageReader:enabled"/>
+  <int value="-431553693" label="ChangePasswordAffiliationInfo:disabled"/>
   <int value="-430369215" label="AssistPersonalInfo:disabled"/>
   <int value="-430360431" label="disable-password-generation"/>
   <int value="-428599163" label="NTPDownloadSuggestions:enabled"/>
@@ -43968,6 +43975,7 @@
   <int value="58727839" label="WebAssemblyLazyCompilation:enabled"/>
   <int value="59784035" label="ImeThread:disabled"/>
   <int value="59964519" label="OmniboxEnableClipboardProvider:disabled"/>
+  <int value="59992411" label="ChangePasswordAffiliationInfo:enabled"/>
   <int value="60023885" label="AutofillNoLocalSaveOnUnmaskSuccess:disabled"/>
   <int value="61130490" label="WebViewBrotliSupport:enabled"/>
   <int value="61205887" label="enable-text-input-focus-manager"/>
@@ -44189,6 +44197,7 @@
   <int value="304588364" label="TextureLayerSkipWaitForActivation:enabled"/>
   <int value="304901781" label="NewUsbBackend:enabled"/>
   <int value="305356014" label="WebViewMeasureScreenCoverage:disabled"/>
+  <int value="306565540" label="UseOfHashAffiliationFetcher:enabled"/>
   <int value="306641800" label="AndroidSiteSettingsUIRefresh:disabled"/>
   <int value="306834044" label="webui-tab-strip"/>
   <int value="307543404" label="disable-team-drives"/>
@@ -44788,6 +44797,7 @@
   <int value="879699575" label="disable-gesture-tap-highlight"/>
   <int value="879992337" label="disable-pull-to-refresh-effect"/>
   <int value="880510010" label="enable-permissions-bubbles"/>
+  <int value="882893584" label="UseOfHashAffiliationFetcher:disabled"/>
   <int value="883190338" label="PrintWithReducedRasterization:disabled"/>
   <int value="884106779" label="supervised-user-safesites"/>
   <int value="885186849" label="finch-seed-expiration-age"/>
diff --git a/tools/metrics/histograms/histograms_xml/chromeos/histograms.xml b/tools/metrics/histograms/histograms_xml/chromeos/histograms.xml
index 0b269197..3d45817 100644
--- a/tools/metrics/histograms/histograms_xml/chromeos/histograms.xml
+++ b/tools/metrics/histograms/histograms_xml/chromeos/histograms.xml
@@ -1176,7 +1176,7 @@
 </histogram>
 
 <histogram name="ChromeOS.UserAddingScreen.LoadTimeViewsBased" units="ms"
-    expires_after="2021-01-07">
+    expires_after="2021-05-16">
   <owner>tellier@google.com</owner>
   <owner>rsorokin@chromium.org</owner>
   <owner>cros-oac@google.com</owner>
diff --git a/tools/metrics/histograms/histograms_xml/others/histograms.xml b/tools/metrics/histograms/histograms_xml/others/histograms.xml
index 32e96f4..d4a85eb 100644
--- a/tools/metrics/histograms/histograms_xml/others/histograms.xml
+++ b/tools/metrics/histograms/histograms_xml/others/histograms.xml
@@ -4532,7 +4532,7 @@
 </histogram>
 
 <histogram name="DrmUtil.GetColorSpaceFromEdid.ChecksOutcome"
-    enum="EdidColorSpaceChecksOutcome" expires_after="2021-01-03">
+    enum="EdidColorSpaceChecksOutcome" expires_after="2022-01-03">
   <owner>andrescj@chromium.org</owner>
   <owner>mcasas@chromium.org</owner>
   <owner>chromeos-gfx@google.com</owner>
diff --git a/tools/metrics/histograms/histograms_xml/page/histograms.xml b/tools/metrics/histograms/histograms_xml/page/histograms.xml
index 43fd03d..5d311181 100644
--- a/tools/metrics/histograms/histograms_xml/page/histograms.xml
+++ b/tools/metrics/histograms/histograms_xml/page/histograms.xml
@@ -1990,6 +1990,23 @@
   </summary>
 </histogram>
 
+<histogram
+    name="PageLoad.PaintTiming.NavigationToFirstPaint.BFCachePolyfill{Count}"
+    units="ms" expires_after="2021-11-01">
+  <owner>altimin@chromium.org</owner>
+  <owner>bmcquade@chromium.org</owner>
+  <owner>hajimehoshi@chromium.org</owner>
+  <summary>
+    Meastures the time duration between the page restore from BFcache and the
+    {Count} requestAnimationFrame time.
+  </summary>
+  <token key="Count">
+    <variant name="First"/>
+    <variant name="Second"/>
+    <variant name="Third"/>
+  </token>
+</histogram>
+
 <histogram name="PageLoad.PaintTiming.NavigationToLargestContentfulPaint"
     units="ms" expires_after="2021-04-04">
   <owner>maxlg@chromium.org</owner>
diff --git a/tools/resources/generate_resource_allowlist.py b/tools/resources/generate_resource_allowlist.py
index 7747beea..af35bce3 100755
--- a/tools/resources/generate_resource_allowlist.py
+++ b/tools/resources/generate_resource_allowlist.py
@@ -111,15 +111,15 @@
   paths = ar.ExpandThinArchives(paths)
 
   resource_ids = set()
-  prefix = 'AllowlistedResource<'
+  prefix = b'AllowlistedResource<'
   for p in paths:
-    with open(p) as f:
+    with open(p, 'rb') as f:
       data = f.read()
     start_idx = 0
     while start_idx != -1:
       start_idx = data.find(prefix, start_idx)
       if start_idx != -1:
-        end_idx = data.find('>', start_idx)
+        end_idx = data.find(b'>', start_idx)
         resource_ids.add(int(data[start_idx + len(prefix):end_idx]))
         start_idx = end_idx
   return resource_ids
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc
index 3bf6414..386174c 100644
--- a/ui/display/manager/display_manager.cc
+++ b/ui/display/manager/display_manager.cc
@@ -1571,7 +1571,7 @@
   if (Display::IsInternalDisplayId(display_id)) {
     on_display_zoom_modify_timeout_.Cancel();
     on_display_zoom_modify_timeout_.Reset(
-        base::BindRepeating(&OnInternalDisplayZoomChanged, zoom_factor));
+        base::BindOnce(&OnInternalDisplayZoomChanged, zoom_factor));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, on_display_zoom_modify_timeout_.callback(),
         base::TimeDelta::FromSeconds(kDisplayZoomModifyTimeoutSec));
diff --git a/ui/display/manager/display_manager.h b/ui/display/manager/display_manager.h
index f097b76..585980f 100644
--- a/ui/display/manager/display_manager.h
+++ b/ui/display/manager/display_manager.h
@@ -700,7 +700,7 @@
   // to record UMA metrics for changes to the display zoom that are temporary.
   // Temporary changes may include things like the user trying out different
   // zoom levels before making the final decision.
-  base::CancelableCallback<void()> on_display_zoom_modify_timeout_;
+  base::CancelableOnceClosure on_display_zoom_modify_timeout_;
 #endif
 
   base::WeakPtrFactory<DisplayManager> weak_ptr_factory_{this};
diff --git a/ui/file_manager/integration_tests/file_manager/files_tooltip.js b/ui/file_manager/integration_tests/file_manager/files_tooltip.js
index b66b374e..06a6923 100644
--- a/ui/file_manager/integration_tests/file_manager/files_tooltip.js
+++ b/ui/file_manager/integration_tests/file_manager/files_tooltip.js
@@ -15,6 +15,33 @@
   const cancelButton = '#cancel-selection-button[has-tooltip]';
 
   /**
+   * $i18n{} labels used when template replacement is disabled.
+   */
+  const i18nLabels = {
+    'SEARCH_TEXT_LABEL': 'Search',
+    'READONLY_INDICATOR_TOOLTIP':
+        'The contents of this folder are read-only. ' +
+        'Some activities are not supported.',
+    'CANCEL_SELECTION_BUTTON_LABEL': 'Cancel selection',
+  };
+
+  /**
+   * Returns $i18n{} label if devtools code coverage is active, otherwise the
+   * replaced contents.
+   *
+   * @param {string} key $i18n{} key of replacement text
+   */
+  async function getExpectedLabelText(key) {
+    const isDevtoolsCoverageActive =
+        await sendTestMessage({name: 'isDevtoolsCoverageActive'});
+    if (isDevtoolsCoverageActive === 'true') {
+      return '$i18n{' + key + '}';
+    }
+
+    return i18nLabels[key];
+  }
+
+  /**
    * Tests that tooltip is displayed when focusing an element with tooltip.
    */
   testcase.filesTooltipFocus = async () => {
@@ -27,10 +54,11 @@
         await remoteCall.callRemoteTestUtil('focus', appId, [searchButton]));
 
     // The tooltip should be visible.
+    let expectedLabelText = await getExpectedLabelText('SEARCH_TEXT_LABEL');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     let label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq('Search', label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
 
     // Focus another button with tooltip.
     chrome.test.assertTrue(
@@ -58,10 +86,12 @@
         await remoteCall.callRemoteTestUtil('focus', appId, [cancelButton]));
 
     // The tooltip should be visible.
+    expectedLabelText =
+        await getExpectedLabelText('CANCEL_SELECTION_BUTTON_LABEL');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq('Cancel selection', label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
   };
 
   /**
@@ -77,10 +107,11 @@
         'fakeMouseOver', appId, [searchButton]));
 
     // The tooltip should be visible.
+    let expectedLabelText = await getExpectedLabelText('SEARCH_TEXT_LABEL');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     let label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq('Search', label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
 
     // Hover another button with tooltip.
     chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
@@ -101,13 +132,12 @@
         'fakeMouseOver', appId, [readonlyIndicator]));
 
     // The tooltip should be visible.
+    expectedLabelText =
+        await getExpectedLabelText('READONLY_INDICATOR_TOOLTIP');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq(
-        'The contents of this folder are read-only.' +
-        ' Some activities are not supported.',
-        label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
     chrome.test.assertEq('card-tooltip', tooltip.attributes['class']);
     chrome.test.assertEq('card-label', label.attributes['class']);
 
@@ -124,10 +154,11 @@
         'fakeMouseOver', appId, [searchButton]));
 
     // The tooltip should be visible.
+    expectedLabelText = await getExpectedLabelText('SEARCH_TEXT_LABEL');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq('Search', label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
 
     // Tooltip class should be cleared as ordinary tooltip shown.
     chrome.test.assertEq('', label.attributes['class']);
@@ -147,10 +178,11 @@
         'fakeMouseOver', appId, [searchButton]));
 
     // The tooltip should be visible.
+    const expectedLabelText = await getExpectedLabelText('SEARCH_TEXT_LABEL');
     tooltip = await remoteCall.waitForElement(appId, tooltipQueryVisible);
     const label =
         await remoteCall.waitForElement(appId, [tooltipQueryVisible, '#label']);
-    chrome.test.assertEq('Search', label.text);
+    chrome.test.assertEq(expectedLabelText, label.text);
 
     // Hover an element with tooltip.
     chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 588d4f5..ba38d82 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -10,6 +10,7 @@
 #include <stdint.h>
 
 #include "base/command_line.h"
+#include "base/feature_list.h"
 #include "base/logging.h"
 #include "base/mac/mac_util.h"
 #include "base/mac/mach_logging.h"
@@ -24,6 +25,9 @@
 
 namespace {
 
+const base::Feature kIOSurfaceUseNamedSRGBForREC709{
+    "IOSurfaceUseNamedSRGBForREC709", base::FEATURE_ENABLED_BY_DEFAULT};
+
 void AddIntegerValue(CFMutableDictionaryRef dictionary,
                      const CFStringRef key,
                      int32_t value) {
@@ -135,7 +139,8 @@
   CFStringRef color_space_name = nullptr;
   if (__builtin_available(macos 10.12, *)) {
     if (color_space == ColorSpace::CreateSRGB() ||
-        color_space == ColorSpace::CreateREC709()) {
+        (base::FeatureList::IsEnabled(kIOSurfaceUseNamedSRGBForREC709) &&
+         color_space == ColorSpace::CreateREC709())) {
       color_space_name = kCGColorSpaceSRGB;
     } else if (color_space == ColorSpace::CreateDisplayP3D65()) {
       color_space_name = kCGColorSpaceDisplayP3;
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index 035a923..c793d62 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -270,7 +270,7 @@
     // If opening the connection failed there is nothing we can do. Crash here
     // instead of crashing later. If you are crashing here, make sure there is
     // an X server running and $DISPLAY is set.
-    CHECK(x11::Connection::Get()) << "Missing X server or $DISPLAY";
+    CHECK(x11::Connection::Get()->Ready()) << "Missing X server or $DISPLAY";
 
     common_initialized_ = true;
   }
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/payments/WebLayerPaymentRequestService.java b/weblayer/browser/java/org/chromium/weblayer_private/payments/WebLayerPaymentRequestService.java
index 583c310..4e01adbd 100644
--- a/weblayer/browser/java/org/chromium/weblayer_private/payments/WebLayerPaymentRequestService.java
+++ b/weblayer/browser/java/org/chromium/weblayer_private/payments/WebLayerPaymentRequestService.java
@@ -4,16 +4,37 @@
 
 package org.chromium.weblayer_private.payments;
 
+import androidx.annotation.Nullable;
+
 import org.chromium.components.payments.BrowserPaymentRequest;
+import org.chromium.components.payments.Event;
+import org.chromium.components.payments.JourneyLogger;
+import org.chromium.components.payments.PaymentApp;
 import org.chromium.components.payments.PaymentAppFactoryDelegate;
 import org.chromium.components.payments.PaymentAppService;
 import org.chromium.components.payments.PaymentRequestService;
 import org.chromium.components.payments.PaymentRequestService.Delegate;
+import org.chromium.components.payments.PaymentRequestSpec;
+import org.chromium.components.payments.PaymentResponseHelper;
+import org.chromium.components.payments.PaymentResponseHelperInterface;
 import org.chromium.payments.mojom.PaymentDetails;
+import org.chromium.payments.mojom.PaymentItem;
+import org.chromium.payments.mojom.PaymentOptions;
 import org.chromium.payments.mojom.PaymentValidationErrors;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /** The WebLayer-specific part of the payment request service. */
 public class WebLayerPaymentRequestService implements BrowserPaymentRequest {
+    private final List<PaymentApp> mAvailableApps = new ArrayList<>();
+    private final JourneyLogger mJourneyLogger;
+    private PaymentRequestService mPaymentRequestService;
+    private PaymentRequestSpec mSpec;
+    private boolean mHasClosed;
+    private boolean mShouldSkipShowingPaymentRequestUi;
+    private PaymentApp mSelectedApp;
+
     /**
      * Create an instance of {@link WebLayerPaymentRequestService}.
      * @param paymentRequestService The payment request service.
@@ -21,6 +42,8 @@
      */
     public WebLayerPaymentRequestService(
             PaymentRequestService paymentRequestService, Delegate delegate) {
+        mPaymentRequestService = paymentRequestService;
+        mJourneyLogger = mPaymentRequestService.getJourneyLogger();
     }
 
     // Implements BrowserPaymentRequest:
@@ -37,6 +60,7 @@
     // Implements BrowserPaymentRequest:
     @Override
     public void complete(int result, Runnable onCompleteHandled) {
+        onCompleteHandled.run();
     }
 
     // Implements BrowserPaymentRequest:
@@ -46,6 +70,34 @@
     // Implements BrowserPaymentRequest:
     @Override
     public void close() {
+        if (mHasClosed) return;
+        mHasClosed = true;
+
+        if (mPaymentRequestService != null) {
+            mPaymentRequestService.close();
+            mPaymentRequestService = null;
+        }
+    }
+
+    // Implements BrowserPaymentRequest:
+    @Override
+    public boolean hasAvailableApps() {
+        return !mAvailableApps.isEmpty();
+    }
+
+    // Implements BrowserPaymentRequest:
+    @Override
+    public void notifyPaymentUiOfPendingApps(List<PaymentApp> pendingApps) {
+        assert mAvailableApps.isEmpty()
+            : "notifyPaymentUiOfPendingApps() should be called at most once.";
+        mAvailableApps.addAll(pendingApps);
+        mSelectedApp = mAvailableApps.size() == 0 ? null : mAvailableApps.get(0);
+    }
+
+    // Implements BrowserPaymentRequest:
+    @Override
+    public void onSpecValidated(PaymentRequestSpec spec) {
+        mSpec = spec;
     }
 
     // Implements BrowserPaymentRequest:
@@ -54,4 +106,45 @@
             PaymentAppService service, PaymentAppFactoryDelegate delegate) {
         // WebLayer only adds the GPay factory, but not using this method.
     }
+
+    // Implements BrowserPaymentRequest:
+    @Override
+    @Nullable
+    public String showAppSelector(boolean isShowWaitingForUpdatedDetails, PaymentItem total,
+            PaymentOptions paymentOptions, boolean isUserGestureShow) {
+        assert mAvailableApps.size() <= 1 : "Only GooglePay payment app is supported.";
+        mShouldSkipShowingPaymentRequestUi =
+                PaymentRequestService.shouldSkipShowingPaymentRequestUi(isUserGestureShow,
+                        /*skipUiForNonUrlPaymentMethodIdentifiers=*/false,
+                        mSpec.getPaymentOptions(), mSpec.getMethodData().keySet(), mSelectedApp,
+                        mAvailableApps);
+        if (!mShouldSkipShowingPaymentRequestUi) {
+            return "This request is not supported in Web Layer. Please try in Chrome, or make sure "
+                    + "that: (1) show() is triggered by user gesture, or"
+                    + "(2) do not request any contact information.";
+        }
+        return null;
+    }
+
+    // Implements BrowserPaymentRequest:
+    @Override
+    @Nullable
+    public String triggerPaymentAppUiSkipIfApplicable(boolean isUserGestureShow) {
+        assert !mAvailableApps.isEmpty()
+            : "triggerPaymentAppUiSkipIfApplicable() should be called only when there is any "
+                + "available app.";
+        PaymentApp selectedPaymentApp = mAvailableApps.get(0);
+        if (mShouldSkipShowingPaymentRequestUi) {
+            mJourneyLogger.setEventOccurred(Event.SKIPPED_SHOW);
+            assert mSpec.getRawTotal() != null;
+            // The total amount in details should be finalized at this point. So it is safe to
+            // record the triggered transaction amount.
+            mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
+                    mSpec.getRawTotal().amount.value, false /*completed*/);
+            PaymentResponseHelperInterface paymentResponseHelper = new PaymentResponseHelper(
+                    selectedPaymentApp.handlesShippingAddress(), mSpec.getPaymentOptions());
+            mPaymentRequestService.invokePaymentApp(selectedPaymentApp, paymentResponseHelper);
+        }
+        return null;
+    }
 }