LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)
The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_ash with some special cases (For those cases please
refer to http://go/lacros-macros).
The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.
Bug: 1052397
Change-Id: I342e1ca6cef8b69bafae5de2d4b446a1eacd6f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2564980
Commit-Queue: Yuta Hijikata <[email protected]>
Reviewed-by: Dirk Pranke <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#834552}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index b98362f..40b4701 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -105,6 +105,7 @@
]
deps = [
"//base",
+ "//build:chromeos_buildflags",
"//chrome/common:buildflags",
"//media:media_buildflags",
]
@@ -2361,7 +2362,7 @@
"//ui/webui",
"//ui/webui/resources/cr_components/customize_themes:mojom",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [
"apps/digital_goods/digital_goods_factory_impl.cc",
"apps/digital_goods/digital_goods_factory_impl.h",
@@ -2451,7 +2452,7 @@
# Platforms that have a network diagnostics dialog. All others fall through
# to the stub which is not implemented.
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [ "net/net_error_diagnostics_dialog_chromeos.cc" ]
} else if (is_win) {
sources += [ "net/net_error_diagnostics_dialog_win.cc" ]
@@ -4159,7 +4160,7 @@
"//courgette:courgette_lib",
"//third_party/sqlite",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [
"sharing/webrtc/ice_config_fetcher.cc",
"sharing/webrtc/ice_config_fetcher.h",
@@ -4195,14 +4196,13 @@
"task_manager/sampling/shared_sampler_posix.cc",
]
- # TODO(crbug.com / 1052397): Rename chromeos_is_browser_only to is_lacros.
- if (!chromeos_is_browser_only) {
+ if (!is_chromeos_lacros) {
sources += [ "first_run/first_run_internal_posix.cc" ]
}
}
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
assert(enable_native_notifications)
sources += [
"apps/app_service/arc_activity_adaptive_icon_impl.cc",
@@ -4547,21 +4547,21 @@
]
}
- if (is_chromeos || enable_extensions || is_android) {
+ if (is_chromeos_ash || enable_extensions || is_android) {
sources += [
"metrics/cached_metrics_profile.cc",
"metrics/cached_metrics_profile.h",
]
}
- if (is_chromeos || chromeos_is_browser_only) {
+ if (is_chromeos_ash || is_chromeos_lacros) {
sources += [
"feedback/system_logs/log_sources/user_log_files_log_source.cc",
"feedback/system_logs/log_sources/user_log_files_log_source.h",
]
}
- if (is_lacros) {
+ if (is_chromeos_lacros) {
assert(enable_native_notifications)
sources += [
"chrome_browser_main_parts_lacros.cc",
@@ -5013,7 +5013,7 @@
}
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
if (use_allocator == "tcmalloc") {
deps += [ "//chrome/common/performance_manager/mojom" ]
@@ -5024,7 +5024,7 @@
}
}
- if (is_linux) {
+ if (is_linux || is_chromeos_lacros) {
# Desktop linux, doesn't count ChromeOS.
sources += [
"download/download_status_updater_linux.cc",
@@ -5045,7 +5045,7 @@
deps += [ "//components/dbus/thread_linux" ]
}
- if (!is_lacros) {
+ if (!is_chromeos_lacros) {
sources += [ "platform_util_linux.cc" ]
if (enable_native_notifications) {
@@ -5106,14 +5106,14 @@
]
}
- if (is_win || is_chromeos) {
+ if (is_win || is_chromeos_ash) {
sources += [
"webshare/share_service_impl.cc",
"webshare/share_service_impl.h",
]
}
- if (is_win || is_mac || is_linux) {
+ if (is_win || is_mac || (is_linux || is_chromeos_lacros)) {
sources += [
"browser_switcher/alternative_browser_driver.h",
"browser_switcher/browser_switcher_navigation_throttle.cc",
@@ -5132,12 +5132,12 @@
if (is_win) {
sources += [ "browser_switcher/alternative_browser_driver_win.cc" ]
}
- if (is_mac || is_linux) {
+ if (is_mac || (is_linux || is_chromeos_lacros)) {
sources += [ "browser_switcher/alternative_browser_driver_posix.cc" ]
}
}
- if (is_chromeos && use_cras) {
+ if (is_chromeos_ash && use_cras) {
defines += [ "USE_CRAS" ]
}
@@ -5158,7 +5158,7 @@
]
}
- if (!is_android && !is_chromeos) {
+ if (!is_android && !is_chromeos_ash) {
sources += [
"device_identity/device_oauth2_token_store_desktop.cc",
"device_identity/device_oauth2_token_store_desktop.h",
@@ -5225,7 +5225,7 @@
"upgrade_detector/upgrade_detector_impl.cc",
"upgrade_detector/upgrade_detector_impl.h",
]
- } else { # is_android || is_chromeos
+ } else { # is_android || is_chromeos_ash
sources += [
"installable/digital_asset_links/digital_asset_links_handler.cc",
"installable/digital_asset_links/digital_asset_links_handler.h",
@@ -5278,7 +5278,7 @@
]
}
- if (is_win || is_mac || (is_chromeos && use_dbus)) {
+ if (is_win || is_mac || (is_chromeos_ash && use_dbus)) {
sources += [
"media_galleries/fileapi/device_media_async_file_util.cc",
"media_galleries/fileapi/device_media_async_file_util.h",
@@ -5289,7 +5289,7 @@
"media_galleries/fileapi/mtp_file_stream_reader.cc",
"media_galleries/fileapi/mtp_file_stream_reader.h",
]
- if (is_chromeos && use_dbus) {
+ if (is_chromeos_ash && use_dbus) {
# TODO([email protected]): push this into chrome / browser / chromeos
# and chrome / browser / media_galleries / chromeos
deps += [ "//services/device/public/mojom" ]
@@ -5344,10 +5344,10 @@
if (is_mac) {
sources += [ "background/background_mode_manager_mac.mm" ]
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [ "background/background_mode_manager_chromeos.cc" ]
}
- if (use_aura && !is_win && !is_chromeos) {
+ if (use_aura && !is_win && !is_chromeos_ash) {
sources += [ "background/background_mode_manager_aura.cc" ]
}
}
@@ -5448,7 +5448,7 @@
]
}
- if (!is_chromeos) {
+ if (!is_chromeos_ash) {
sources += [
"printing/cloud_print/cloud_print_proxy_service.cc",
"printing/cloud_print/cloud_print_proxy_service.h",
@@ -5742,7 +5742,7 @@
"//google_apis/drive",
"//services/device/public/mojom",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [
"speech/extension_api/tts_engine_extension_observer_chromeos.cc",
"speech/extension_api/tts_engine_extension_observer_chromeos.h",
@@ -6024,7 +6024,7 @@
"//services/device/public/mojom",
"//third_party/adobe/flash:flapper_version_h",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
deps += [ "//chromeos/cryptohome" ]
}
}
@@ -6295,7 +6295,7 @@
if (use_cups) {
configs += [ "//printing:cups" ]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
deps += [
"//chrome/services/cups_proxy",
"//chrome/services/cups_proxy/public/mojom",
@@ -6310,10 +6310,10 @@
"net/nss_context.cc",
"net/nss_context.h",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [ "net/nss_context_chromeos.cc" ]
}
- if (is_linux) {
+ if (is_linux || is_chromeos_lacros) {
sources += [ "net/nss_context_linux.cc" ]
}
}
@@ -6450,10 +6450,10 @@
if (enable_plugins) {
#.json is not in the default sources_assignment_filter.
- if (is_chromeos) {
+ if (is_chromeos_ash) {
inputs = [ "resources/plugin_metadata/plugins_chromeos.json" ]
}
- if (is_linux && !is_chromeos) {
+ if (is_linux || is_chromeos_lacros) {
inputs = [ "resources/plugin_metadata/plugins_linux.json" ]
}
if (is_mac) {
@@ -6480,7 +6480,7 @@
deps +=
[ "//chrome/browser/ui/webui/explore_sites_internals:mojo_bindings_js" ]
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
deps += [
"//chrome/browser/resources/chromeos/account_manager:web_components",
"//chrome/browser/resources/chromeos/account_manager/components:web_components",
@@ -6504,7 +6504,7 @@
]
}
- if (is_chromeos && optimize_webui) {
+ if (is_chromeos_ash && optimize_webui) {
deps += [
"//chrome/browser/resources/chromeos/internet_config_dialog:build",
"//chrome/browser/resources/chromeos/internet_detail_dialog:build",
@@ -6748,7 +6748,7 @@
]
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [
"chromeos/app_mode/fake_cws.cc",
"chromeos/app_mode/fake_cws.h",
@@ -6854,7 +6854,7 @@
"//google_apis:test_support",
"//services/data_decoder/public/cpp:test_support",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
deps += [ "//chrome/browser/chromeos" ]
}
}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index e20dcbf..de6525d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -204,7 +204,7 @@
#include "chrome/browser/web_applications/components/external_app_install_features.h"
#endif // OS_ANDROID
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/ash_switches.h"
#include "chrome/browser/chromeos/crosapi/browser_util.h"
#include "chrome/browser/nearby_sharing/common/nearby_share_features.h"
@@ -215,7 +215,7 @@
#include "media/capture/video/chromeos/video_capture_features_chromeos.h"
#include "third_party/cros_system_api/switches/chrome_switches.h"
#include "ui/events/ozone/features.h"
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC)
#include "chrome/browser/ui/browser_dialogs.h"
@@ -470,7 +470,7 @@
nullptr}};
#endif // OS_ANDROID
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::FeatureParam kForceDark_SimpleHsl[] = {
{"inversion_method", "hsl_based"},
{"image_behavior", "none"},
@@ -685,7 +685,7 @@
{flags_ui::kGenericExperimentChoiceEnabled, switches::kTopChromeTouchUi,
switches::kTopChromeTouchUiEnabled}};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kLacrosSupportInternalName[] = "lacros-support";
const char kLacrosStabilityInternalName[] = "lacros-stability";
@@ -713,9 +713,9 @@
{flag_descriptions::kUiShowCompositedLayerBordersAll,
cc::switches::kUIShowCompositedLayerBorders, ""}};
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::Choice kCrosRegionsModeChoices[] = {
{flag_descriptions::kCrosRegionsModeDefault, "", ""},
{flag_descriptions::kCrosRegionsModeOverride,
@@ -725,7 +725,7 @@
chromeos::switches::kCrosRegionsMode,
chromeos::switches::kCrosRegionsModeHide},
};
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::Choice kForceUIDirectionChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
@@ -743,7 +743,7 @@
switches::kForceDirectionRTL},
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::Choice kSchedulerConfigurationChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
{flag_descriptions::kSchedulerConfigurationConservative,
@@ -753,7 +753,7 @@
switches::kSchedulerConfiguration,
switches::kSchedulerConfigurationPerformance},
};
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
const FeatureEntry::FeatureParam kCompactSuggestions_SemicompactVariant[] = {
@@ -2267,7 +2267,7 @@
base::size(kAlignFontDisplayAutoTimeoutWithLCPGoalSwap1000), nullptr},
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::Choice kEnableCrOSActionRecorderChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
{ash::switches::kCrOSActionRecorderWithHash,
@@ -2286,7 +2286,7 @@
ash::switches::kEnableCrOSActionRecorder,
ash::switches::kCrOSActionRecorderStructuredDisabled},
};
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
const FeatureEntry::Choice kWebOtpBackendChoices[] = {
@@ -2325,7 +2325,7 @@
switches::kEnableExperimentalCookieFeatures, ""},
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::Choice kFrameThrottleFpsChoices[] = {
{flag_descriptions::kFrameThrottleFpsDefault, "", ""},
{flag_descriptions::kFrameThrottleFps5, ash::switches::kFrameThrottleFps,
@@ -2340,7 +2340,7 @@
"25"},
{flag_descriptions::kFrameThrottleFps30, ash::switches::kFrameThrottleFps,
"30"}};
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
// The variations of --password-change-in-settings.
@@ -2373,11 +2373,11 @@
nullptr}};
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kAssistantBetterOnboardingInternalName[] =
"enable-assistant-better-onboarding";
constexpr char kAssistantTimersV2InternalName[] = "enable-assistant-timers-v2";
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !defined(OS_WIN) && !defined(OS_FUCHSIA)
const FeatureEntry::FeatureParam
@@ -2468,12 +2468,12 @@
kSubresourceRedirectLoginRobotsBasedCompression,
base::size(kSubresourceRedirectLoginRobotsBasedCompression), nullptr}};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const FeatureEntry::FeatureVariation
kOmniboxRichEntitiesInLauncherVariations[] = {
{"with linked Suggest experiment", {}, 0, "t4461027"},
};
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// RECORDING USER METRICS FOR FLAGS:
// -----------------------------------------------------------------------------
@@ -2501,6 +2501,7 @@
const FeatureEntry kFeatureEntries[] = {
// Include generated flags for flag unexpiry; see //docs/flag_expiry.md and
// //tools/flags/generate_unexpire_flags.py.
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/unexpire_flags_gen.inc"
{"ignore-gpu-blocklist", flag_descriptions::kIgnoreGpuBlocklistName,
flag_descriptions::kIgnoreGpuBlocklistDescription, kOsAll,
@@ -2756,7 +2757,7 @@
flag_descriptions::kWebUITabStripDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kWebUITabStrip)},
#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
-#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
{
"webui-tab-strip-tab-drag-integration",
flag_descriptions::kWebUITabStripTabDragIntegrationName,
@@ -2764,11 +2765,11 @@
kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kWebUITabStripTabDragIntegration),
},
-#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
{"focus-mode", flag_descriptions::kFocusMode,
flag_descriptions::kFocusModeDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kFocusMode)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"disable-explicit-dma-fences",
flag_descriptions::kDisableExplicitDmaFencesName,
flag_descriptions::kDisableExplicitDmaFencesDescription, kOsCrOS,
@@ -2779,8 +2780,8 @@
flag_descriptions::kUseHDRTransferFunctionName,
flag_descriptions::kUseHDRTransferFunctionDescription, kOsCrOS,
FEATURE_VALUE_TYPE(display::features::kUseHDRTransferFunction)},
-#endif // OS_CHROMEOS
-#if defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"account-management-flows-v2",
flag_descriptions::kAccountManagementFlowsV2Name,
flag_descriptions::kAccountManagementFlowsV2Description, kOsCrOS,
@@ -2926,9 +2927,9 @@
{"system-tray-mic-gain", flag_descriptions::kSystemTrayMicGainName,
flag_descriptions::kSystemTrayMicGainDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kSystemTrayMicGainSetting)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && !defined(OS_ANDROID)
{
"enable-accelerated-video-decode",
flag_descriptions::kAcceleratedVideoDecodeName,
@@ -2944,7 +2945,8 @@
kOsMac | kOsWin | kOsCrOS | kOsAndroid,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
},
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#endif // (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) &&
+ // !defined(OS_ANDROID)
{
"disable-accelerated-video-encode",
flag_descriptions::kAcceleratedVideoEncodeName,
@@ -2959,7 +2961,7 @@
kOsAll,
FEATURE_VALUE_TYPE(media::kEnableMediaInternals),
},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{
"zero-copy-video-capture",
flag_descriptions::kZeroCopyVideoCaptureName,
@@ -2985,7 +2987,7 @@
flag_descriptions::kUiShowCompositedLayerBordersName,
flag_descriptions::kUiShowCompositedLayerBordersDescription, kOsCrOS,
MULTI_VALUE_TYPE(kUiShowCompositedLayerBordersChoices)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"debug-packed-apps", flag_descriptions::kDebugPackedAppName,
flag_descriptions::kDebugPackedAppDescription, kOsDesktop,
SINGLE_VALUE_TYPE(switches::kDebugPackedApps)},
@@ -3042,7 +3044,7 @@
flag_descriptions::kSuggestionsWithSubStringMatchName,
flag_descriptions::kSuggestionsWithSubStringMatchDescription, kOsAll,
FEATURE_VALUE_TYPE(autofill::features::kAutofillTokenPrefixMatching)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName,
flag_descriptions::kVirtualKeyboardDescription, kOsCrOS,
SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)},
@@ -3050,7 +3052,7 @@
flag_descriptions::kVirtualKeyboardDisabledName,
flag_descriptions::kVirtualKeyboardDisabledDescription, kOsCrOS,
SINGLE_VALUE_TYPE(keyboard::switches::kDisableVirtualKeyboard)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
{"device-discovery-notifications",
flag_descriptions::kDeviceDiscoveryNotificationsName,
@@ -3113,7 +3115,7 @@
kOverrideSitePrefsForHrefTranslateVariations,
"OverrideSitePrefsForHrefTranslate")},
-#if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) && !BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-native-notifications",
flag_descriptions::kNotificationsNativeFlagName,
flag_descriptions::kNotificationsNativeFlagDescription,
@@ -3180,13 +3182,13 @@
flag_descriptions::kExtensionContentVerificationName,
flag_descriptions::kExtensionContentVerificationDescription, kOsDesktop,
MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-lock-screen-notification",
flag_descriptions::kLockScreenNotificationName,
flag_descriptions::kLockScreenNotificationDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kLockScreenNotifications)},
-#endif // OS_CHROMEOS
-#if defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"crostini-use-dlc", flag_descriptions::kCrostiniUseDlcName,
flag_descriptions::kCrostiniUseDlcDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCrostiniUseDlc)},
@@ -3220,7 +3222,7 @@
flag_descriptions::kDynamicTcmallocDescription, kOsCrOS,
FEATURE_VALUE_TYPE(performance_manager::features::kDynamicTcmallocTuning)},
#endif // BUILDFLAG(USE_TCMALLOC)
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"enable-site-isolation-for-password-sites",
flag_descriptions::kSiteIsolationForPasswordSitesName,
@@ -3290,7 +3292,7 @@
flag_descriptions::kEnableNavigationPredictorRendererWarmupName,
flag_descriptions::kEnableNavigationPredictorRendererWarmupDescription,
kOsAll, FEATURE_VALUE_TYPE(features::kNavigationPredictorRendererWarmup)},
-#endif // OS_CHROMEOS || OS_LINUX
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || OS_LINUX
{"enable-preconnect-to-search",
flag_descriptions::kEnablePreconnectToSearchName,
flag_descriptions::kEnablePreconnectToSearchDescription, kOsAll,
@@ -3421,11 +3423,11 @@
flag_descriptions::kMacV2GPUSandboxDescription, kOsMac,
FEATURE_VALUE_TYPE(features::kMacV2GPUSandbox)},
#endif // OS_MAC
-#if defined(OS_CHROMEOS) || defined(OS_WIN)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN)
{"web-share", flag_descriptions::kWebShareName,
flag_descriptions::kWebShareDescription, kOsWin | kOsCrOS,
FEATURE_VALUE_TYPE(features::kWebShare)},
-#endif // OS_CHROMEOS || OS_WIN
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || OS_WIN
#if BUILDFLAG(ENABLE_VR)
{"webxr-incubations", flag_descriptions::kWebXrIncubationsName,
flag_descriptions::kWebXrIncubationsDescription, kOsAll,
@@ -3437,12 +3439,12 @@
flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop,
MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)},
#endif // ENABLE_VR
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"disable-accelerated-mjpeg-decode",
flag_descriptions::kAcceleratedMjpegDecodeName,
flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName,
flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)},
@@ -3575,11 +3577,11 @@
flag_descriptions::kUseWinrtMidiApiDescription, kOsWin,
FEATURE_VALUE_TYPE(midi::features::kMidiManagerWinrt)},
#endif // OS_WIN
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"cros-regions-mode", flag_descriptions::kCrosRegionsModeName,
flag_descriptions::kCrosRegionsModeDescription, kOsCrOS,
MULTI_VALUE_TYPE(kCrosRegionsModeChoices)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
{"enable-autofill-credit-card-upload",
flag_descriptions::kAutofillCreditCardUploadName,
@@ -3668,7 +3670,7 @@
FEATURE_VALUE_TYPE(password_manager::features::kPasswordImport)},
{"enable-force-dark", flag_descriptions::kForceWebContentsDarkModeName,
flag_descriptions::kForceWebContentsDarkModeDescription, kOsAll,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(https://crbug.com/1011696): Investigate crash reports and
// re-enable variations for ChromeOS.
FEATURE_VALUE_TYPE(blink::features::kForceWebContentsDarkMode)},
@@ -3676,7 +3678,7 @@
FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kForceWebContentsDarkMode,
kForceDarkVariations,
"ForceDarkVariations")},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"enable-android-dark-search", flag_descriptions::kAndroidDarkSearchName,
flag_descriptions::kAndroidDarkSearchDescription, kOsAndroid,
@@ -3710,7 +3712,7 @@
flag_descriptions::kAriaElementReflectionName,
flag_descriptions::kAriaElementReflectionDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kEnableAriaElementReflection)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-encryption-migration",
flag_descriptions::kEnableEncryptionMigrationName,
flag_descriptions::kEnableEncryptionMigrationDescription, kOsCrOS,
@@ -3793,7 +3795,7 @@
flag_descriptions::kMagnifierNewFocusFollowingName,
flag_descriptions::kMagnifierNewFocusFollowingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kMagnifierNewFocusFollowing)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC)
{"enable-immersive-fullscreen-toolbar",
flag_descriptions::kImmersiveFullscreenName,
@@ -3831,7 +3833,7 @@
{"fill-on-account-select", flag_descriptions::kFillOnAccountSelectName,
flag_descriptions::kFillOnAccountSelectDescription, kOsAll,
FEATURE_VALUE_TYPE(password_manager::features::kFillOnAccountSelect)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"arc-custom-tabs-experiment",
flag_descriptions::kArcCustomTabsExperimentName,
flag_descriptions::kArcCustomTabsExperimentDescription, kOsCrOS,
@@ -3858,7 +3860,7 @@
{"arc-usb-host", flag_descriptions::kArcUsbHostName,
flag_descriptions::kArcUsbHostDescription, kOsCrOS,
FEATURE_VALUE_TYPE(arc::kUsbHostFeature)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
{"enable-winrt-sensor-implementation",
flag_descriptions::kWinrtSensorsImplementationName,
@@ -3874,12 +3876,12 @@
flag_descriptions::kExpensiveBackgroundTimerThrottlingDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{ui_devtools::switches::kEnableUiDevTools,
flag_descriptions::kUiDevToolsName,
flag_descriptions::kUiDevToolsDescription, kOsCrOS,
SINGLE_VALUE_TYPE(ui_devtools::switches::kEnableUiDevTools)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-autofill-credit-card-ablation-experiment",
flag_descriptions::kEnableAutofillCreditCardAblationExperimentDisplayName,
@@ -3900,13 +3902,13 @@
FEATURE_VALUE_TYPE(autofill::features::kAutofillRefreshStyleAndroid)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-touchscreen-calibration",
flag_descriptions::kTouchscreenCalibrationName,
flag_descriptions::kTouchscreenCalibrationDescription, kOsCrOS,
SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchCalibrationSetting)},
-#endif // defined(OS_CHROMEOS)
-#if defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"camera-system-web-app", flag_descriptions::kCameraSystemWebAppName,
flag_descriptions::kCameraSystemWebAppDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCameraSystemWebApp)},
@@ -3980,7 +3982,7 @@
{"spectre-v2-mitigation", flag_descriptions::kSpectreVariant2MitigationName,
flag_descriptions::kSpectreVariant2MitigationDescription, kOsCrOS,
FEATURE_VALUE_TYPE(sandbox::policy::features::kSpectreVariant2Mitigation)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
{"gdi-text-printing", flag_descriptions::kGdiTextPrinting,
@@ -4172,11 +4174,11 @@
kOsAll,
FEATURE_VALUE_TYPE(omnibox::kSpeculativeServiceWorkerStartOnQueryInput)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"scheduler-configuration", flag_descriptions::kSchedulerConfigurationName,
flag_descriptions::kSchedulerConfigurationDescription, kOsCrOS,
MULTI_VALUE_TYPE(kSchedulerConfigurationChoices)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"enable-command-line-on-non-rooted-devices",
@@ -4316,7 +4318,7 @@
flag_descriptions::kEnableSearchPrefetchDescription, kOsAll,
SINGLE_VALUE_TYPE(kSearchPrefetchServiceCommandLineFlag)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"handwriting-gesture", flag_descriptions::kHandwritingGestureName,
flag_descriptions::kHandwritingGestureDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kHandwritingGesture)},
@@ -4325,7 +4327,7 @@
flag_descriptions::kHandwritingGestureEditingName,
flag_descriptions::kHandwritingGestureEditingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kHandwritingGestureEditing)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"block-insecure-private-network-requests",
flag_descriptions::kBlockInsecurePrivateNetworkRequestsName,
@@ -4393,12 +4395,12 @@
FEATURE_VALUE_TYPE(chrome::android::kOmniboxSpareRenderer)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"double-tap-to-zoom-in-tablet-mode",
flag_descriptions::kDoubleTapToZoomInTabletModeName,
flag_descriptions::kDoubleTapToZoomInTabletModeDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kDoubleTapToZoomInTabletMode)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{flag_descriptions::kReadLaterFlagId, flag_descriptions::kReadLaterName,
flag_descriptions::kReadLaterDescription, kOsDesktop | kOsAndroid,
@@ -4629,7 +4631,7 @@
flag_descriptions::kEnableWebAuthenticationCableV2SupportDescription,
kOsDesktop | kOsAndroid, FEATURE_VALUE_TYPE(device::kWebAuthPhoneSupport)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-web-authentication-chromeos-authenticator",
flag_descriptions::kEnableWebAuthenticationChromeOSAuthenticatorName,
flag_descriptions::
@@ -4860,7 +4862,7 @@
FEATURE_VALUE_TYPE(
lookalikes::features::kDetectTargetEmbeddingLookalikes)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-app-data-search", flag_descriptions::kEnableAppDataSearchName,
flag_descriptions::kEnableAppDataSearchDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kEnableAppDataSearch)},
@@ -4868,7 +4870,7 @@
{"enable-app-grid-ghost", flag_descriptions::kEnableAppGridGhostName,
flag_descriptions::kEnableAppGridGhostDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kEnableAppGridGhost)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !defined(OS_ANDROID)
{"enable-accessibility-live-caption",
@@ -4927,12 +4929,12 @@
FEATURE_VALUE_TYPE(
autofill::features::kAutofillEnableAccountWalletStorage)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-zero-state-app-reinstall-suggestions",
flag_descriptions::kEnableAppReinstallZeroStateName,
flag_descriptions::kEnableAppReinstallZeroStateDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kEnableAppReinstallZeroState)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-resampling-input-events",
flag_descriptions::kEnableResamplingInputEventsName,
@@ -4966,7 +4968,7 @@
kOsAll,
FEATURE_VALUE_TYPE(features::kCompositorThreadedScrollbarScrolling)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-vaapi-jpeg-image-decode-acceleration",
flag_descriptions::kVaapiJpegImageDecodeAccelerationName,
flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS,
@@ -5052,7 +5054,7 @@
kOsMac | kOsWin | kOsLinux,
FEATURE_VALUE_TYPE(features::kDestroyProfileOnBrowserClose)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-usbguard", flag_descriptions::kUsbguardName,
flag_descriptions::kUsbguardDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kUsbguard)},
@@ -5067,7 +5069,7 @@
flag_descriptions::kKerberosSettingsSectionName,
flag_descriptions::kKerberosSettingsSectionDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kKerberosSettingsSection)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
{"use-angle", flag_descriptions::kUseAngleName,
@@ -5084,7 +5086,7 @@
"EphemeralTabOpenMode")},
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-assistant-dsp", flag_descriptions::kEnableGoogleAssistantDspName,
flag_descriptions::kEnableGoogleAssistantDspDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::assistant::features::kEnableDspHotword)},
@@ -5146,7 +5148,7 @@
flag_descriptions::kEnableAssistantTimersV2Name,
flag_descriptions::kEnableAssistantTimersV2Description, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::assistant::features::kAssistantTimersV2)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_CLICK_TO_CALL)
{"click-to-call-ui", flag_descriptions::kClickToCallUIName,
@@ -5202,7 +5204,7 @@
kSharingDeviceExpirationVariations,
"SharingDeviceExpiration")},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"ash-enable-pip-rounded-corners",
flag_descriptions::kAshEnablePipRoundedCornersName,
flag_descriptions::kAshEnablePipRoundedCornersDescription, kOsCrOS,
@@ -5213,7 +5215,7 @@
flag_descriptions::kAshSwapSideVolumeButtonsForOrientationDescription,
kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kSwapSideVolumeButtonsForOrientation)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-implicit-root-scroller",
flag_descriptions::kEnableImplicitRootScrollerName,
flag_descriptions::kEnableImplicitRootScrollerDescription, kOsAll,
@@ -5224,13 +5226,13 @@
flag_descriptions::kEnableTextFragmentAnchorDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kTextFragmentAnchor)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-assistant-stereo-input",
flag_descriptions::kEnableGoogleAssistantStereoInputName,
flag_descriptions::kEnableGoogleAssistantStereoInputDescription, kOsCrOS,
FEATURE_VALUE_TYPE(
chromeos::assistant::features::kEnableStereoAudioInput)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-audio-focus-enforcement",
flag_descriptions::kEnableAudioFocusEnforcementName,
@@ -5252,7 +5254,7 @@
FEATURE_VALUE_TYPE(media::kHardwareMediaKeyHandling)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"app-service-adaptive-icon",
flag_descriptions::kAppServiceAdaptiveIconName,
flag_descriptions::kAppServiceAdaptiveIconDescription, kOsCrOS,
@@ -5285,7 +5287,7 @@
{"intent-handling-sharing", flag_descriptions::kIntentHandlingSharingName,
flag_descriptions::kIntentHandlingSharingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kIntentHandlingSharing)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
{"d3d11-video-decoder", flag_descriptions::kD3D11VideoDecoderName,
@@ -5293,7 +5295,7 @@
FEATURE_VALUE_TYPE(media::kD3D11VideoDecoder)},
#endif
-#if defined(OS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
+#if BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
{"chromeos-direct-video-decoder",
flag_descriptions::kChromeOSDirectVideoDecoderName,
flag_descriptions::kChromeOSDirectVideoDecoderDescription, kOsCrOS,
@@ -5320,12 +5322,12 @@
autofill_assistant::features::kAutofillAssistantProactiveHelp)},
#endif // defined(OS_ANDROID)
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
{"web-contents-occlusion", flag_descriptions::kWebContentsOcclusionName,
flag_descriptions::kWebContentsOcclusionDescription,
kOsWin | kOsMac | kOsCrOS,
FEATURE_VALUE_TYPE(features::kWebContentsOcclusion)},
-#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"mobile-identity-consistency",
@@ -5357,12 +5359,12 @@
FEATURE_VALUE_TYPE(views::kInstallableInkDropFeature)},
#endif // defined(TOOLKIT_VIEWS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-assistant-launcher-integration",
flag_descriptions::kEnableAssistantLauncherIntegrationName,
flag_descriptions::kEnableAssistantLauncherIntegrationDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kEnableAssistantSearch)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(TOOLKIT_VIEWS)
{"enable-md-rounded-corners-on-dialogs",
@@ -5392,7 +5394,7 @@
kOsLinux | kOsWin | kOsAndroid | kOsMac,
FEATURE_VALUE_TYPE(features::kUseSkiaRenderer)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"allow-disable-mouse-acceleration",
flag_descriptions::kAllowDisableMouseAccelerationName,
flag_descriptions::kAllowDisableMouseAccelerationDescription, kOsCrOS,
@@ -5508,7 +5510,7 @@
{"print-server-scaling", flag_descriptions::kPrintServerScalingName,
flag_descriptions::kPrintServerScalingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kPrintServerScaling)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"autofill-off-no-server-data",
flag_descriptions::kAutofillOffNoServerDataName,
@@ -5564,12 +5566,12 @@
FEATURE_VALUE_TYPE(features::kEnterpriseReportingApiKeychainRecreation)},
#endif // defined(OS_MAC)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enterprise-reporting-in-chromeos",
flag_descriptions::kEnterpriseReportingInChromeOSName,
flag_descriptions::kEnterpriseReportingInChromeOSDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kEnterpriseReportingInChromeOS)},
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#if !defined(OS_ANDROID)
{"enterprise-realtime-extension-request",
@@ -5603,12 +5605,12 @@
flag_descriptions::kAutofillPruneSuggestionsDescription, kOsAll,
FEATURE_VALUE_TYPE(autofill::features::kAutofillPruneSuggestions)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-advanced-ppd-attributes",
flag_descriptions::kEnableAdvancedPpdAttributesName,
flag_descriptions::kEnableAdvancedPpdAttributesDescription, kOsCrOS,
FEATURE_VALUE_TYPE(printing::features::kAdvancedPpdAttributes)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"allow-sync-xhr-in-page-dismissal",
flag_descriptions::kAllowSyncXHRInPageDismissalName,
@@ -5636,25 +5638,25 @@
flag_descriptions::kColorPickerEyeDropperDescription, kOsWin | kOsMac,
FEATURE_VALUE_TYPE(features::kEyeDropper)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"auto-screen-brightness", flag_descriptions::kAutoScreenBrightnessName,
flag_descriptions::kAutoScreenBrightnessDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kAutoScreenBrightness)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"audio-worklet-realtime-thread",
flag_descriptions::kAudioWorkletRealtimeThreadName,
flag_descriptions::kAudioWorkletRealtimeThreadDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kAudioWorkletRealtimeThread)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"smart-dim-model-v3", flag_descriptions::kSmartDimModelV3Name,
flag_descriptions::kSmartDimModelV3Description, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kSmartDimModelV3)},
{"smart-dim-new-ml-agent", flag_descriptions::kSmartDimNewMlAgentName,
flag_descriptions::kSmartDimNewMlAgentDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kSmartDimNewMlAgent)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"privacy-reordered-android",
@@ -5718,12 +5720,12 @@
FEATURE_VALUE_TYPE(
safe_browsing::kEnhancedProtectionMessageInInterstitials)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"gesture-properties-dbus-service",
flag_descriptions::kEnableGesturePropertiesDBusServiceName,
flag_descriptions::kEnableGesturePropertiesDBusServiceDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kGesturePropertiesDBusService)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"cookie-deprecation-messages",
flag_descriptions::kCookieDeprecationMessagesName,
@@ -5808,11 +5810,11 @@
flag_descriptions::kSafetyTipDescription, kOsAll,
FEATURE_VALUE_TYPE(security_state::features::kSafetyTipUI)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"crostini-webui-upgrader", flag_descriptions::kCrostiniWebUIUpgraderName,
flag_descriptions::kCrostiniWebUIUpgraderDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCrostiniWebUIUpgrader)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"turn-off-streaming-media-caching-on-battery",
flag_descriptions::kTurnOffStreamingMediaCachingOnBatteryName,
@@ -5841,12 +5843,12 @@
SINGLE_VALUE_TYPE(
previews::switches::kEnableDeferAllScriptWithoutOptimizationHints)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-assistant-routines",
flag_descriptions::kEnableAssistantRoutinesName,
flag_descriptions::kEnableAssistantRoutinesDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::assistant::features::kAssistantRoutines)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"notification-scheduler-debug-options",
flag_descriptions::kNotificationSchedulerDebugOptionName,
@@ -5861,18 +5863,18 @@
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"lock-screen-media-controls",
flag_descriptions::kLockScreenMediaControlsName,
flag_descriptions::kLockScreenMediaControlsDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kLockScreenMediaControls)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"contextual-nudges", flag_descriptions::kContextualNudgesName,
flag_descriptions::kContextualNudgesDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kContextualNudges)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"decode-jpeg-images-to-yuv",
flag_descriptions::kDecodeJpeg420ImagesToYUVName,
@@ -5954,7 +5956,7 @@
chrome::android::kContextMenuSearchAndShopWithGoogleLens)},
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"launcher-settings-search", flag_descriptions::kLauncherSettingsSearchName,
flag_descriptions::kLauncherSettingsSearchDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kLauncherSettingsSearch)},
@@ -5962,7 +5964,7 @@
{"enable-suggested-files", flag_descriptions::kEnableSuggestedFilesName,
flag_descriptions::kEnableSuggestedFilesDescription, kOsCrOS,
FEATURE_VALUE_TYPE(app_list_features::kEnableSuggestedFiles)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"passwords-account-storage",
flag_descriptions::kEnablePasswordsAccountStorageName,
@@ -6020,7 +6022,7 @@
FEATURE_VALUE_TYPE(security_state::features::kLegacyTLSWarnings)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-assistant-aec", flag_descriptions::kEnableGoogleAssistantAecName,
flag_descriptions::kEnableGoogleAssistantAecDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::assistant::features::kAssistantAudioEraser)},
@@ -6054,7 +6056,7 @@
FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"exo-gamepad-vibration", flag_descriptions::kExoGamepadVibrationName,
flag_descriptions::kExoGamepadVibrationDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kGamepadVibration)},
@@ -6064,7 +6066,7 @@
{"exo-pointer-lock", flag_descriptions::kExoPointerLockName,
flag_descriptions::kExoPointerLockDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kExoPointerLock)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC)
{"metal", flag_descriptions::kMetalName,
@@ -6076,12 +6078,12 @@
flag_descriptions::kEnableDeJellyDescription, kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableDeJelly)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-cros-action-recorder",
flag_descriptions::kEnableCrOSActionRecorderName,
flag_descriptions::kEnableCrOSActionRecorderDescription, kOsCrOS,
MULTI_VALUE_TYPE(kEnableCrOSActionRecorderChoices)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"enable-games-hub", flag_descriptions::kGamesHubName,
@@ -6105,7 +6107,7 @@
FEATURE_VALUE_TYPE(blink::features::kFtpProtocol)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"crostini-use-buster-image",
flag_descriptions::kCrostiniUseBusterImageName,
flag_descriptions::kCrostiniUseBusterImageDescription, kOsCrOS,
@@ -6113,7 +6115,7 @@
{"crostini-disk-resizing", flag_descriptions::kCrostiniDiskResizingName,
flag_descriptions::kCrostiniDiskResizingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCrostiniDiskResizing)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"homepage-promo-card", flag_descriptions::kHomepagePromoCardName,
@@ -6123,7 +6125,7 @@
"HomepagePromoAndroid")},
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"split-settings-sync", flag_descriptions::kSplitSettingsSyncName,
flag_descriptions::kSplitSettingsSyncDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kSplitSettingsSync)},
@@ -6160,18 +6162,18 @@
flag_descriptions::kUseWallpaperStagingUrlName,
flag_descriptions::kUseWallpaperStagingUrlDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kUseWallpaperStagingUrl)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"autofill-enable-virtual-card",
flag_descriptions::kAutofillEnableVirtualCardName,
flag_descriptions::kAutofillEnableVirtualCardDescription, kOsDesktop,
FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableVirtualCard)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"account-id-migration", flag_descriptions::kAccountIdMigrationName,
flag_descriptions::kAccountIdMigrationDescription, kOsCrOS,
FEATURE_VALUE_TYPE(switches::kAccountIdMigration)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(https://crbug.com/1032161): Implement and enable for ChromeOS.
{"raw-clipboard", flag_descriptions::kRawClipboardName,
@@ -6209,7 +6211,7 @@
flag_descriptions::kFreezeUserAgentDescription, kOsDesktop | kOsAndroid,
FEATURE_VALUE_TYPE(blink::features::kFreezeUserAgent)},
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-user-data-snapshot", flag_descriptions::kUserDataSnapshotName,
flag_descriptions::kUserDataSnapshotDescription,
kOsMac | kOsWin | kOsLinux,
@@ -6280,7 +6282,7 @@
FEATURE_VALUE_TYPE(page_info::kPageInfoV2)},
#endif // !defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"drag-to-snap-in-clamshell-mode",
flag_descriptions::kDragToSnapInClamshellModeName,
flag_descriptions::kDragToSnapInClamshellModeDescription, kOsCrOS,
@@ -6301,7 +6303,7 @@
flag_descriptions::kEnhancedClipboardSimpleRenderName,
flag_descriptions::kEnhancedClipboardSimpleRenderDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kClipboardHistorySimpleRender)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
{"enable-media-foundation-video-capture",
@@ -6310,14 +6312,14 @@
FEATURE_VALUE_TYPE(media::kMediaFoundationVideoCapture)},
#endif // defined(OS_WIN)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"scanning-ui", flag_descriptions::kScanningUIName,
flag_descriptions::kScanningUIDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kScanningUI)},
{"avatar-toolbar-button", flag_descriptions::kAvatarToolbarButtonName,
flag_descriptions::kAvatarToolbarButtonDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kAvatarToolbarButton)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"color-provider-redirection",
flag_descriptions::kColorProviderRedirectionName,
@@ -6347,7 +6349,7 @@
FEATURE_VALUE_TYPE(features::kCopyLinkToText)},
#endif // !defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"nearby-sharing", flag_descriptions::kNearbySharingName,
flag_descriptions::kNearbySharingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kNearbySharing)},
@@ -6358,7 +6360,7 @@
{"nearby-sharing-webrtc", flag_descriptions::kNearbySharingWebRtcName,
flag_descriptions::kNearbySharingWebRtcDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kNearbySharingWebRtc)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"android-default-browser-promo",
@@ -6400,7 +6402,7 @@
kAlignFontDisplayAutoTimeoutWithLCPGoalVariations,
"AlignFontDisplayAutoTimeoutWithLCPGoal")},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-palm-suppression", flag_descriptions::kEnablePalmSuppressionName,
flag_descriptions::kEnablePalmSuppressionDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ui::kEnablePalmSuppression)},
@@ -6409,7 +6411,7 @@
flag_descriptions::kMovablePartialScreenshotName,
flag_descriptions::kMovablePartialScreenshotDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kMovablePartialScreenshot)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-experimental-cookie-features",
flag_descriptions::kEnableExperimentalCookieFeaturesName,
@@ -6447,11 +6449,11 @@
flag_descriptions::kEnableTranslateSubFramesDescription, kOsAll,
FEATURE_VALUE_TYPE(translate::kTranslateSubFrames)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"suggested-content-toggle", flag_descriptions::kSuggestedContentToggleName,
flag_descriptions::kSuggestedContentToggleDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kSuggestedContentToggle)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !defined(OS_ANDROID)
{"enable-media-feeds", flag_descriptions::kEnableMediaFeedsName,
@@ -6507,7 +6509,7 @@
FEATURE_VALUE_TYPE(features::kChromeCleanupScanCompletedNotification)},
#endif // !defined(OS_WIN)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-launcher-app-paging",
flag_descriptions::kNewDragSpecInLauncherName,
flag_descriptions::kNewDragSpecInLauncherDescription, kOsCrOS,
@@ -6515,18 +6517,18 @@
{"cdm-factory-daemon", flag_descriptions::kCdmFactoryDaemonName,
flag_descriptions::kCdmFactoryDaemonDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kCdmFactoryDaemon)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"autofill-enable-offers-in-downstream",
flag_descriptions::kAutofillEnableOffersInDownstreamName,
flag_descriptions::kAutofillEnableOffersInDownstreamDescription, kOsAll,
FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableOffersInDownstream)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-sharesheet", flag_descriptions::kSharesheetName,
flag_descriptions::kSharesheetDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kSharesheet)},
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"schemeful-same-site", flag_descriptions::kSchemefulSameSiteName,
flag_descriptions::kSchemefulSameSiteDescription, kOsAll,
@@ -6567,11 +6569,11 @@
FEATURE_VALUE_TYPE(
security_interstitials::kInsecureFormSubmissionInterstitial)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"frame-throttle-fps", flag_descriptions::kFrameThrottleFpsName,
flag_descriptions::kFrameThrottleFpsDescription, kOsCrOS,
MULTI_VALUE_TYPE(kFrameThrottleFpsChoices)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"filling-passwords-from-any-origin",
@@ -6628,11 +6630,11 @@
autofill::features::kAutofillDownstreamCvcPromptUseGooglePayLogo)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-auto-select", flag_descriptions::kEnableAutoSelectName,
flag_descriptions::kEnableAutoSelectDescription, kOsCrOS,
FEATURE_VALUE_TYPE(blink::features::kCrOSAutoSelect)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"smart-suggestion-for-large-downloads",
@@ -6689,7 +6691,7 @@
flag_descriptions::kSyncAutofillWalletOfferDataDescription, kOsAll,
FEATURE_VALUE_TYPE(switches::kSyncAutofillWalletOfferData)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-holding-space", flag_descriptions::kHoldingSpaceName,
flag_descriptions::kHoldingSpaceDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kTemporaryHoldingSpace)},
@@ -6718,7 +6720,7 @@
FEATURE_VALUE_TYPE(features::kUseSerialBusEnumerator)},
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"omnibox-rich-entities-in-launcher",
flag_descriptions::kOmniboxRichEntitiesInLauncherName,
flag_descriptions::kOmniboxRichEntitiesInLauncherDescription, kOsCrOS,
@@ -6741,15 +6743,17 @@
FEATURE_VALUE_TYPE(features::kMuteNotificationsDuringScreenShare)},
#endif // !defined(OS_ANDROID)
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
defined(OS_MAC)
{"enable-ephemeral-guest-profiles-on-desktop",
flag_descriptions::kEnableEphemeralGuestProfilesOnDesktopName,
flag_descriptions::kEnableEphemeralGuestProfilesOnDesktopDescription,
kOsWin | kOsLinux | kOsMac,
FEATURE_VALUE_TYPE(features::kEnableEphemeralGuestProfilesOnDesktop)},
-#endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) ||
- // defined(OS_MAC)
+#endif // defined(OS_WIN) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_MAC)
#if defined(OS_ANDROID)
{"decouple-sync-from-android-auto-sync",
@@ -6802,12 +6806,12 @@
kOsWin | kOsLinux | kOsCrOS,
FEATURE_VALUE_TYPE(blink::features::kInsertKeyToggleMode)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"connectivity-diagnostics-webui",
flag_descriptions::kConnectivityDiagnosticsWebUiName,
flag_descriptions::kConnectivityDiagnosticsWebUiDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kConnectivityDiagnosticsWebUi)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
{"enable-autofill-password-account-indicator-footer",
@@ -6888,12 +6892,12 @@
flag_descriptions::kShowPerformanceMetricsHudDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kHudDisplayForPerformanceMetrics)},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"disable-buffer-bw-compression",
flag_descriptions::kDisableBufferBWCompressionName,
flag_descriptions::kDisableBufferBWCompressionDescription, kOsCrOS,
SINGLE_VALUE_TYPE(switches::kDisableBufferBWCompression)},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{"enable-prerender2", flag_descriptions::kPrerender2Name,
flag_descriptions::kPrerender2Description, kOsAll,
@@ -6974,7 +6978,7 @@
bool SkipConditionalFeatureEntry(const flags_ui::FlagsStorage* storage,
const FeatureEntry& entry) {
version_info::Channel channel = chrome::GetChannel();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// enable-ui-devtools is only available on for non Stable channels.
if (!strcmp(ui_devtools::switches::kEnableUiDevTools, entry.internal_name) &&
channel == version_info::Channel::STABLE) {
@@ -7003,7 +7007,7 @@
channel != version_info::Channel::UNKNOWN) {
return true;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// data-reduction-proxy-lo-fi and enable-data-reduction-proxy-lite-page
// are only available for Chromium builds and the Canary/Dev/Beta channels.
@@ -7078,13 +7082,13 @@
std::set<base::CommandLine::StringType>* out_difference) {
const char* extra_flag_sentinel_begin_flag_name = nullptr;
const char* extra_flag_sentinel_end_flag_name = nullptr;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Put the flags between --policy-switches--begin and --policy-switches-end on
// ChromeOS.
extra_flag_sentinel_begin_flag_name =
chromeos::switches::kPolicySwitchesBegin;
extra_flag_sentinel_end_flag_name = chromeos::switches::kPolicySwitchesEnd;
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return flags_ui::FlagsState::AreSwitchesIdenticalToCurrentCommandLine(
new_cmdline, active_cmdline, out_difference,
extra_flag_sentinel_begin_flag_name, extra_flag_sentinel_end_flag_name);
diff --git a/chrome/browser/about_flags_browsertest.cc b/chrome/browser/about_flags_browsertest.cc
index 206e813..806e3bd0 100644
--- a/chrome/browser/about_flags_browsertest.cc
+++ b/chrome/browser/about_flags_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -261,7 +262,7 @@
// non-ChromeOS.
ToggleEnableDropdown(contents, kFlagName, true);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// On non-ChromeOS, the command line is not modified until restart.
EXPECT_EQ(kInitialSwitches,
base::CommandLine::ForCurrentProcess()->GetSwitches());
@@ -282,7 +283,7 @@
// Flaky. http://crbug.com/1010678
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, DISABLED_OriginFlagEnabled) {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// On non-ChromeOS, the command line is modified after restart.
EXPECT_EQ(
GetSanitizedInputAndCommandLine(),
@@ -301,7 +302,7 @@
EXPECT_EQ(GetSanitizedInputAndCommandLine(),
GetOriginListText(contents, kFlagName));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeOS doesn't read chrome://flags values on startup so we explicitly
// need to disable and re-enable the flag here.
ToggleEnableDropdown(contents, kFlagName, true);
@@ -347,7 +348,7 @@
EXPECT_TRUE(IsFlagPresent(contents, kExpiredFlagName));
}
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, PRE_ExpiredFlagDoesntApply) {
NavigateToFlagsPage();
content::WebContents* contents =
diff --git a/chrome/browser/accessibility/accessibility_extension_api.cc b/chrome/browser/accessibility/accessibility_extension_api.cc
index e007e7de..26104d0f 100644
--- a/chrome/browser/accessibility/accessibility_extension_api.cc
+++ b/chrome/browser/accessibility/accessibility_extension_api.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
@@ -38,7 +39,7 @@
#include "ui/events/base_event_utils.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/accessibility_controller.h"
#include "ash/public/cpp/accessibility_controller_enums.h"
#include "ash/public/cpp/accessibility_focus_ring_info.h"
@@ -82,7 +83,7 @@
const std::unique_ptr<Params> params(Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(chrome-a11y-core): we can't open a settings page when you're on the
// signin profile, but maybe we should notify the user and explain why?
Profile* profile = chromeos::AccessibilityManager::Get()->profile();
@@ -94,13 +95,13 @@
#else
// This function should only be available on ChromeOS.
EXTENSION_FUNCTION_VALIDATE(false);
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return RespondNow(NoArguments());
}
ExtensionFunction::ResponseAction
AccessibilityPrivateSetFocusRingsFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<accessibility_private::SetFocusRings::Params> params(
accessibility_private::SetFocusRings::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
@@ -171,12 +172,12 @@
return RespondNow(NoArguments());
#else
return RespondNow(Error(kErrorNotSupported));
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
ExtensionFunction::ResponseAction
AccessibilityPrivateSetHighlightsFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<accessibility_private::SetHighlights::Params> params(
accessibility_private::SetHighlights::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
@@ -194,7 +195,7 @@
chromeos::AccessibilityManager::Get()->SetHighlights(rects, color);
return RespondNow(NoArguments());
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return RespondNow(Error(kErrorNotSupported));
}
@@ -204,7 +205,7 @@
ChromeExtensionFunctionDetails details(this);
CHECK(extension());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool enabled;
bool capture;
EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
@@ -223,14 +224,14 @@
ash::EventRewriterController::Get()->CaptureAllKeysForSpokenFeedback(
enabled && capture);
return RespondNow(NoArguments());
-#endif // defined OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return RespondNow(Error(kErrorNotSupported));
}
ExtensionFunction::ResponseAction
AccessibilityPrivateDarkenScreenFunction::Run() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool darken = false;
EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &darken));
chromeos::AccessibilityManager::Get()->SetDarkenScreen(darken);
@@ -240,7 +241,7 @@
#endif
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ExtensionFunction::ResponseAction
AccessibilityPrivateSetNativeChromeVoxArcSupportForCurrentAppFunction::Run() {
std::unique_ptr<
diff --git a/chrome/browser/accessibility/accessibility_extension_api.h b/chrome/browser/accessibility/accessibility_extension_api.h
index d535299f..ded97e2 100644
--- a/chrome/browser/accessibility/accessibility_extension_api.h
+++ b/chrome/browser/accessibility/accessibility_extension_api.h
@@ -7,6 +7,7 @@
#include <string>
+#include "build/chromeos_buildflags.h"
#include "extensions/browser/extension_function.h"
// API function that enables or disables web content accessibility support.
@@ -61,7 +62,7 @@
ACCESSIBILITY_PRIVATE_OPENSETTINGSSUBPAGE)
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// API function that sets native ChromeVox ARC support.
class AccessibilityPrivateSetNativeChromeVoxArcSupportForCurrentAppFunction
: public ExtensionFunction {
diff --git a/chrome/browser/accessibility/accessibility_labels_service_browsertest.cc b/chrome/browser/accessibility/accessibility_labels_service_browsertest.cc
index 427af46..ab070aa 100644
--- a/chrome/browser/accessibility/accessibility_labels_service_browsertest.cc
+++ b/chrome/browser/accessibility/accessibility_labels_service_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/command_line.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -14,11 +15,11 @@
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#else
#include "content/public/browser/browser_accessibility_state.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
class AccessibilityLabelsBrowserTest : public InProcessBrowserTest {
public:
@@ -34,7 +35,7 @@
void TearDownOnMainThread() override { EnableScreenReader(false); }
void EnableScreenReader(bool enabled) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Enable Chromevox.
chromeos::AccessibilityManager::Get()->EnableSpokenFeedback(enabled);
#else
@@ -46,7 +47,7 @@
content::BrowserAccessibilityState::GetInstance()
->RemoveAccessibilityModeFlags(ui::AXMode::kScreenReader);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
private:
diff --git a/chrome/browser/accessibility/accessibility_state_utils.cc b/chrome/browser/accessibility/accessibility_state_utils.cc
index 12e43e0..e0e8970 100644
--- a/chrome/browser/accessibility/accessibility_state_utils.cc
+++ b/chrome/browser/accessibility/accessibility_state_utils.cc
@@ -4,17 +4,19 @@
#include "chrome/browser/accessibility/accessibility_state_utils.h"
-#if defined(OS_CHROMEOS)
+#include "build/chromeos_buildflags.h"
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#else
#include <stdint.h>
#include "content/public/browser/browser_accessibility_state.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace accessibility_state_utils {
bool IsScreenReaderEnabled() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
return chromeos::AccessibilityManager::Get() &&
chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled();
#else
@@ -23,7 +25,7 @@
ui::AXMode mode =
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
return mode.has_mode(ui::AXMode::kScreenReader);
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
} // namespace accessibility_state_utils
diff --git a/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc b/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc
index 88276db..3189fd9 100644
--- a/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc
+++ b/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/test/browser_test.h"
@@ -22,7 +23,7 @@
BrowserAccessibilityState::GetInstance()->UpdateHistogramsForTesting();
#if defined(OS_WIN)
histograms.ExpectTotalCount("Accessibility.WinScreenReader", 1);
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
histograms.ExpectTotalCount("Accessibility.CrosSpokenFeedback", 1);
#endif
}
diff --git a/chrome/browser/accessibility/caption_controller_browsertest.cc b/chrome/browser/accessibility/caption_controller_browsertest.cc
index fe72dc1..c97a964 100644
--- a/chrome/browser/accessibility/caption_controller_browsertest.cc
+++ b/chrome/browser/accessibility/caption_controller_browsertest.cc
@@ -6,6 +6,7 @@
#include "base/files/file_path.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/caption_controller_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -473,7 +474,7 @@
#endif
}
-#if !defined(OS_CHROMEOS) // No multi-profile on ChromeOS.
+#if !BUILDFLAG(IS_CHROMEOS_ASH) // No multi-profile on ChromeOS.
IN_PROC_BROWSER_TEST_F(CaptionControllerTest,
LiveCaptionEnabledChanged_MultipleProfiles) {
diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc
index dcea2ca0..8816c2dc 100644
--- a/chrome/browser/after_startup_task_utils.cc
+++ b/chrome/browser/after_startup_task_utils.cc
@@ -18,6 +18,7 @@
#include "base/sequenced_task_runner.h"
#include "base/synchronization/atomic_flag.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
@@ -32,7 +33,9 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#endif
-#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)
#include "ui/views/linux_ui/linux_ui.h"
#endif
@@ -138,7 +141,9 @@
g_after_startup_tasks.Get().clear();
g_after_startup_tasks.Get().shrink_to_fit();
-#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)
// Make sure we complete the startup notification sequence, or launchers will
// get confused by not receiving the expected message from the main process.
views::LinuxUI* linux_ui = views::LinuxUI::instance();
diff --git a/chrome/browser/apps/intent_helper/intent_picker_helpers.cc b/chrome/browser/apps/intent_helper/intent_picker_helpers.cc
index b351c34e..299460c 100644
--- a/chrome/browser/apps/intent_helper/intent_picker_helpers.cc
+++ b/chrome/browser/apps/intent_helper/intent_picker_helpers.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/intent_helper/intent_picker_auto_display_service.h"
#include "chrome/browser/apps/intent_helper/intent_picker_internal.h"
#include "chrome/browser/ui/intent_picker_tab_helper.h"
@@ -15,7 +16,7 @@
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/apps/intent_helper/chromeos_intent_picker_helpers.h"
#elif defined(OS_MAC)
#include "chrome/browser/apps/intent_helper/mac_intent_picker_helpers.h"
@@ -85,7 +86,7 @@
// TODO(crbug.com/824598): Store the apps that is found in
// intent_picker_tab_helper and update the icon visibility and apps if there is
// app installed or uninstalled.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
MaybeShowIntentPickerChromeOs(navigation_handle);
#else
const GURL& url = navigation_handle->GetURL();
@@ -96,7 +97,7 @@
void ShowIntentPickerBubble(content::WebContents* web_contents,
const GURL& url) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ShowIntentPickerBubbleChromeOs(web_contents, url);
#else
std::vector<IntentPickerAppInfo> apps = FindAppsForUrl(web_contents, url, {});
diff --git a/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_watch_apitest.cc b/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_watch_apitest.cc
index 6616189..2cb6cb8 100644
--- a/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_watch_apitest.cc
+++ b/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_watch_apitest.cc
@@ -13,6 +13,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/browser_process.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/media_galleries/media_file_system_registry.h"
@@ -221,7 +222,9 @@
}
// Test is flaky on windows and linux: crbug.com/1150017.
-#if defined(OS_WIN) || defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#define MAYBE_RemoveListenerAndModifyGallery \
DISABLED_RemoveListenerAndModifyGallery
#else
diff --git a/chrome/browser/apps/platform_apps/app_browsertest.cc b/chrome/browser/apps/platform_apps/app_browsertest.cc
index 3269931..fc8134a 100644
--- a/chrome/browser/apps/platform_apps/app_browsertest.cc
+++ b/chrome/browser/apps/platform_apps/app_browsertest.cc
@@ -830,7 +830,7 @@
// This appears to be unreliable.
// TODO(stevenjb): Investigate and enable
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) || defined(OS_WIN) || \
+#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_WIN) || \
defined(OS_MAC)
#define MAYBE_AppWindowRestoreState DISABLED_AppWindowRestoreState
#else
diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc
index 0018af8..bb8550a56 100644
--- a/chrome/browser/autocomplete/autocomplete_browsertest.cc
+++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/memory_dump_manager.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
#include "chrome/browser/extensions/extension_browsertest.h"
@@ -127,7 +128,7 @@
// Autocomplete test is flaky on ChromeOS.
// http://crbug.com/52928
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_Autocomplete DISABLED_Autocomplete
#else
#define MAYBE_Autocomplete Autocomplete
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
index b141ec3..a81ac31 100644
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -13,6 +13,7 @@
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
#include "chrome/browser/autocomplete/document_suggestions_service_factory.h"
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
@@ -123,7 +124,7 @@
chrome::kLanguageOptionsSubPage, chrome::kPasswordManagerSubPage,
chrome::kPaymentsSubPage, chrome::kResetProfileSettingsSubPage,
chrome::kSearchEnginesSubPage, chrome::kSyncSetupSubPage,
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
chrome::kCreateProfileSubPage, chrome::kImportDataSubPage,
chrome::kManageProfileSubPage, chrome::kPeopleSubPage,
#endif
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index eb07f1a..948f8be 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -870,7 +870,8 @@
// Since there are multiple profiles which share the status tray, we now
// use the browser process to keep track of it.
-#if !defined(OS_MAC) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS)
+#if !defined(OS_MAC) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
+ !BUILDFLAG(IS_CHROMEOS_LACROS)
if (!status_tray_)
status_tray_ = g_browser_process->status_tray();
#endif
diff --git a/chrome/browser/background/background_mode_manager_unittest.cc b/chrome/browser/background/background_mode_manager_unittest.cc
index 350d5ee..6b2cf08 100644
--- a/chrome/browser/background/background_mode_manager_unittest.cc
+++ b/chrome/browser/background/background_mode_manager_unittest.cc
@@ -17,6 +17,7 @@
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
@@ -45,7 +46,7 @@
#include "ui/gfx/image/image.h"
#include "ui/message_center/public/cpp/notifier_id.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
@@ -308,7 +309,7 @@
// We aren't interested in if the keep alive works correctly in this test.
std::unique_ptr<ScopedKeepAlive> test_keep_alive_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeOS needs extra services to run in the following order.
chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
chromeos::ScopedTestUserManager test_user_manager_;
diff --git a/chrome/browser/banners/app_banner_manager_desktop.cc b/chrome/browser/banners/app_banner_manager_desktop.cc
index f5f8f35..fdfa0cc 100644
--- a/chrome/browser/banners/app_banner_manager_desktop.cc
+++ b/chrome/browser/banners/app_banner_manager_desktop.cc
@@ -12,6 +12,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/banners/app_banner_metrics.h"
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -24,10 +25,10 @@
#include "extensions/common/constants.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/ui/app_list/arc/arc_app_list_prefs.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace {
@@ -35,9 +36,9 @@
// https://github.com/w3c/manifest/wiki/Platforms
const char kPlatformChromeWebStore[] = "chrome_web_store";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kPlatformPlay[] = "play";
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
bool gDisableTriggeringForTesting = false;
@@ -108,13 +109,13 @@
if (base::EqualsASCII(platform, kPlatformChromeWebStore))
return true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::EqualsASCII(platform, kPlatformPlay) &&
arc::IsArcAllowedForProfile(
Profile::FromBrowserContext(web_contents()->GetBrowserContext()))) {
return true;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return false;
}
@@ -134,13 +135,13 @@
id, extensions::ExtensionRegistry::ENABLED) != nullptr;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::EqualsASCII(platform, kPlatformPlay)) {
ArcAppListPrefs* arc_app_list_prefs =
ArcAppListPrefs::Get(web_contents()->GetBrowserContext());
return arc_app_list_prefs && arc_app_list_prefs->GetPackage(id) != nullptr;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return false;
}
diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc
index 8689377..b5b36ed 100644
--- a/chrome/browser/browser_features.cc
+++ b/chrome/browser/browser_features.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/browser_features.h"
+#include "build/chromeos_buildflags.h"
+
namespace features {
// Enables using the ClosedTabCache to instantly restore recently closed tabs
@@ -27,7 +29,7 @@
// chrome/browser/promo_browser_command/promo_browser_command.mojom
const char kPromoBrowserCommandIdParam[] = "PromoBrowserCommandIdParam";
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Enables being able to zoom a web page by double tapping in Chrome OS tablet
// mode.
const base::Feature kDoubleTapToZoomInTabletMode{
@@ -57,11 +59,11 @@
base::FEATURE_DISABLED_BY_DEFAULT};
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Enables taking snapshots of the user data directory after a major
// milestone update and restoring them after a version rollback.
const base::Feature kUserDataSnapshot{"UserDataSnapshot",
base::FEATURE_ENABLED_BY_DEFAULT};
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace features
diff --git a/chrome/browser/browser_features.h b/chrome/browser/browser_features.h
index 939e87f7..8b0118d 100644
--- a/chrome/browser/browser_features.h
+++ b/chrome/browser/browser_features.h
@@ -10,6 +10,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
namespace features {
@@ -23,7 +24,7 @@
extern const base::Feature kPromoBrowserCommands;
extern const char kPromoBrowserCommandIdParam[];
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
extern const base::Feature kDoubleTapToZoomInTabletMode;
#endif
@@ -37,7 +38,7 @@
extern const base::Feature kNewMacNotificationAPI;
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
extern const base::Feature kUserDataSnapshot;
#endif
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
index 4adbeee..f04600e 100644
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -19,6 +19,7 @@
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/buildflags.h"
#include "media/media_buildflags.h"
@@ -237,7 +238,9 @@
// before the full browser starts.
virtual StartupData* startup_data() = 0;
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
// This will start a timer that, if Chrome is in persistent mode, will check
// whether an update is available, and if that's the case, restart the
// browser. Note that restart code will strip some of the command line keys
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 2e76ca4..ba85a2d 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -34,6 +34,7 @@
#include "base/time/default_tick_clock.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/battery/battery_metrics.h"
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chrome_browser_main.h"
@@ -148,7 +149,7 @@
#include "chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h"
#endif
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/message_center/message_center.h"
#endif
@@ -190,7 +191,7 @@
#include "content/public/browser/plugin_service.h"
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/first_run/upgrade_util.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/ui/user_manager.h"
@@ -201,7 +202,7 @@
#include "chrome/browser/error_reporting/chrome_js_error_report_processor.h" // nogncheck
#endif
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
// How often to check if the persistent instance of Chrome needs to restart
// to install an update.
static const int kUpdateCheckIntervalHours = 6;
@@ -246,7 +247,7 @@
net::NetLog::Get()->InitializeSourceIdPartition();
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Forces creation of |metrics_services_manager_client_| if necessary
// (typically this call is a no-op as MetricsServicesManager has already been
// created).
@@ -286,7 +287,7 @@
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
#endif
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
message_center::MessageCenter::Initialize();
// Set the system notification source display name ("Google Chrome" or
// "Chromium").
@@ -384,7 +385,7 @@
plugins_resource_service_.reset();
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Initial cleanup for ChromeBrowserCloudManagement, shutdown components that
// depend on profile and notification system. For example, ProfileManager
// observer and KeyServices observer need to be removed before profiles.
@@ -397,7 +398,7 @@
system_notification_helper_.reset();
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Need to clear the desktop notification balloons before the IO thread and
// before the profiles, since if there are any still showing we will access
// those things during teardown.
@@ -414,11 +415,11 @@
{
TRACE_EVENT0("shutdown",
"BrowserProcessImpl::StartTearDown:ProfileManager");
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// The desktop User Manager needs to be closed before the guest profile
// can be destroyed.
UserManager::Hide();
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
// `profile_manager_` must be destroyed before `background_mode_manager_`,
// because the background mode manager does not stop observing profile
// changes at destruction (notifying the observers would cause a use-after-
@@ -435,7 +436,7 @@
storage_monitor::StorageMonitor::Destroy();
#endif
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
if (message_center::MessageCenter::Get())
message_center::MessageCenter::Shutdown();
#endif
@@ -598,7 +599,7 @@
metrics::MetricsService* metrics = g_browser_process->metrics_service();
if (metrics && local_state_) {
metrics->RecordStartOfSessionEnd();
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// MetricsService lazily writes to prefs, force it to write now.
// On ChromeOS, chrome gets killed when hangs, so no need to
// commit metrics::prefs::kStabilitySessionEndCompleted change immediately.
@@ -725,7 +726,7 @@
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// TODO(miguelg) return NULL for MAC as well once native notifications
// are enabled by default.
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
return nullptr;
#else
if (!created_notification_ui_manager_)
@@ -839,7 +840,7 @@
#endif
const std::string& BrowserProcessImpl::GetApplicationLocale() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(crbug.com/1033644): Remove #if.
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
#endif
@@ -928,9 +929,9 @@
registry->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false);
-#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
registry->RegisterBooleanPref(prefs::kEulaAccepted, false);
-#endif // defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
// TODO(brettw,*): this comment about ResourceBundle was here since
// initial commit. This comment seems unrelated, bit-rotten and
@@ -940,11 +941,11 @@
// are registered.
registry->RegisterStringPref(language::prefs::kApplicationLocale,
std::string());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterStringPref(prefs::kOwnerLocale, std::string());
registry->RegisterStringPref(prefs::kHardwareKeyboardLayout,
std::string());
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled,
GoogleUpdateSettings::GetCollectStatsConsent());
@@ -1020,7 +1021,9 @@
return startup_data_;
}
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
void BrowserProcessImpl::StartAutoupdateTimer() {
autoupdate_timer_.Start(FROM_HERE,
base::TimeDelta::FromHours(kUpdateCheckIntervalHours),
@@ -1195,7 +1198,7 @@
void BrowserProcessImpl::CreateNotificationUIManager() {
// Android and Chrome OS do not use the NotificationUIManager anymore.
// All notification traffic is routed through NotificationPlatformBridge.
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
DCHECK(!notification_ui_manager_);
notification_ui_manager_ = NotificationUIManager::Create();
created_notification_ui_manager_ = !!notification_ui_manager_;
@@ -1385,7 +1388,9 @@
}
// Mac is currently not supported.
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
bool BrowserProcessImpl::IsRunningInBackground() const {
// Check if browser is in the background.
@@ -1454,5 +1459,5 @@
RestartBackgroundInstance();
}
}
-
-#endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS))
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index 7cfbdefc..a967b1e 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -20,6 +20,7 @@
#include "base/sequence_checker.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/buildflags.h"
#include "components/keep_alive_registry/keep_alive_state_observer.h"
@@ -179,7 +180,9 @@
StartupData* startup_data() override;
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
void StartAutoupdateTimer() override;
#endif
@@ -290,7 +293,7 @@
background_printing_manager_;
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Manager for desktop notification UI.
bool created_notification_ui_manager_ = false;
std::unique_ptr<NotificationUIManager> notification_ui_manager_;
@@ -353,7 +356,9 @@
std::unique_ptr<BatteryMetrics> battery_metrics_;
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
base::RepeatingTimer autoupdate_timer_;
// Gets called by autoupdate timer to see if browser needs restart and can be
@@ -362,7 +367,8 @@
bool IsRunningInBackground() const;
void OnPendingRestartResult(bool is_update_pending_restart);
void RestartBackgroundInstance();
-#endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+#endif // defined(OS_WIN) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS))
// component updater is normally not used under ChromeOS due
// to concerns over integrity of data shared between profiles,
diff --git a/chrome/browser/browser_process_platform_part.h b/chrome/browser/browser_process_platform_part.h
index d6ff203..03738c9 100644
--- a/chrome/browser/browser_process_platform_part.h
+++ b/chrome/browser/browser_process_platform_part.h
@@ -6,11 +6,12 @@
#define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_H_
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
// Include the appropriate BrowserProcessPlatformPart based on the platform.
#if defined(OS_ANDROID)
#include "chrome/browser/browser_process_platform_part_android.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/browser_process_platform_part_chromeos.h"
#elif defined(OS_MAC)
#include "chrome/browser/browser_process_platform_part_mac.h"
diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc
index f2d7428..407b7ca 100644
--- a/chrome/browser/certificate_manager_model.cc
+++ b/chrome/browser/certificate_manager_model.cc
@@ -15,6 +15,7 @@
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/net/nss_context.h"
#include "chrome/browser/ui/crypto_module_password_dialog_nss.h"
#include "chrome/common/net/x509_certificate_model_nss.h"
@@ -29,7 +30,7 @@
#include "net/cert/x509_util_nss.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/certificate_provider/certificate_provider.h"
#include "chrome/browser/chromeos/certificate_provider/certificate_provider_service.h"
#include "chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.h"
@@ -76,12 +77,12 @@
return org;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Log message for an operation that can not be performed on a certificate of a
// given source.
constexpr char kOperationNotPermitted[] =
"Operation not permitted on a certificate. Source: ";
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace
@@ -268,7 +269,7 @@
DISALLOW_COPY_AND_ASSIGN(CertsSourcePlatformNSS);
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Provides certificates installed through enterprise policy.
class CertsSourcePolicy : public CertificateManagerModel::CertsSource,
chromeos::PolicyCertificateProvider::Observer {
@@ -436,7 +437,7 @@
DISALLOW_COPY_AND_ASSIGN(CertsSourceExtensions);
};
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
} // namespace
@@ -483,7 +484,7 @@
DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::unique_ptr<Params> params = std::make_unique<Params>();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
policy::UserNetworkConfigurationUpdater* user_network_configuration_updater =
policy::UserNetworkConfigurationUpdaterFactory::GetForBrowserContext(
browser_context);
@@ -521,7 +522,7 @@
base::RepeatingClosure certs_source_updated_callback = base::BindRepeating(
&CertificateManagerModel::OnCertsSourceUpdated, base::Unretained(this));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Certificates installed and web trusted by enterprise policy is the highest
// priority CertsSource.
// UserNetworkConfigurationUpdater is only available for the primary user's
@@ -537,7 +538,7 @@
certs_sources_.push_back(std::make_unique<CertsSourcePlatformNSS>(
certs_source_updated_callback, nss_cert_database));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Certificates installed by enterprise policy without web trust are lower
// priority than the main NSS DB based CertsSource.
// Rationale: The user should be able to add trust to policy-provided
@@ -695,7 +696,7 @@
bool is_user_db_available = !!cert_db->GetPublicSlot();
bool is_tpm_available = false;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
is_tpm_available = crypto::IsTPMTokenEnabledForNSS();
#endif
content::GetUIThreadTaskRunner({})->PostTask(
diff --git a/chrome/browser/certificate_manager_model.h b/chrome/browser/certificate_manager_model.h
index 66255aa..245af174 100644
--- a/chrome/browser/certificate_manager_model.h
+++ b/chrome/browser/certificate_manager_model.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
+#include "build/chromeos_buildflags.h"
#include "net/cert/nss_cert_database.h"
#include "net/cert/scoped_nss_types.h"
#include "net/ssl/client_cert_identity.h"
@@ -22,7 +23,7 @@
class ResourceContext;
} // namespace content
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
namespace chromeos {
class CertificateProvider;
class PolicyCertificateProvider;
@@ -121,7 +122,7 @@
// Holds parameters during construction.
struct Params {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// May be nullptr.
chromeos::PolicyCertificateProvider* policy_certs_provider = nullptr;
// May be nullptr.
diff --git a/chrome/browser/certificate_manager_model_unittest.cc b/chrome/browser/certificate_manager_model_unittest.cc
index cfa0b351..7109760 100644
--- a/chrome/browser/certificate_manager_model_unittest.cc
+++ b/chrome/browser/certificate_manager_model_unittest.cc
@@ -7,6 +7,7 @@
#include "base/observer_list.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/test/browser_task_environment.h"
#include "crypto/scoped_test_nss_db.h"
#include "net/cert/nss_cert_database.h"
@@ -18,7 +19,7 @@
#include "net/test/test_data_directory.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/certificate_provider/certificate_provider.h"
#include "chromeos/network/onc/certificate_scope.h"
#include "chromeos/network/policy_certificate_provider.h"
@@ -196,7 +197,7 @@
EXPECT_FALSE(platform_cert_info->hardware_backed());
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
namespace {
class FakePolicyCertificateProvider
@@ -660,4 +661,4 @@
}
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/chrome_back_forward_cache_browsertest.cc b/chrome/browser/chrome_back_forward_cache_browsertest.cc
index 0853c0b..e06327e 100644
--- a/chrome/browser/chrome_back_forward_cache_browsertest.cc
+++ b/chrome/browser/chrome_back_forward_cache_browsertest.cc
@@ -7,6 +7,7 @@
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.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/content_settings/mixed_content_settings_tab_helper.h"
#include "chrome/browser/permissions/permission_manager_factory.h"
@@ -47,7 +48,7 @@
adapter_ =
base::MakeRefCounted<testing::NiceMock<device::MockBluetoothAdapter>>();
device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// In CHROMEOS build, even when |adapter_| object is released at TearDown()
// it causes the test to fail on exit with an error indicating |adapter_| is
// leaked.
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc
index 2d6772e0..84f2551e 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/metrics/chrome_metrics_service_client.h"
#include "chrome/browser/metrics/chrome_metrics_services_manager_client.h"
@@ -35,7 +36,7 @@
#include "chrome/browser/chrome_browser_field_trials_desktop.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/first_run/help_app_first_run_field_trial.h"
#include "chrome/browser/chromeos/sync/split_settings_sync_field_trial.h"
#include "chromeos/services/multidevice_setup/public/cpp/first_run_field_trial.h"
@@ -92,11 +93,11 @@
if (!has_seed) {
CreateFallbackSamplingTrialIfNeeded(feature_list);
CreateFallbackUkmSamplingTrialIfNeeded(feature_list);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::multidevice_setup::CreateFirstRunFieldTrial(feature_list);
#endif
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// These trials are fully client controlled and must be configured whether or
// not a seed is available.
split_settings_sync_field_trial::Create(feature_list, local_state_);
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc
index d1e267b..10c7ca6 100644
--- a/chrome/browser/chrome_browser_interface_binders.cc
+++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/buildflags.h"
@@ -143,13 +144,13 @@
#include "chrome/browser/ui/webui/discards/site_data.mojom.h"
#endif
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
#include "chrome/browser/ui/webui/signin/profile_customization_ui.h"
#include "chrome/browser/ui/webui/signin/profile_picker_ui.h"
#include "ui/webui/resources/cr_components/customize_themes/customize_themes.mojom.h"
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/apps/digital_goods/digital_goods_factory_impl.h"
#include "chrome/browser/nearby_sharing/common/nearby_share_features.h"
#include "chrome/browser/ui/webui/app_management/app_management.mojom.h"
@@ -201,14 +202,14 @@
#include "third_party/blink/public/mojom/digital_goods/digital_goods.mojom.h"
#endif
-#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/webshare/share_service_impl.h"
#endif
#include "third_party/blink/public/mojom/webshare/webshare.mojom.h"
#endif
-#if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD)
+#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#include "chromeos/components/file_manager/file_manager_ui.h"
#include "chromeos/components/file_manager/mojom/file_manager.mojom.h"
#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" // nogncheck crbug.com/1125897
@@ -563,12 +564,12 @@
base::BindRepeating(&payments::CreatePaymentCredential));
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
map->Add<payments::mojom::DigitalGoodsFactory>(base::BindRepeating(
&apps::DigitalGoodsFactoryImpl::BindDigitalGoodsFactory));
#endif
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
if (base::FeatureList::IsEnabled(features::kWebShare)) {
map->Add<blink::mojom::ShareService>(
base::BindRepeating(&ShareServiceImpl::Create));
@@ -643,10 +644,10 @@
RegisterWebUIControllerInterfaceBinder<
customize_themes::mojom::CustomizeThemesHandlerFactory, NewTabPageUI
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
,
ProfileCustomizationUI, ProfilePickerUI, settings::SettingsUI
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
>(map);
#if !defined(OFFICIAL_BUILD)
@@ -675,7 +676,7 @@
::mojom::web_app_internals::WebAppInternalsPageHandler, InternalsUI>(map);
#endif // defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
RegisterWebUIControllerInterfaceBinder<
add_supervision::mojom::AddSupervisionHandler,
chromeos::AddSupervisionUI>(map);
@@ -766,9 +767,9 @@
RegisterWebUIControllerInterfaceBinder<chromeos::scanning::mojom::ScanService,
chromeos::ScanningUI>(map);
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD)
+#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
RegisterWebUIControllerInterfaceBinder<
chromeos::file_manager::mojom::PageHandlerFactory,
chromeos::file_manager::FileManagerUI>(map);
@@ -816,7 +817,7 @@
map);
#endif // !defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::FeatureList::IsEnabled(features::kNearbySharing)) {
RegisterWebUIControllerInterfaceBinder<
nearby_share::mojom::NearbyShareSettings,
@@ -833,7 +834,7 @@
chromeos::settings::OSSettingsUI>(
map);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
} // namespace internal
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 8831c0f4..f9562eb 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -194,23 +194,25 @@
#include "ui/base/l10n/l10n_util.h"
#endif // defined(OS_ANDROID)
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/first_run/upgrade_util.h"
#include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/stats_reporting_controller.h"
#include "chromeos/constants/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h"
#include "components/arc/metrics/stability_metrics_manager.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#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)
#include "chrome/browser/first_run/upgrade_util_linux.h"
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "components/crash/core/app/breakpad_linux.h"
@@ -245,8 +247,10 @@
#include "ui/shell_dialogs/select_file_dialog.h"
#endif // defined(OS_WIN)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
- (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
#include "chrome/browser/metrics/desktop_session_duration/touch_mode_stats_tracker.h"
#include "chrome/browser/profiles/profile_activity_metrics_recorder.h"
@@ -285,7 +289,7 @@
#include "printing/backend/win_helper.h"
#endif
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
#endif
@@ -295,7 +299,7 @@
#include "components/rlz/rlz_tracker.h" // nogncheck crbug.com/1125897
#endif // BUILDFLAG(ENABLE_RLZ)
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "ui/shell_dialogs/select_file_dialog_lacros.h"
#endif
@@ -326,7 +330,7 @@
}
}
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
void AddFirstRunNewTabs(StartupBrowserCreator* browser_creator,
const std::vector<GURL>& new_tabs) {
for (auto it = new_tabs.begin(); it != new_tabs.end(); ++it) {
@@ -334,7 +338,7 @@
browser_creator->AddFirstRunTab(*it);
}
}
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Initializes the primary profile, possibly doing some user prompting to pick
// a fallback profile. Returns the newly created profile, or NULL if startup
@@ -380,7 +384,7 @@
}
Profile* profile = nullptr;
-#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
// On ChromeOS and Android the ProfileManager will use the same path as the
// one we got passed. CreateInitialProfile will therefore use the correct path
// automatically.
@@ -410,7 +414,7 @@
"Error creating primary profile.");
return nullptr;
}
-#endif // defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
UMA_HISTOGRAM_LONG_TIMES(
"Startup.CreateFirstProfile", base::Time::Now() - start);
@@ -756,7 +760,7 @@
#if !defined(OS_ANDROID)
DCHECK(browser_creator_.get());
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
DCHECK(master_prefs_.get());
#endif
@@ -814,7 +818,7 @@
int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
// Android does first run in Java instead of native.
// Chrome OS has its own out-of-box-experience code.
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
master_prefs_ = std::make_unique<first_run::MasterPrefs>();
std::unique_ptr<installer::InitialPreferences> installer_initial_prefs =
@@ -845,7 +849,7 @@
master_prefs_->suppress_default_browser_prompt_for_version);
}
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
return content::RESULT_CODE_NORMAL_EXIT;
}
@@ -880,11 +884,11 @@
PrefService* local_state = browser_process_->local_state();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::CrosSettings::Initialize(local_state);
chromeos::StatsReportingController::Initialize(local_state);
arc::StabilityMetricsManager::Initialize(local_state);
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
{
TRACE_EVENT0(
@@ -921,7 +925,7 @@
// Android does first run in Java instead of native.
// Chrome OS has its own out-of-box-experience code.
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
if (first_run::IsChromeFirstRun()) {
if (!parsed_command_line().HasSwitch(switches::kApp) &&
!parsed_command_line().HasSwitch(switches::kAppId)) {
@@ -939,7 +943,7 @@
base::CreateDirectory(user_native_messaging_dir);
#endif // defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS)
}
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_OPENBSD)
// Set the product channel for crash reports.
@@ -958,8 +962,10 @@
SecKeychainAddCallback(&KeychainCallback, 0, nullptr);
#endif // defined(OS_MAC)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
- (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
metrics::DesktopSessionDurationTracker::Initialize();
ProfileActivityMetricsRecorder::Initialize();
TouchModeStatsTracker::Initialize(
@@ -1187,7 +1193,7 @@
}
ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory());
-#elif BUILDFLAG(IS_LACROS)
+#elif BUILDFLAG(IS_CHROMEOS_LACROS)
ui::SelectFileDialog::SetFactory(new ui::SelectFileDialogLacros::Factory());
#endif // defined(OS_WIN)
@@ -1271,7 +1277,7 @@
downgrade_manager_.UpdateLastVersion(user_data_dir_);
#endif
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
// Initialize the chrome browser cloud management controller controller after
// the browser process singleton is acquired to remove race conditions where
// multiple browser processes start simultaneously. The main
@@ -1434,7 +1440,7 @@
// (requires supporting early exit).
PostProfileInit();
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Execute first run specific code after the PrefService has been initialized
// and preferences have been registered since some of the import code depends
// on preferences.
@@ -1450,7 +1456,7 @@
if (browser_shutdown::IsTryingToQuit())
return content::RESULT_CODE_NORMAL_EXIT;
}
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
// Sets things up so that if we crash from this point on, a dialog will
@@ -1479,7 +1485,7 @@
}
#endif // defined(OS_WIN)
-#if BUILDFLAG(ENABLE_RLZ) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_RLZ) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Init the RLZ library. This just binds the dll and schedules a task on the
// file thread to be run sometime later. If this is the first run we record
// the installation event.
@@ -1495,7 +1501,7 @@
ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile_),
ChromeRLZTrackerDelegate::IsGoogleHomepage(profile_),
ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile_));
-#endif // BUILDFLAG(ENABLE_RLZ) && !defined(OS_CHROMEOS)
+#endif // BUILDFLAG(ENABLE_RLZ) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Configure modules that need access to resources.
net::NetModule::SetResourceProvider(ChromeNetResourceProvider);
@@ -1538,10 +1544,10 @@
language_usage_metrics::LanguageUsageMetrics::RecordApplicationLanguage(
browser_process_->GetApplicationLocale());
// On ChromeOS results in a crash. https://crbug.com/1151558
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
language_usage_metrics::LanguageUsageMetrics::RecordPageLanguages(
*UrlLanguageHistogramFactory::GetForBrowserContext(profile_));
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// On mobile, need for clean shutdown arises only when the application comes
// to foreground (i.e. MetricsService::OnAppEnterForeground is called).
@@ -1551,7 +1557,7 @@
browser_process_->metrics_service()->LogNeedForCleanShutdown();
#endif // !defined(OS_ANDROID)
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Create the instance of the cloud print proxy service so that it can launch
// the service process if needed. This is needed because the service process
// might have shutdown because an update was available.
@@ -1612,7 +1618,7 @@
// We are in regular browser boot sequence. Open initial tabs and enter the
// main message loop.
std::vector<Profile*> last_opened_profiles;
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// On ChromeOS multiple profiles doesn't apply, and will break if we load
// them this early as the cryptohome hasn't yet been mounted (which happens
// only once we log in). And if we're launching a web app, we don't want to
@@ -1621,7 +1627,7 @@
last_opened_profiles =
g_browser_process->profile_manager()->GetLastOpenedProfiles();
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// This step is costly and is already measured in
// Startup.StartupBrowserCreator_Start.
@@ -1631,21 +1637,26 @@
browser_creator_->Start(parsed_command_line(), base::FilePath(), profile_,
last_opened_profiles);
if (started) {
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
// Initialize autoupdate timer. Timer callback costs basically nothing
// when browser is not in persistent mode, so it's OK to let it ride on
// the main thread. This needs to be done here because we don't want
// to start the timer when Chrome is run inside a test harness.
browser_process_->StartAutoupdateTimer();
-#endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+#endif // defined(OS_WIN) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS))
-#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)
// On Linux, the running exe will be updated if an upgrade becomes
// available while the browser is running. We need to save the last
// modified time of the exe, so we can compare to determine if there is
// an upgrade while the browser is kept alive by a persistent extension.
upgrade_util::SaveLastModifiedTimeOfExe();
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Record now as the last successful chrome start.
if (ShouldRecordActiveUse(parsed_command_line()))
@@ -1800,9 +1811,9 @@
browser_shutdown::ShutdownPostThreadsStop(restart_mode);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
master_prefs_.reset();
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
process_singleton_.reset();
device_event_log::Shutdown();
@@ -1814,11 +1825,11 @@
// paths from content/browser/browser_main.
CHECK(metrics::MetricsService::UmaMetricsProperlyShutdown());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
arc::StabilityMetricsManager::Shutdown();
chromeos::StatsReportingController::Shutdown();
chromeos::CrosSettings::Shutdown();
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // defined(OS_ANDROID)
}
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h
index 294caf8..cc214ddc 100644
--- a/chrome/browser/chrome_browser_main.h
+++ b/chrome/browser/chrome_browser_main.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/chrome_process_singleton.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/process_singleton.h"
@@ -192,7 +193,7 @@
downgrade::DowngradeManager downgrade_manager_;
#endif
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Android's first run is done in Java instead of native. Chrome OS does not
// use master preferences.
std::unique_ptr<first_run::MasterPrefs> master_prefs_;
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc
index f6ce26c7..441a46a 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -13,6 +13,7 @@
#include "base/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/grit/chromium_strings.h"
#include "components/crash/core/app/breakpad_linux.h"
@@ -24,7 +25,7 @@
#include "media/audio/audio_manager.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/installer/util/google_update_settings.h"
#else
#include "base/command_line.h"
@@ -45,7 +46,7 @@
}
void ChromeBrowserMainPartsLinux::PreProfileInit() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Needs to be called after we have chrome::DIR_USER_DATA and
// g_browser_process. This happens in PreCreateThreads.
// base::GetLinuxDistro() will initialize its value if needed.
@@ -57,7 +58,7 @@
media::AudioManager::SetGlobalAppName(
l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME));
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Set up crypt config. This should be kept in sync with the OSCrypt parts of
// SystemNetworkContextManager::OnNetworkServiceCreated.
std::unique_ptr<os_crypt::Config> config(new os_crypt::Config());
@@ -88,7 +89,7 @@
// true all the time isn't useful, we overload the meaning of the breakpad
// registration metric to mean "is crash reporting enabled", since that's
// what breakpad registration effectively meant in the days before crashpad.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
breakpad_registered = GoogleUpdateSettings::GetCollectStatsConsent();
#else
breakpad_registered = crash_reporter::GetUploadsEnabled();
@@ -101,7 +102,7 @@
}
void ChromeBrowserMainPartsLinux::PostMainMessageLoopStart() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
bluez::BluezDBusManager::Initialize(nullptr /* system_bus */);
#endif
@@ -109,7 +110,7 @@
}
void ChromeBrowserMainPartsLinux::PostDestroyThreads() {
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
bluez::BluezDBusManager::Shutdown();
bluez::BluezDBusThreadManager::Shutdown();
#endif
diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc
index 25741e2d..315d460 100644
--- a/chrome/browser/chrome_browser_main_posix.cc
+++ b/chrome/browser/chrome_browser_main_posix.cc
@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/notreached.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/app/shutdown_signal_handlers_posix.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/sessions/session_restore.h"
@@ -69,7 +70,9 @@
// ExitHandler takes care of deleting itself.
new ExitHandler();
} else {
-#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)
switch (signal) {
case SIGINT:
case SIGHUP:
@@ -120,7 +123,7 @@
// static
void ExitHandler::Exit() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// On ChromeOS, exiting on signal should be always clean.
chrome::ExitIgnoreUnloadHandlers();
#else
@@ -162,7 +165,7 @@
}
void ChromeBrowserMainPartsPosix::ShowMissingLocaleMessageBox() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
NOTREACHED(); // Should not ever happen on ChromeOS.
#elif defined(OS_MAC)
// Not called on Mac because we load the locale files differently.
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 59e5175..3b0478f 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -397,7 +397,7 @@
#include "components/soda/constants.h"
#include "sandbox/mac/seatbelt_exec.h"
#include "sandbox/policy/mac/sandbox_mac.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/tablet_mode.h"
#include "chrome/app/chrome_crash_reporter_client.h"
@@ -435,7 +435,7 @@
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "services/service_manager/public/mojom/interface_provider_spec.mojom.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/chrome_browser_main_linux.h"
#elif defined(OS_ANDROID)
#include "base/android/application_status_listener.h"
@@ -468,9 +468,9 @@
#include "chrome/browser/chrome_browser_main_posix.h"
#endif
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/accessibility/accessibility_features.h"
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#if !defined(OS_ANDROID)
#include "chrome/browser/badging/badge_manager.h"
@@ -492,8 +492,10 @@
#include "chrome/grit/chrome_unscaled_resources.h" // nogncheck crbug.com/1125897
#endif // !defined(OS_ANDROID)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
- (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h"
#endif
@@ -513,7 +515,7 @@
// TODO(crbug.com/939205): Once the upcoming App Service is available, use a
// single navigation throttle to display the intent picker on all platforms.
#if !defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/apps/intent_helper/chromeos_apps_navigation_throttle.h"
#include "chrome/browser/chromeos/apps/intent_helper/common_apps_navigation_throttle.h"
#else
@@ -525,7 +527,9 @@
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
#endif
-#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)
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
#endif
@@ -593,11 +597,11 @@
#include "chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/app_mode/kiosk_settings_navigation_throttle.h"
#include "chrome/browser/chromeos/child_accounts/time_limits/web_time_limit_navigation_throttle.h"
#include "chrome/browser/speech/tts_controller_delegate_impl.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
#include "chrome/browser/media/cast_remoting_connector.h"
@@ -650,7 +654,7 @@
#include "chrome/browser/vr/chrome_xr_integration_client.h"
#endif
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/chrome_browser_main_parts_lacros.h"
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_lacros.h"
#include "chromeos/lacros/lacros_chrome_service_impl.h"
@@ -1298,9 +1302,9 @@
extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart);
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
extra_parts_.push_back(new ChromeContentBrowserClientChromeOsPart);
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
extra_parts_.push_back(new ChromeContentBrowserClientTabStripPart);
@@ -1386,7 +1390,7 @@
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts = std::make_unique<ChromeBrowserMainPartsLacros>(parameters,
&startup_data_);
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts =
std::make_unique<ChromeBrowserMainPartsLinux>(parameters, &startup_data_);
#elif defined(OS_ANDROID)
@@ -1412,10 +1416,12 @@
// Construct additional browser parts. Stages are called in the order in
// which they are added.
#if defined(TOOLKIT_VIEWS)
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts->AddParts(
std::make_unique<ChromeBrowserMainExtraPartsViewsLacros>());
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts->AddParts(
std::make_unique<ChromeBrowserMainExtraPartsViewsLinux>());
#else
@@ -1423,7 +1429,7 @@
#endif
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(jamescook): Combine with ChromeBrowserMainPartsChromeos.
main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsAsh>());
#endif
@@ -1642,7 +1648,7 @@
bool ChromeContentBrowserClient::ShouldUseMobileFlingCurve() {
#if defined(OS_ANDROID)
return true;
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
return ash::TabletMode::Get() && ash::TabletMode::Get()->InTabletMode();
#else
return false;
@@ -2231,7 +2237,7 @@
kDinosaurEasterEggSwitches,
base::size(kDinosaurEasterEggSwitches));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// On Chrome OS need to pass primary user homedir (in multi-profiles session).
base::FilePath homedir;
base::PathService::Get(base::DIR_HOME, &homedir);
@@ -2250,7 +2256,7 @@
process, profile);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const std::string& login_profile = browser_command_line.GetSwitchValueASCII(
chromeos::switches::kLoginProfile);
if (!login_profile.empty())
@@ -2373,7 +2379,7 @@
static const char* const kSwitchNames[] = {
autofill::switches::kIgnoreAutocompleteOffForAutofill,
autofill::switches::kShowAutofillSignatures,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
switches::kShortMergeSessionTimeoutForTest, // For tests only.
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -2398,7 +2404,7 @@
switches::kEnableNaClNonSfiMode,
#endif
switches::kEnableNetBenchmarking,
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
switches::kForceAppMode,
#endif
#if BUILDFLAG(ENABLE_NACL)
@@ -2451,7 +2457,7 @@
command_line->AppendSwitch(switches::kDisableBreakpad);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ChromeCrashReporterClient::ShouldPassCrashLoopBefore(process_type)) {
static const char* const kSwitchNames[] = {
crash_reporter::switches::kCrashLoopBefore,
@@ -2769,7 +2775,7 @@
return !cookie_settings->ShouldBlockThirdPartyCookies();
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
void ChromeContentBrowserClient::OnTrustAnchorUsed(
content::BrowserContext* browser_context) {
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
@@ -3036,7 +3042,7 @@
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (chromeos::ProfileHelper::IsSigninProfile(profile)) {
// On the sign-in profile, never show certificate selection to the user. A
// client certificate is an identifier that can be stable for a long time,
@@ -3064,7 +3070,7 @@
}
VLOG(1) << "Client cert requested in sign-in profile.";
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<net::ClientCertIdentity> auto_selected_identity =
AutoSelectCertificate(profile, requesting_url, client_certs);
@@ -3209,7 +3215,7 @@
return new speech::ChromeSpeechRecognitionManagerDelegate();
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
content::TtsControllerDelegate*
ChromeContentBrowserClient::GetTtsControllerDelegate() {
return TtsControllerDelegateImpl::GetInstance();
@@ -3221,7 +3227,7 @@
content::TtsController::GetInstance()->SetTtsEngineDelegate(
TtsExtensionEngine::GetInstance());
#endif
-#ifdef OS_CHROMEOS
+#if BUILDFLAG(IS_CHROMEOS_ASH)
return TtsPlatformImplChromeOs::GetInstance();
#else
return nullptr;
@@ -3303,7 +3309,7 @@
web_prefs->force_dark_mode_enabled =
prefs->GetBoolean(prefs::kWebKitForceDarkModeEnabled);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
web_prefs->always_show_focus =
prefs->GetBoolean(ash::prefs::kAccessibilityFocusHighlightEnabled);
#else
@@ -3710,7 +3716,7 @@
const base::FilePath& storage_partition_path,
std::vector<std::unique_ptr<storage::FileSystemBackend>>*
additional_backends) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
storage::ExternalMountPoints* external_mount_points =
content::BrowserContext::GetMountPoints(browser_context);
DCHECK(external_mount_points);
@@ -3919,11 +3925,11 @@
page_load_metrics::MetricsNavigationThrottle::Create(handle));
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
MaybeAddThrottle(
chromeos::WebTimeLimitNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
MaybeAddThrottle(
@@ -3961,7 +3967,7 @@
}
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Check if we need to add merge session throttle. This throttle will postpone
// loading of main frames.
if (handle->IsInMainFrame()) {
@@ -3978,7 +3984,7 @@
#if !defined(OS_ANDROID)
auto url_to_apps_throttle =
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::FeatureList::IsEnabled(features::kAppServiceIntentHandling)
? apps::CommonAppsNavigationThrottle::MaybeCreate(handle)
: chromeos::ChromeOsAppsNavigationThrottle::MaybeCreate(handle);
@@ -4069,14 +4075,16 @@
handle));
}
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
- (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle::
MaybeCreateThrottleFor(handle),
&throttles);
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
MaybeAddThrottle(
chromeos::KioskSettingsNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
@@ -4458,7 +4466,7 @@
int frame_tree_node_id,
ukm::SourceIdObj ukm_source_id,
NonNetworkURLLoaderFactoryMap* factories) {
-#if BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_EXTENSIONS) || BUILDFLAG(IS_CHROMEOS_ASH)
content::WebContents* web_contents =
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -4468,14 +4476,14 @@
web_contents->GetBrowserContext(), ukm_source_id,
!!extensions::WebViewGuest::FromWebContents(web_contents)));
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
factories->emplace(content::kExternalFileScheme,
chromeos::ExternalFileURLLoaderFactory::Create(
profile, content::ChildProcessHost::kInvalidUniqueID));
-#endif // defined(OS_CHROMEOS)
-#endif // BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS) || BUILDFLAG(IS_CHROMEOS_ASH)
}
void ChromeContentBrowserClient::
@@ -4568,7 +4576,7 @@
DISALLOW_COPY_AND_ASSIGN(SpecialAccessFileURLLoaderFactory);
};
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool IsSystemFeatureDisabled(policy::SystemFeature system_feature) {
PrefService* const local_state = g_browser_process->local_state();
if (!local_state) // Sometimes it's not available in tests.
@@ -4616,13 +4624,13 @@
int render_process_id,
int render_frame_id,
NonNetworkURLLoaderFactoryMap* factories) {
-#if defined(OS_CHROMEOS) || BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS)
content::RenderFrameHost* frame_host =
RenderFrameHost::FromID(render_process_id, render_frame_id);
WebContents* web_contents = WebContents::FromRenderFrameHost(frame_host);
-#endif // defined(OS_CHROMEOS) || BUILDFLAG(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (web_contents) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
@@ -4630,7 +4638,7 @@
chromeos::ExternalFileURLLoaderFactory::Create(
profile, render_process_id));
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_EXTENSIONS)
factories->emplace(extensions::kExtensionScheme,
@@ -5132,7 +5140,7 @@
return false;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Special case : in ChromeOS in Guest mode bookmarks and history are
// disabled for security reasons. New tab page explains the reasons, so
// we redirect user to new tab page.
@@ -5834,7 +5842,7 @@
void ChromeContentBrowserClient::BindBrowserControlInterface(
mojo::ScopedMessagePipeHandle pipe) {
-#if BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_LACROS)
chromeos::LacrosChromeServiceImpl::Get()->BindReceiver(
mojo::PendingReceiver<crosapi::mojom::LacrosChromeService>(
std::move(pipe)));
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 59479aa..10a0497f 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -20,6 +20,7 @@
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/startup_data.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
@@ -288,7 +289,7 @@
std::string GetWebBluetoothBlocklist() override;
bool AllowConversionMeasurement(
content::BrowserContext* browser_context) override;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
void OnTrustAnchorUsed(content::BrowserContext* browser_context) override;
#endif
scoped_refptr<network::SharedURLLoaderFactory>
@@ -339,7 +340,7 @@
bool* no_javascript_access) override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
content::TtsControllerDelegate* GetTtsControllerDelegate() override;
#endif
content::TtsPlatform* GetTtsPlatform() override;
diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc
index 0df6591..90a71a2b 100644
--- a/chrome/browser/chrome_content_browser_client_browsertest.cc
+++ b/chrome/browser/chrome_content_browser_client_browsertest.cc
@@ -15,6 +15,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/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -482,7 +483,7 @@
EXPECT_EQ(base::ASCIIToUTF16("about:blank"), tab_title);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Tests that if a protocol handler is registered for a scheme, an external
// program (another Chrome tab in this case) is not launched to handle the
// navigation. This is a regression test for crbug.com/963133.
diff --git a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
index ab5fda63..272ab252 100644
--- a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
+++ b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/badging/badge_manager.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/cache_stats_recorder.h"
@@ -42,7 +43,7 @@
#elif defined(OS_WIN)
#include "chrome/browser/win/conflicts/module_database.h"
#include "chrome/browser/win/conflicts/module_event_sink_impl.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/performance_manager/mechanisms/userspace_swap_chromeos.h"
#include "chromeos/components/cdm_factory_daemon/cdm_factory_daemon_proxy.h"
#include "components/performance_manager/public/performance_manager.h"
@@ -183,7 +184,7 @@
content::GetUIThreadTaskRunner({}));
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (performance_manager::mechanism::userspace_swap::
UserspaceSwapInitializationImpl::UserspaceSwapSupportedAndEnabled()) {
registry->AddInterface(
@@ -294,10 +295,10 @@
return;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (auto r = receiver.As<chromeos::cdm::mojom::CdmFactoryDaemon>())
chromeos::CdmFactoryDaemonProxy::Create(std::move(r));
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
void ChromeContentBrowserClient::BindUtilityHostReceiver(
diff --git a/chrome/browser/chrome_content_browser_client_unittest.cc b/chrome/browser/chrome_content_browser_client_unittest.cc
index 71603361..c8c19ab 100644
--- a/chrome/browser/chrome_content_browser_client_unittest.cc
+++ b/chrome/browser/chrome_content_browser_client_unittest.cc
@@ -21,6 +21,7 @@
#include "base/test/scoped_command_line.h"
#include "base/test/scoped_feature_list.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/captive_portal/captive_portal_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -71,7 +72,7 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/policy/policy_cert_service.h"
@@ -83,7 +84,7 @@
#include "chromeos/constants/chromeos_features.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/user_manager/scoped_user_manager.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
using content::BrowsingDataFilterBuilder;
using testing::_;
@@ -183,7 +184,7 @@
ASSERT_EQ("X11", pieces[0]);
pieces = base::SplitStringUsingSubstr(pieces[1], " ", base::KEEP_WHITESPACE,
base::SPLIT_WANT_ALL);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// X11; CrOS armv7l 4537.56.0
// ^^
ASSERT_EQ(3u, pieces.size());
@@ -777,7 +778,7 @@
#endif
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
class ChromeContentSettingsRedirectTest
: public ChromeContentBrowserClientTest {
public:
@@ -905,7 +906,7 @@
EXPECT_TRUE(policy::PolicyCertServiceFactory::UsedPolicyCertificates(kEmail));
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
class CaptivePortalCheckProcessHost : public content::MockRenderProcessHost {
public:
diff --git a/chrome/browser/chrome_notification_types.h b/chrome/browser/chrome_notification_types.h
index 75e5ec8c..207e753b 100644
--- a/chrome/browser/chrome_notification_types.h
+++ b/chrome/browser/chrome_notification_types.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "extensions/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -137,7 +138,7 @@
// Misc --------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Sent immediately after the logged-in user's profile is ready.
// The details are a Profile object.
NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
diff --git a/chrome/browser/chrome_plugin_browsertest.cc b/chrome/browser/chrome_plugin_browsertest.cc
index 62e241b..db24b06 100644
--- a/chrome/browser/chrome_plugin_browsertest.cc
+++ b/chrome/browser/chrome_plugin_browsertest.cc
@@ -13,6 +13,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/prefs/pref_service.h"
@@ -48,7 +49,7 @@
using ChromePluginTest = InProcessBrowserTest;
// Verify that the official builds have the known set of plugins.
-#if defined(OS_CHROMEOS) // http://crbug.com/1147726
+#if BUILDFLAG(IS_CHROMEOS_ASH) // http://crbug.com/1147726
#define MAYBE_InstalledPlugins DISABLED_InstalledPlugins
#else
#define MAYBE_InstalledPlugins InstalledPlugins
diff --git a/chrome/browser/chrome_resource_bundle_helper.cc b/chrome/browser/chrome_resource_bundle_helper.cc
index 66fb4fea..494d1f7 100644
--- a/chrome/browser/chrome_resource_bundle_helper.cc
+++ b/chrome/browser/chrome_resource_bundle_helper.cc
@@ -9,6 +9,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/metrics/chrome_feature_list_creator.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
@@ -27,7 +28,7 @@
#include "ui/base/resource/resource_bundle_android.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/common/pref_names.h"
#include "chromeos/constants/chromeos_switches.h"
#endif
@@ -38,7 +39,7 @@
ChromeFeatureListCreator* chrome_feature_list_creator) {
TRACE_EVENT0("startup", "ChromeBrowserMainParts::InitializeLocalState");
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(chromeos::switches::kLoginManager)) {
PrefService* local_state = chrome_feature_list_creator->local_state();
@@ -54,7 +55,7 @@
local_state->SetString(language::prefs::kApplicationLocale, owner_locale);
}
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
// Initializes the shared instance of ResourceBundle and returns the application
diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/component_updater/registration.cc
index 8bec7e3..cf3b88c 100644
--- a/chrome/browser/component_updater/registration.cc
+++ b/chrome/browser/component_updater/registration.cc
@@ -8,6 +8,7 @@
#include "base/path_service.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/buildflags.h"
#include "chrome/browser/component_updater/autofill_regex_component_installer.h"
@@ -59,9 +60,9 @@
#include "media/base/media_switches.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/component_updater/smart_dim_component_installer.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_NACL)
#include "chrome/browser/component_updater/pnacl_component_installer.h"
@@ -100,12 +101,12 @@
#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
#if BUILDFLAG(ENABLE_NACL) && !defined(OS_ANDROID)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// PNaCl on Chrome OS is on rootfs and there is no need to download it. But
// Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component
// installer when running on Linux. See crbug.com/422121 for more details.
if (!base::SysInfo::IsRunningOnChromeOS())
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
RegisterPnaclComponent(cus);
#endif // BUILDFLAG(ENABLE_NACL) && !defined(OS_ANDROID)
@@ -124,7 +125,7 @@
// the old file.
component_updater::DeleteLegacyCRLSet(path);
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
// Clean up previous STH sets that may have been installed. This is not
// done for:
// Android: Because STH sets were never used
@@ -134,12 +135,12 @@
}
RegisterSSLErrorAssistantComponent(cus);
RegisterFileTypePoliciesComponent(cus);
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// CRLSetFetcher attempts to load a CRL set from either the local disk or
// network.
// For Chrome OS this registration is delayed until user login.
component_updater::RegisterCRLSetComponent(cus);
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
RegisterOriginTrialsComponent(cus);
RegisterMediaEngagementPreloadComponent(cus, base::OnceClosure());
@@ -179,9 +180,9 @@
cus, profile_prefs, g_browser_process->local_state());
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
RegisterSmartDimComponent(cus);
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(USE_MINIKIN_HYPHENATION) && !defined(OS_ANDROID)
RegisterHyphenationComponent(cus);
diff --git a/chrome/browser/component_updater/widevine_cdm_component_installer.cc b/chrome/browser/component_updater/widevine_cdm_component_installer.cc
index 7eab4d1..08fb9ca 100644
--- a/chrome/browser/component_updater/widevine_cdm_component_installer.cc
+++ b/chrome/browser/component_updater/widevine_cdm_component_installer.cc
@@ -27,6 +27,7 @@
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/media/cdm_manifest.h"
#include "components/component_updater/component_installer.h"
#include "components/component_updater/component_updater_service.h"
@@ -76,9 +77,9 @@
"mac";
#elif defined(OS_WIN)
"win";
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
"cros";
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
"linux";
#else
#error This file should only be included for supported platforms.
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc
index d896bf4..f1dd0a6c 100644
--- a/chrome/browser/content_settings/content_settings_browsertest.cc
+++ b/chrome/browser/content_settings/content_settings_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
@@ -731,7 +732,7 @@
// This fails on ChromeOS because kRestoreOnStartup is ignored and the startup
// preference is always "continue where I left off.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Verify that cookies can be allowed and set using exceptions for particular
// website(s) only for a session when all others are blocked.
diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc
index 8a21b15..2ccc4d1 100644
--- a/chrome/browser/crash_recovery_browsertest.cc
+++ b/chrome/browser/crash_recovery_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -39,7 +40,7 @@
using content::WebContents;
// TODO(jam): http://crbug.com/350550
-#if !(defined(OS_CHROMEOS) && defined(ADDRESS_SANITIZER))
+#if !(BUILDFLAG(IS_CHROMEOS_ASH) && defined(ADDRESS_SANITIZER))
namespace {
diff --git a/chrome/browser/crash_upload_list/crash_upload_list.cc b/chrome/browser/crash_upload_list/crash_upload_list.cc
index 7988291b..d63e3508 100644
--- a/chrome/browser/crash_upload_list/crash_upload_list.cc
+++ b/chrome/browser/crash_upload_list/crash_upload_list.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/crash_upload_list/crash_upload_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#if defined(OS_MAC) || defined(OS_WIN)
#include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
@@ -38,7 +39,7 @@
// ChromeOS uses crash_sender as its uploader even when Crashpad is enabled,
// which isn't compatible with CrashUploadListCrashpad. crash_sender continues
// to log uploads in CrashUploadList::kReporterLogFilename.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
if (crash_reporter::IsCrashpadEnabled()) {
return new CrashUploadListCrashpad();
}
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc
index 5d5bd08..c33a340 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
@@ -16,6 +16,7 @@
#include "base/notreached.h"
#include "base/stl_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/common/custom_handlers/protocol_handler.h"
#include "chrome/common/pref_names.h"
@@ -215,7 +216,7 @@
}
void ProtocolHandlerRegistry::InstallDefaultsForChromeOS() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Only chromeos has default protocol handlers at this point.
AddPredefinedHandler(
ProtocolHandler::CreateProtocolHandler(
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc
index 76f55ebe..06a1b25 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc
@@ -8,6 +8,7 @@
#include "base/memory/singleton.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -59,7 +60,7 @@
ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry(
context, std::make_unique<ProtocolHandlerRegistry::Delegate>());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// If installing defaults, they must be installed prior calling
// InitProtocolSettings
registry->InstallDefaultsForChromeOS();
diff --git a/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc b/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc
index 48e1c21..1dde9a9 100644
--- a/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc
+++ b/chrome/browser/data_reduction_proxy/data_reduction_proxy_browsertest.cc
@@ -17,6 +17,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/data_reduction_proxy/data_reduction_proxy_chrome_settings.h"
#include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -128,7 +129,7 @@
} // namespace
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.cc
index 78def63..9c7a6db3 100644
--- a/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.cc
+++ b/chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.cc
@@ -17,6 +17,7 @@
#include "base/strings/string_util.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/chrome_content_browser_client.h"
#include "chrome/browser/data_use_measurement/chrome_data_use_measurement.h"
@@ -287,7 +288,7 @@
return data_reduction_proxy::Client::CHROME_ANDROID;
#elif defined(OS_MAC)
return data_reduction_proxy::Client::CHROME_MAC;
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
return data_reduction_proxy::Client::CHROME_CHROMEOS;
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
return data_reduction_proxy::Client::CHROME_LINUX;
diff --git a/chrome/browser/data_saver/subresource_redirect_browsertest.cc b/chrome/browser/data_saver/subresource_redirect_browsertest.cc
index 8259eb5f..1af8266 100644
--- a/chrome/browser/data_saver/subresource_redirect_browsertest.cc
+++ b/chrome/browser/data_saver/subresource_redirect_browsertest.cc
@@ -7,6 +7,7 @@
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.h"
#include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings_factory.h"
@@ -454,7 +455,7 @@
}
};
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc
index 6bc7640..6c93743 100644
--- a/chrome/browser/defaults.cc
+++ b/chrome/browser/defaults.cc
@@ -6,10 +6,11 @@
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
namespace browser_defaults {
-#if defined(OS_CHROMEOS) || defined(OS_MAC)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC)
const bool kBrowserAliveWithNoWindows = true;
const bool kShowExitMenuItem = false;
#else
@@ -17,7 +18,7 @@
const bool kShowExitMenuItem = true;
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const bool kShowUpgradeMenuItem = false;
const bool kShowImportOnBookmarkBar = false;
const bool kAlwaysOpenIncognitoWindow = true;
@@ -29,7 +30,7 @@
const bool kAlwaysCreateTabbedBrowserOnSessionRestore = true;
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const bool kShowHelpMenuItemIcon = true;
#else
const bool kShowHelpMenuItemIcon = false;
@@ -37,13 +38,15 @@
const bool kDownloadPageHasShowInFolder = true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const bool kSyncAutoStarts = true;
#else
const bool kSyncAutoStarts = false;
#endif
-#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)
const bool kScrollEventChangesTab = true;
#else
const bool kScrollEventChangesTab = false;
diff --git a/chrome/browser/dom_distiller/distillable_page_utils_browsertest.cc b/chrome/browser/dom_distiller/distillable_page_utils_browsertest.cc
index 6cc93ab..0111def 100644
--- a/chrome/browser/dom_distiller/distillable_page_utils_browsertest.cc
+++ b/chrome/browser/dom_distiller/distillable_page_utils_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
@@ -311,6 +312,6 @@
"IsPageDistillable"),
Pointee(false));
}
-#endif // OS_CHROMEOS || OS_LINUX || OS_MACOS || OS_WIN
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || OS_LINUX || OS_MACOS || OS_WIN
} // namespace dom_distiller
diff --git a/chrome/browser/downgrade/buildflags.gni b/chrome/browser/downgrade/buildflags.gni
index ec184e7..dfee39d 100644
--- a/chrome/browser/downgrade/buildflags.gni
+++ b/chrome/browser/downgrade/buildflags.gni
@@ -2,8 +2,9 @@
# 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() {
- enable_downgrade_processing = !is_android && !is_chromeos
+ enable_downgrade_processing = !is_android && !is_chromeos_ash
}
diff --git a/chrome/browser/download/download_dir_util.cc b/chrome/browser/download/download_dir_util.cc
index 6e5f3c54..9e0faad 100644
--- a/chrome/browser/download/download_dir_util.cc
+++ b/chrome/browser/download/download_dir_util.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/download/download_dir_util.h"
#include "base/files/file_path.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/policy/policy_path_parser.h"
#include "components/policy/core/browser/configuration_policy_handler_parameters.h"
diff --git a/chrome/browser/error_reporting/BUILD.gn b/chrome/browser/error_reporting/BUILD.gn
index 4115d4b..101eb5e2 100644
--- a/chrome/browser/error_reporting/BUILD.gn
+++ b/chrome/browser/error_reporting/BUILD.gn
@@ -13,6 +13,7 @@
]
deps = [
"//base",
+ "//build:chromeos_buildflags",
"//components/crash/content/browser/error_reporting",
"//components/crash/core/app",
"//components/feedback",
diff --git a/chrome/browser/error_reporting/chrome_js_error_report_processor.cc b/chrome/browser/error_reporting/chrome_js_error_report_processor.cc
index 97696e6..9e2f876 100644
--- a/chrome/browser/error_reporting/chrome_js_error_report_processor.cc
+++ b/chrome/browser/error_reporting/chrome_js_error_report_processor.cc
@@ -20,6 +20,7 @@
#include "base/task/thread_pool.h"
#include "base/time/default_clock.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "components/crash/content/browser/error_reporting/javascript_error_report.h"
#include "components/crash/core/app/client_upload_info.h"
#include "components/feedback/redaction_tool.h"
@@ -256,7 +257,7 @@
params["browser"] = "Chrome";
params["browser_version"] = platform.version;
params["channel"] = platform.channel;
-#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
// base::SysInfo::OperatingSystemName() returns "Linux" on ChromeOS devices.
params["os"] = "ChromeOS";
#else
diff --git a/chrome/browser/extensions/api/tab_groups/tab_groups_api_apitest.cc b/chrome/browser/extensions/api/tab_groups/tab_groups_api_apitest.cc
index 38115647..89a14c7 100644
--- a/chrome/browser/extensions/api/tab_groups/tab_groups_api_apitest.cc
+++ b/chrome/browser/extensions/api/tab_groups/tab_groups_api_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/extension_apitest.h"
#include "content/public/test/browser_test.h"
@@ -13,7 +14,9 @@
using TabGroupsApiTest = ExtensionApiTest;
IN_PROC_BROWSER_TEST_F(TabGroupsApiTest, TestTabGroupsWorks) {
-#if defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
// TODO(crbug.com/1148195): Fix flakiness of this text on Linux.
return;
#endif
diff --git a/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc b/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
index 2032794..7455a98 100644
--- a/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
@@ -6,6 +6,7 @@
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_apitest.h"
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 3af733b..bc67cc4 100644
--- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -3033,7 +3033,9 @@
// Regression test for http://crbug.com/996940. Requests that redirected to an
// appcache handled URL could have request ID collisions.
// This test is flaky on Linux: https://crbug.com/1094834.
-#if defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_RedirectToAppCacheRequest DISABLED_RedirectToAppCacheRequest
#else
#define MAYBE_RedirectToAppCacheRequest RedirectToAppCacheRequest
diff --git a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
index 0847188..d752945a 100644
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
@@ -198,7 +198,7 @@
LazyInitData();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (extension_id == extension_misc::kFilesManagerAppId) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
// Disable $i18n{} template JS string replacement during JS code coverage.
diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc
index e1ba4292..98ca27c 100644
--- a/chrome/browser/external_protocol/external_protocol_handler.cc
+++ b/chrome/browser/external_protocol/external_protocol_handler.cc
@@ -14,6 +14,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/external_protocol/auto_launch_protocols_policy_handler.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -150,7 +151,7 @@
platform_util::OpenExternal(
Profile::FromBrowserContext(web_contents->GetBrowserContext()), url);
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// If the protocol navigation occurs in a new tab, close it.
// Avoid calling CloseContents if the tab is not in this browser's tab strip
// model; this can happen if the protocol was initiated by something
@@ -192,7 +193,7 @@
bool chrome_is_default_handler = state == shell_integration::IS_DEFAULT;
// On ChromeOS, Click to Call is integrated into the external protocol dialog.
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
if (web_contents && ShouldOfferClickToCallForURL(
web_contents->GetBrowserContext(), escaped_url)) {
// Handle tel links by opening the Click to Call dialog. This will call back
diff --git a/chrome/browser/fast_shutdown_browsertest.cc b/chrome/browser/fast_shutdown_browsertest.cc
index 93edb16..c6970c1 100644
--- a/chrome/browser/fast_shutdown_browsertest.cc
+++ b/chrome/browser/fast_shutdown_browsertest.cc
@@ -7,6 +7,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -40,7 +41,8 @@
// This tests for a previous error where uninstalling an onbeforeunload handler
// would enable fast shutdown even if an onunload handler still existed.
// Flaky on all platforms, http://crbug.com/89173
-#if !defined(OS_CHROMEOS) // ChromeOS opens tabs instead of windows for popups.
+#if !BUILDFLAG( \
+ IS_CHROMEOS_ASH) // ChromeOS opens tabs instead of windows for popups.
IN_PROC_BROWSER_TEST_F(FastShutdown, DISABLED_SlowTermination) {
// Need to run these tests on http:// since we only allow cookies on that (and
// https obviously).
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index d6fe06d..72982f2 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -16,6 +16,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -43,7 +44,7 @@
#include "chrome/browser/file_select_helper_contacts_android.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
#include "content/public/browser/site_instance.h"
#endif
@@ -294,7 +295,7 @@
if (AbortIfWebContentsDestroyed())
return;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (!files.empty()) {
if (!IsValidProfile(profile_)) {
RunFileChooserEnd();
@@ -313,7 +314,7 @@
this));
return;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
std::vector<FileChooserFileInfoPtr> chooser_files;
for (const auto& file : files) {
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 1ae4d3d7..6aeb6e7a 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/flag_descriptions.h"
+#include "build/chromeos_buildflags.h"
+
// Keep in identical order as the header file, see the comment at the top
// for formatting rules.
@@ -3650,7 +3652,7 @@
// Chrome OS -------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kAccountManagementFlowsV2Name[] =
"Enable redesign of account management flows";
@@ -4679,7 +4681,7 @@
// Prefer keeping this section sorted to adding new definitions down here.
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// All views-based platforms --------------------------------------------------
@@ -4773,14 +4775,14 @@
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
const char kWebContentsOcclusionName[] = "Enable occlusion of web contents";
const char kWebContentsOcclusionDescription[] =
"If enabled, web contents will behave as hidden when it is occluded by "
"other windows.";
-#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_CHROMEOS) || defined(OS_LINUX)
#if BUILDFLAG(USE_TCMALLOC)
@@ -4791,28 +4793,30 @@
#endif // BUILDFLAG(USE_TCMALLOC)
#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX)
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
const char kUserDataSnapshotName[] = "Enable user data snapshots";
const char kUserDataSnapshotDescription[] =
"Enables taking snapshots of the user data directory after a Chrome "
"update and restoring them after a version rollback.";
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
const char kWebShareName[] = "Web Share";
const char kWebShareDescription[] =
"Enables the Web Share (navigator.share) APIs on experimentally supported "
"platforms.";
-#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
defined(OS_MAC)
const char kEnableEphemeralGuestProfilesOnDesktopName[] =
"Enable ephemeral Guest profiles on Desktop";
const char kEnableEphemeralGuestProfilesOnDesktopDescription[] =
"Enables ephemeral Guest profiles on Windows, Linux, and Mac.";
-#endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) ||
- // defined(OS_MAC)
+#endif // defined(OS_WIN) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_MAC)
// Feature flags --------------------------------------------------------------
@@ -4881,13 +4885,13 @@
"When enabled makes use of a WebUI-based tab strip.";
#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
-#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
const char kWebUITabStripTabDragIntegrationName[] =
"ChromeOS drag-drop extensions for WebUI tab strip";
const char kWebUITabStripTabDragIntegrationDescription[] =
"Enables special handling in ash for WebUI tab strip tab drags. Allows "
"dragging tabs out to new windows.";
-#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 20d2e226..205d869 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -9,6 +9,7 @@
#include "base/check_op.h"
#include "build/build_config.h"
#include "build/buildflag.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/buildflags.h"
#include "components/nacl/common/buildflags.h"
#include "components/paint_preview/buildflags/buildflags.h"
@@ -2114,7 +2115,7 @@
// Chrome OS ------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kAccountManagementFlowsV2Name[];
extern const char kAccountManagementFlowsV2Description[];
@@ -2735,7 +2736,7 @@
// Prefer keeping this section sorted to adding new declarations down here.
-#endif // #if defined(OS_CHROMEOS)
+#endif // #if BUILDFLAG(IS_CHROMEOS_ASH)
// All views-based platforms --------------------------------------------------
@@ -2790,12 +2791,12 @@
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kWebContentsOcclusionName[];
extern const char kWebContentsOcclusionDescription[];
-#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_CHROMEOS) || defined(OS_LINUX)
#if BUILDFLAG(USE_TCMALLOC)
@@ -2804,17 +2805,19 @@
#endif // BUILDFLAG(USE_TCMALLOC)
#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX)
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kUserDataSnapshotName[];
extern const char kUserDataSnapshotDescription[];
-#endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+#endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kWebShareName[];
extern const char kWebShareDescription[];
-#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
defined(OS_MAC)
extern const char kEnableEphemeralGuestProfilesOnDesktopName[];
extern const char kEnableEphemeralGuestProfilesOnDesktopDescription[];
@@ -2868,10 +2871,10 @@
extern const char kWebUITabStripDescription[];
#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
-#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
extern const char kWebUITabStripTabDragIntegrationName[];
extern const char kWebUITabStripTabDragIntegrationDescription[];
-#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && defined(OS_CHROMEOS)
+#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
diff --git a/chrome/browser/focus_ring_browsertest.cc b/chrome/browser/focus_ring_browsertest.cc
index 7edd7e1..c206ddd 100644
--- a/chrome/browser/focus_ring_browsertest.cc
+++ b/chrome/browser/focus_ring_browsertest.cc
@@ -6,6 +6,7 @@
#include "base/path_service.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
@@ -85,7 +86,7 @@
platform_suffix = "_mac";
#elif defined(OS_WIN)
platform_suffix = "_win";
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
platform_suffix = "_chromeos";
#endif
diff --git a/chrome/browser/gcm/gcm_profile_service_unittest.cc b/chrome/browser/gcm/gcm_profile_service_unittest.cc
index 948fa73..fb52bb8 100644
--- a/chrome/browser/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/gcm/gcm_profile_service_unittest.cc
@@ -20,9 +20,10 @@
#include "chrome/test/base/testing_profile.h"
#include "components/gcm_driver/gcm_profile_service.h"
#include "content/public/browser/browser_task_traits.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/dbus_thread_manager.h"
#endif
+#include "build/chromeos_buildflags.h"
#include "components/gcm_driver/fake_gcm_app_handler.h"
#include "components/gcm_driver/fake_gcm_client.h"
#include "components/gcm_driver/fake_gcm_client_factory.h"
@@ -157,7 +158,7 @@
}
void GCMProfileServiceTest::SetUp() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Create a DBus thread manager setter for its side effect.
// Ignore the return value.
chromeos::DBusThreadManager::GetSetterForTesting();
diff --git a/chrome/browser/google/google_brand.cc b/chrome/browser/google/google_brand.cc
index 55f5263..d02397f 100644
--- a/chrome/browser/google/google_brand.cc
+++ b/chrome/browser/google/google_brand.cc
@@ -13,11 +13,12 @@
#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/installer/util/google_update_settings.h"
#if defined(OS_MAC)
#include "chrome/browser/mac/keystone_glue.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/google/google_brand_chromeos.h"
#endif
@@ -77,7 +78,7 @@
#if defined(OS_MAC)
brand->assign(keystone_glue::BrandCode());
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
brand->assign(google_brand::chromeos::GetBrand());
#else
brand->clear();
@@ -93,7 +94,7 @@
#endif
bool GetRlzBrand(std::string* brand) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
brand->assign(google_brand::chromeos::GetRlzBrand());
return true;
#else
diff --git a/chrome/browser/google/google_update_settings_posix.cc b/chrome/browser/google/google_update_settings_posix.cc
index a9089e6..b8784e8 100644
--- a/chrome/browser/google/google_update_settings_posix.cc
+++ b/chrome/browser/google/google_update_settings_posix.cc
@@ -12,6 +12,7 @@
#include "base/synchronization/lock.h"
#include "base/task/lazy_thread_pool_task_runner.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/chrome_paths.h"
#include "components/crash/core/app/crashpad.h"
@@ -32,7 +33,7 @@
const char kConsentToSendStats[] = "Consent To Send Stats";
void SetConsentFilePermissionIfNeeded(const base::FilePath& consent_file) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// The consent file needs to be world readable. See http://crbug.com/383003
int permissions;
if (base::GetPosixFilePermissions(consent_file, &permissions) &&
@@ -77,7 +78,9 @@
bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
#if defined(OS_MAC)
crash_reporter::SetUploadConsent(consented);
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
+// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+// of lacros-chrome is complete.
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
if (crash_reporter::IsCrashpadEnabled()) {
crash_reporter::SetUploadConsent(consented);
}
diff --git a/chrome/browser/google/google_update_settings_unittest.cc b/chrome/browser/google/google_update_settings_unittest.cc
index 046aef6..f1c5766e 100644
--- a/chrome/browser/google/google_update_settings_unittest.cc
+++ b/chrome/browser/google/google_update_settings_unittest.cc
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/installer/util/google_update_settings.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/path_service.h"
#include "base/test/scoped_path_override.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/google/google_brand.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/installer/util/google_update_settings.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -79,7 +80,7 @@
#endif
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Test for http://crbug.com/383003
TEST_F(GoogleUpdateTest, ConsentFileIsWorldReadable) {
// Turn on stats reporting.
diff --git a/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc b/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc
index c9ae4273..bbf4848 100644
--- a/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc
+++ b/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc
@@ -5,9 +5,10 @@
#include "chrome/browser/guest_view/chrome_guest_view_manager_delegate.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/task_manager/web_contents_tags.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/app_mode/app_session.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#endif
@@ -31,7 +32,7 @@
// manager.
task_manager::WebContentsTags::CreateForGuestContents(guest_web_contents);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Notifies kiosk session about the added guest.
chromeos::AppSession* app_session =
chromeos::KioskAppManager::Get()->app_session();
diff --git a/chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_browsertest.cc b/chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_browsertest.cc
index 6354ea1..2cf1f2c 100644
--- a/chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_browsertest.cc
+++ b/chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_browsertest.cc
@@ -188,7 +188,7 @@
} // namespace
// Flaky on ChromeOS and Lacros (https://crbug.com/1033009)
-#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_GuestDevToolsReloadsEmbedder DISABLED_GuestDevToolsReloadsEmbedder
#else
#define MAYBE_GuestDevToolsReloadsEmbedder GuestDevToolsReloadsEmbedder
diff --git a/chrome/browser/image_decoder/BUILD.gn b/chrome/browser/image_decoder/BUILD.gn
index 101a4786..6641692 100644
--- a/chrome/browser/image_decoder/BUILD.gn
+++ b/chrome/browser/image_decoder/BUILD.gn
@@ -7,6 +7,7 @@
source_set("image_decoder") {
deps = [
"//base",
+ "//build:chromeos_buildflags",
"//content/public/browser",
"//ipc",
"//services/data_decoder/public/cpp",
@@ -34,6 +35,7 @@
deps = [
":image_decoder",
"//base",
+ "//build:chromeos_buildflags",
"//chrome/app:generated_resources",
"//chrome/test:test_support",
"//chrome/test:test_support_ui",
diff --git a/chrome/browser/image_decoder/DEPS b/chrome/browser/image_decoder/DEPS
index da0e266..84a3b198 100644
--- a/chrome/browser/image_decoder/DEPS
+++ b/chrome/browser/image_decoder/DEPS
@@ -3,6 +3,7 @@
include_rules = [
"+base",
"+build/build_config.h",
+ "+build/chromeos_buildflags.h",
"+chrome/grit/generated_resources.h",
"+chrome/test",
"+content/public/browser",
@@ -13,4 +14,4 @@
"+third_party/skia/include/core",
"+ui/base",
"+ui/gfx/geometry",
-]
\ No newline at end of file
+]
diff --git a/chrome/browser/image_decoder/image_decoder.cc b/chrome/browser/image_decoder/image_decoder.cc
index c41639c..d247b94 100644
--- a/chrome/browser/image_decoder/image_decoder.cc
+++ b/chrome/browser/image_decoder/image_decoder.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "ipc/ipc_channel.h"
@@ -154,10 +155,10 @@
data_decoder::mojom::ImageCodec codec =
data_decoder::mojom::ImageCodec::DEFAULT;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (image_codec == ROBUST_PNG_CODEC)
codec = data_decoder::mojom::ImageCodec::ROBUST_PNG;
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
auto callback =
base::BindOnce(&OnDecodeImageDone,
diff --git a/chrome/browser/image_decoder/image_decoder.h b/chrome/browser/image_decoder/image_decoder.h
index 59988b3..0b21cb5f 100644
--- a/chrome/browser/image_decoder/image_decoder.h
+++ b/chrome/browser/image_decoder/image_decoder.h
@@ -14,6 +14,7 @@
#include "base/sequence_checker.h"
#include "base/sequenced_task_runner.h"
#include "base/synchronization/lock.h"
+#include "build/chromeos_buildflags.h"
namespace data_decoder {
class DataDecoder;
@@ -80,9 +81,9 @@
enum ImageCodec {
DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage).
-#if defined(OS_CHROMEOS)
- ROBUST_PNG_CODEC, // Restrict decoding to robust PNG codec.
-#endif // defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ ROBUST_PNG_CODEC, // Restrict decoding to robust PNG codec.
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
};
static ImageDecoder* GetInstance();
diff --git a/chrome/browser/image_decoder/image_decoder_browsertest.cc b/chrome/browser/image_decoder/image_decoder_browsertest.cc
index 920ef2f7..0e42aa2 100644
--- a/chrome/browser/image_decoder/image_decoder_browsertest.cc
+++ b/chrome/browser/image_decoder/image_decoder_browsertest.cc
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/browser_child_process_observer.h"
@@ -110,7 +111,7 @@
EXPECT_FALSE(test_request.decode_succeeded());
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(ImageDecoderBrowserTest, BasicDecodeWithOptionsString) {
base::RunLoop run_loop;
@@ -155,7 +156,7 @@
EXPECT_FALSE(test_request.decode_succeeded());
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(ImageDecoderBrowserTest, BasicDecode) {
base::RunLoop run_loop;
diff --git a/chrome/browser/infobars/infobars_browsertest.cc b/chrome/browser/infobars/infobars_browsertest.cc
index 0e96421..98351eb 100644
--- a/chrome/browser/infobars/infobars_browsertest.cc
+++ b/chrome/browser/infobars/infobars_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/buildflag.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/devtools/devtools_infobar_delegate.h"
#include "chrome/browser/extensions/api/debugger/extension_dev_tools_infobar_delegate.h"
#include "chrome/browser/extensions/api/messaging/incognito_connectability_infobar_delegate.h"
@@ -59,7 +60,7 @@
#include "sandbox/policy/switches.h"
#include "ui/base/l10n/l10n_util.h"
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ui/startup/default_browser_infobar_delegate.h"
#endif
@@ -332,7 +333,7 @@
break;
case IBD::DEFAULT_BROWSER_INFOBAR_DELEGATE:
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ADD_FAILURE() << "This infobar is not supported on this OS.";
#else
chrome::DefaultBrowserInfoBarDelegate::Create(GetInfoBarService(),
@@ -468,7 +469,7 @@
ShowAndVerifyUi();
}
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_default_browser) {
ShowAndVerifyUi();
}
diff --git a/chrome/browser/invalidation/profile_invalidation_provider_factory.cc b/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
index f5baecc..2f5c2d9 100644
--- a/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
+++ b/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
@@ -9,6 +9,7 @@
#include "base/bind.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/gcm/gcm_profile_service_factory.h"
@@ -31,7 +32,7 @@
#include "content/public/browser/storage_partition.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/files/file_path.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
@@ -72,7 +73,7 @@
// static
ProfileInvalidationProvider* ProfileInvalidationProviderFactory::GetForProfile(
Profile* profile) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Using ProfileHelper::GetSigninProfile() here would lead to an infinite loop
// when this method is called during the creation of the sign-in profile
// itself. Using ProfileHelper::GetSigninProfileDir() is safe because it does
@@ -118,7 +119,7 @@
std::unique_ptr<IdentityProvider> identity_provider;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
if (user_manager::UserManager::IsInitialized() &&
@@ -127,7 +128,7 @@
identity_provider = std::make_unique<DeviceIdentityProvider>(
DeviceOAuth2TokenServiceFactory::Get());
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
Profile* profile = Profile::FromBrowserContext(context);
diff --git a/chrome/browser/lite_video/lite_video_keyed_service_browsertest.cc b/chrome/browser/lite_video/lite_video_keyed_service_browsertest.cc
index 5a18f416..1b28068 100644
--- a/chrome/browser/lite_video/lite_video_keyed_service_browsertest.cc
+++ b/chrome/browser/lite_video/lite_video_keyed_service_browsertest.cc
@@ -10,6 +10,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/browser_process.h"
#include "chrome/browser/lite_video/lite_video_features.h"
#include "chrome/browser/lite_video/lite_video_hint.h"
@@ -242,7 +243,7 @@
}
// Fails occasionally on ChromeOS. http://crbug.com/1102563
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_LiteVideoCanApplyLiteVideo_NoHintForHost \
DISABLED_LiteVideoCanApplyLiteVideo_NoHintForHost
#else
diff --git a/chrome/browser/loader/signed_exchange_policy_browsertest.cc b/chrome/browser/loader/signed_exchange_policy_browsertest.cc
index dc18c8a..dd48fb6c 100644
--- a/chrome/browser/loader/signed_exchange_policy_browsertest.cc
+++ b/chrome/browser/loader/signed_exchange_policy_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -76,7 +77,7 @@
policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
blacklist.Clone(), nullptr);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
policy::SetEnterpriseUsersDefaults(&policies);
#endif
policy_provider_.UpdateChromePolicy(policies);
diff --git a/chrome/browser/logging_chrome_unittest.cc b/chrome/browser/logging_chrome_unittest.cc
index f65e1415..d1b532e0 100644
--- a/chrome/browser/logging_chrome_unittest.cc
+++ b/chrome/browser/logging_chrome_unittest.cc
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/logging_chrome.h"
#include "content/public/common/content_switches.h"
@@ -90,7 +91,7 @@
RestoreEnvironmentVariable();
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ChromeLoggingTest, TimestampedName) {
base::FilePath path = base::FilePath(FILE_PATH_LITERAL("xy.zzy"));
base::FilePath timestamped_path =
@@ -155,4 +156,4 @@
::testing::MatchesRegex("^.*chrome-test-log_\\d+-\\d+$"));
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/memory/chrome_browser_main_extra_parts_memory.cc b/chrome/browser/memory/chrome_browser_main_extra_parts_memory.cc
index 20a9adb2..9988d55 100644
--- a/chrome/browser/memory/chrome_browser_main_extra_parts_memory.cc
+++ b/chrome/browser/memory/chrome_browser_main_extra_parts_memory.cc
@@ -6,10 +6,11 @@
#include "base/memory/memory_pressure_monitor.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/memory/enterprise_memory_limit_pref_observer.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/logging.h"
#include "base/system/sys_info.h"
#include "chromeos/memory/pressure/system_memory_pressure_evaluator.h"
@@ -29,7 +30,7 @@
g_browser_process->local_state());
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::SysInfo::IsRunningOnChromeOS()) {
cros_evaluator_ =
std::make_unique<chromeos::memory::SystemMemoryPressureEvaluator>(
@@ -47,7 +48,7 @@
// pref_service.
memory_limit_pref_observer_.reset();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
cros_evaluator_.reset();
#endif
}
diff --git a/chrome/browser/memory/chrome_browser_main_extra_parts_memory.h b/chrome/browser/memory/chrome_browser_main_extra_parts_memory.h
index 57ffacf..1c8b902 100644
--- a/chrome/browser/memory/chrome_browser_main_extra_parts_memory.h
+++ b/chrome/browser/memory/chrome_browser_main_extra_parts_memory.h
@@ -8,9 +8,10 @@
#include <memory>
#include "base/macros.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
namespace chromeos {
namespace memory {
class SystemMemoryPressureEvaluator;
@@ -42,7 +43,7 @@
std::unique_ptr<memory::EnterpriseMemoryLimitPrefObserver>
memory_limit_pref_observer_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<chromeos::memory::SystemMemoryPressureEvaluator>
cros_evaluator_;
#endif
diff --git a/chrome/browser/memory/oom_memory_details.cc b/chrome/browser/memory/oom_memory_details.cc
index 81e0af8..2919d43 100644
--- a/chrome/browser/memory/oom_memory_details.cc
+++ b/chrome/browser/memory/oom_memory_details.cc
@@ -35,7 +35,7 @@
// These logs are collected by user feedback reports. We want them to help
// diagnose user-reported problems with frequently discarded tabs.
std::string log_string = ToLogString(/*include_tab_title=*/false);
-#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
base::GraphicsMemoryInfoKB gpu_meminfo;
if (base::GetGraphicsMemoryInfo(&gpu_meminfo)) {
log_string +=
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index c2ae7f5f..38520cf2 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -16,6 +16,7 @@
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/common/process_type.h"
namespace memory_instrumentation {
@@ -141,7 +142,7 @@
// Returns a pointer to the ProcessData structure for Chrome.
ProcessData* ChromeBrowser();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const base::SwapInfo& swap_info() const { return swap_info_; }
#endif
@@ -172,7 +173,7 @@
std::vector<ProcessData> process_data_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::SwapInfo swap_info_;
#endif
diff --git a/chrome/browser/memory_details_linux.cc b/chrome/browser/memory_details_linux.cc
index 090e05f7..a1360023 100644
--- a/chrome/browser/memory_details_linux.cc
+++ b/chrome/browser/memory_details_linux.cc
@@ -21,6 +21,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "content/public/browser/browser_task_traits.h"
@@ -137,7 +138,7 @@
process_data_.push_back(current_browser);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::GetSwapInfo(&swap_info_);
#endif
diff --git a/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc b/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc
index c5b5dc9..5abe450 100644
--- a/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc
+++ b/chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/process/process.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/ppapi/ppapi_test.h"
#include "components/nacl/browser/nacl_browser.h"
@@ -82,7 +83,8 @@
#if defined(ADDRESS_SANITIZER)
# define MAYBE_Breakpoint DISABLED_Breakpoint
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
+#elif (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+ defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux: http://crbug.com/238469
# define MAYBE_Breakpoint DISABLED_Breakpoint
#else
diff --git a/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc b/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc
index d864ea47..3620dda 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/navigation_predictor/navigation_predictor.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service_factory.h"
@@ -263,7 +264,7 @@
// Disabled because it fails when SingleProcessMash feature is enabled. Since
// Navigation Predictor is not going to be enabled on Chrome OS, disabling the
// browser test on that platform is fine.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_CHROMEOS(x) x
diff --git a/chrome/browser/navigation_predictor/navigation_predictor_renderer_warmup_client_browsertest.cc b/chrome/browser/navigation_predictor/navigation_predictor_renderer_warmup_client_browsertest.cc
index 5241b482..2a602984 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor_renderer_warmup_client_browsertest.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor_renderer_warmup_client_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -31,7 +32,7 @@
}
// Occasional flakes on Windows (https://crbug.com/1045971).
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/net/profile_network_context_service_browsertest.cc b/chrome/browser/net/profile_network_context_service_browsertest.cc
index 4b55e9e69..d422868 100644
--- a/chrome/browser/net/profile_network_context_service_browsertest.cc
+++ b/chrome/browser/net/profile_network_context_service_browsertest.cc
@@ -69,7 +69,7 @@
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/constants/chromeos_features.h"
#endif
@@ -657,7 +657,7 @@
::testing::Bool());
#endif // BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
class ProfileNetworkContextServiceMemoryPressureFeatureBrowsertest
: public ProfileNetworkContextServiceBrowsertest,
public ::testing::WithParamInterface<base::Optional<bool>> {
@@ -710,4 +710,4 @@
ProfileNetworkContextServiceMemoryPressureFeatureBrowsertest,
/*disable_idle_sockets_close_on_memory_pressure=*/
::testing::Values(base::nullopt, true, false));
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc b/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc
index 4d5b404..18688e5 100644
--- a/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc
+++ b/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc
@@ -16,6 +16,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/browser_process.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
@@ -551,7 +552,7 @@
// Issues with multiple profiles likely cause the site engagement service-based
// tests to flake.
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc
index e482b31a..027267b 100644
--- a/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc
+++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc
@@ -8,6 +8,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/browser_process.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_hints_manager.h"
@@ -313,7 +314,7 @@
// ChromeOS has multiple profiles and optimization guide currently does not
// run on non-Android.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
histogram_tester()->ExpectUniqueSample(
"OptimizationGuide.RemoteFetchingEnabled", false, 1);
EXPECT_TRUE(IsInSyntheticTrialGroup(
@@ -609,7 +610,7 @@
// ChromeOS has multiple profiles and optimization guide currently does not
// run on non-Android.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
histogram_tester()->ExpectUniqueSample(
"OptimizationGuide.RemoteFetchingEnabled", true, 1);
EXPECT_TRUE(IsInSyntheticTrialGroup(
@@ -643,7 +644,7 @@
// ChromeOS has multiple profiles and optimization guide currently does not
// run on non-Android.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
histogram_tester()->ExpectUniqueSample(
"OptimizationGuide.RemoteFetchingEnabled", true, 1);
EXPECT_TRUE(IsInSyntheticTrialGroup(
diff --git a/chrome/browser/optimization_guide/prediction/prediction_manager_browsertest.cc b/chrome/browser/optimization_guide/prediction/prediction_manager_browsertest.cc
index 25560f6..77e6841 100644
--- a/chrome/browser/optimization_guide/prediction/prediction_manager_browsertest.cc
+++ b/chrome/browser/optimization_guide/prediction/prediction_manager_browsertest.cc
@@ -11,6 +11,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/browser_process.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
@@ -451,7 +452,7 @@
}
};
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/optimization_guide/prediction/prediction_manager_unittest.cc b/chrome/browser/optimization_guide/prediction/prediction_manager_unittest.cc
index 935e8ad1..5b03fba 100644
--- a/chrome/browser/optimization_guide/prediction/prediction_manager_unittest.cc
+++ b/chrome/browser/optimization_guide/prediction/prediction_manager_unittest.cc
@@ -14,6 +14,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/optimization_guide/optimization_guide_navigation_data.h"
#include "chrome/browser/optimization_guide/optimization_guide_web_contents_observer.h"
#include "chrome/browser/optimization_guide/prediction/prediction_model_download_manager.h"
@@ -616,7 +617,7 @@
};
// No support for Mac, Windows or ChromeOS.
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/page_load_metrics/observers/signed_exchange_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/signed_exchange_page_load_metrics_observer_unittest.cc
index e7ddeee..5e6afc4 100644
--- a/chrome/browser/page_load_metrics/observers/signed_exchange_page_load_metrics_observer_unittest.cc
+++ b/chrome/browser/page_load_metrics/observers/signed_exchange_page_load_metrics_observer_unittest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h"
#include "components/page_load_metrics/browser/page_load_tracker.h"
#include "components/page_load_metrics/common/test/page_load_metrics_test_util.h"
@@ -318,7 +319,10 @@
}
// Test is flaky on linux_tsan: crbug.com:1082135.
-#if defined(OS_LINUX) && defined(THREAD_SANITIZER)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+ defined(THREAD_SANITIZER)
#define MAYBE_WithSignedExchangeBackground DISABLED_WithSignedExchangeBackground
#else
#define MAYBE_WithSignedExchangeBackground WithSignedExchangeBackground
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
index d154380..3aee84d 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
@@ -24,6 +24,7 @@
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.h"
#include "chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer.h"
#include "chrome/browser/page_load_metrics/observers/document_write_page_load_metrics_observer.h"
@@ -1931,7 +1932,7 @@
SessionStartupPref::SetStartupPref(
profile, SessionStartupPref(SessionStartupPref::LAST));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
SessionServiceTestHelper helper(
SessionServiceFactory::GetForProfile(profile));
helper.SetForceBrowserNotAliveWithNoWindows(true);
diff --git a/chrome/browser/payments/BUILD.gn b/chrome/browser/payments/BUILD.gn
index e65c431..9bf4978 100644
--- a/chrome/browser/payments/BUILD.gn
+++ b/chrome/browser/payments/BUILD.gn
@@ -2,6 +2,8 @@
# 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")
+
source_set("browser_tests") {
testonly = true
@@ -37,6 +39,7 @@
deps = [
"//base/test:test_support",
+ "//build:chromeos_buildflags",
"//chrome/test:test_support",
"//chrome/test/payments:test_support",
"//components/payments/content",
@@ -71,7 +74,7 @@
]
}
- if (is_chromeos) {
+ if (is_chromeos_ash) {
deps += [ "//ash/public/cpp/external_arc:external_arc" ]
}
}
diff --git a/chrome/browser/payments/android_payment_app_factory_browsertest.cc b/chrome/browser/payments/android_payment_app_factory_browsertest.cc
index 876a63c..58efbcd 100644
--- a/chrome/browser/payments/android_payment_app_factory_browsertest.cc
+++ b/chrome/browser/payments/android_payment_app_factory_browsertest.cc
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(OS_CHROMEOS)
+#include "build/chromeos_buildflags.h"
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/external_arc/overlay/arc_overlay_manager.h"
#endif
#include "base/test/scoped_feature_list.h"
@@ -48,7 +50,7 @@
// goods purchase.
IN_PROC_BROWSER_TEST_F(AndroidPaymentAppFactoryTest,
IgnoreOtherPaymentAppsInTwaWhenHaveAppStoreBilling) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ash::ArcOverlayManager overlay_manager_;
#endif
@@ -71,11 +73,11 @@
test_controller()->SetTwaPaymentApp("https://play.google.com/billing",
"{\"status\": \"" + response + "\"}");
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::string expected_response = response;
#else
std::string expected_response = "success";
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
NavigateTo("b.com", "/payment_handler_status.html");
ASSERT_EQ(expected_response,
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc
index ec4904a..dbe37e4f 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -9,6 +9,7 @@
#include "base/check_op.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/autofill/address_normalizer_factory.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/autofill/validation_rules_storage_factory.h"
@@ -42,9 +43,9 @@
#include "third_party/libaddressinput/chromium/chrome_metadata_source.h"
#include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/apps/apk_web_app_service.h"
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace payments {
@@ -261,7 +262,7 @@
}
std::string ChromePaymentRequestDelegate::GetTwaPackageName() const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
auto* rfh = content::RenderFrameHost::FromID(frame_routing_id_);
if (!rfh || !rfh->IsCurrent())
return "";
@@ -279,7 +280,7 @@
return twa_package_name.has_value() ? twa_package_name.value() : "";
#else
return "";
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
PaymentRequestDialog* ChromePaymentRequestDelegate::GetDialogForTesting() {
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index fd0d78b..5e75a7c9 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -30,6 +30,7 @@
#include "base/threading/thread_restrictions.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/extensions/component_loader.h"
@@ -1038,7 +1039,7 @@
RunTestsInJsModule("redirects_fail_test.js", "test.pdf");
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, Printing) {
RunTestsInJsModule("printing_icon_test.js", "test.pdf");
}
@@ -1059,7 +1060,7 @@
// elements without loading a PDF is difficult.
RunTestsInJsModule("annotations_toolbar_test.js", "test.pdf");
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
INSTANTIATE_TEST_SUITE_P(/* no prefix */, PDFExtensionJSTest, testing::Bool());
@@ -2156,7 +2157,9 @@
// Runs `action` and checks the Linux selection clipboard contains `expected`.
void DoActionAndCheckSelectionClipboard(base::OnceClosure action,
const std::string& expected) {
-#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)
DoActionAndCheckClipboard(std::move(action),
ui::ClipboardBuffer::kSelection, expected);
#else
@@ -2286,7 +2289,9 @@
}
// Flaky on ChromeOS (https://crbug.com/1121446)
-#if defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_CombinedShiftArrowPresses DISABLED_CombinedShiftArrowPresses
#else
#define MAYBE_CombinedShiftArrowPresses CombinedShiftArrowPresses
@@ -2442,7 +2447,7 @@
}
// Flaky on ChromeOS (https://crbug.com/922974)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_TouchscreenPinchInvokesCustomZoom \
DISABLED_TouchscreenPinchInvokesCustomZoom
#else
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
index a6d491e7..398404c8 100644
--- a/chrome/browser/pdf/pdf_extension_util.cc
+++ b/chrome/browser/pdf/pdf_extension_util.cc
@@ -6,6 +6,7 @@
#include "base/strings/string_util.h"
#include "base/values.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/grit/browser_resources.h"
@@ -17,9 +18,9 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/web_ui_util.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace pdf_extension_util {
@@ -72,7 +73,7 @@
{"tooltipRotateCW", IDS_PDF_TOOLTIP_ROTATE_CW},
{"tooltipThumbnails", IDS_PDF_TOOLTIP_THUMBNAILS},
{"zoomTextInputAriaLabel", IDS_PDF_ZOOM_TEXT_INPUT_ARIA_LABEL},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
{"tooltipAnnotate", IDS_PDF_ANNOTATION_ANNOTATE},
{"annotationDocumentTooLarge", IDS_PDF_ANNOTATION_DOCUMENT_TOO_LARGE},
{"annotationDocumentProtected", IDS_PDF_ANNOTATION_DOCUMENT_PROTECTED},
@@ -129,12 +130,12 @@
{"annotationFormWarningDetail", IDS_PDF_DISCARD_FORM_CHANGES_DETAIL},
{"annotationFormWarningKeepEditing", IDS_PDF_KEEP_EDITING},
{"annotationFormWarningDiscard", IDS_PDF_DISCARD},
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
};
for (const auto& resource : kPdfResources)
dict->SetStringKey(resource.name, l10n_util::GetStringUTF16(resource.id));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::string16 edit_string = l10n_util::GetStringUTF16(IDS_EDIT);
base::Erase(edit_string, '&');
dict->SetStringKey("editButton", edit_string);
@@ -185,11 +186,11 @@
bool enable_printing = true;
bool enable_annotations = false;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// For Chrome OS, enable printing only if we are not at OOBE.
enable_printing = !chromeos::LoginDisplayHost::default_host();
enable_annotations = true;
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
dict->SetKey("printingEnabled", base::Value(enable_printing));
dict->SetKey("pdfAnnotationsEnabled", base::Value(enable_annotations));
}
diff --git a/chrome/browser/permissions/chrome_permission_request_manager_unittest.cc b/chrome/browser/permissions/chrome_permission_request_manager_unittest.cc
index 1d68e5f..1da3082 100644
--- a/chrome/browser/permissions/chrome_permission_request_manager_unittest.cc
+++ b/chrome/browser/permissions/chrome_permission_request_manager_unittest.cc
@@ -15,6 +15,7 @@
#include "base/test/simple_test_clock.h"
#include "base/util/values/values_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/permissions/adaptive_quiet_notification_permission_ui_enabler.h"
#include "chrome/browser/permissions/quiet_notification_permission_ui_config.h"
@@ -40,7 +41,7 @@
#include "components/user_manager/scoped_user_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/app_mode/web_app/web_kiosk_app_manager.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#endif
@@ -113,7 +114,7 @@
manager_->NavigationEntryCommitted(details);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<permissions::MockPermissionRequest> MakeRequestInWebKioskMode(
const GURL& url,
const GURL& app_url) {
@@ -638,7 +639,7 @@
recorded_time);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ChromePermissionRequestManagerTest, TestWebKioskModeSameOrigin) {
auto request =
MakeRequestInWebKioskMode(/*url*/ GURL("https://google.com/page"),
@@ -659,4 +660,4 @@
EXPECT_FALSE(request->granted());
EXPECT_TRUE(request->finished());
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/permissions/chrome_permissions_client.cc b/chrome/browser/permissions/chrome_permissions_client.cc
index 38193575..3b123183 100644
--- a/chrome/browser/permissions/chrome_permissions_client.cc
+++ b/chrome/browser/permissions/chrome_permissions_client.cc
@@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/bluetooth/bluetooth_chooser_context.h"
#include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
@@ -52,7 +53,7 @@
#include "chrome/browser/ui/permission_bubble/permission_prompt.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/app_mode/web_app/web_kiosk_app_data.h"
#include "chrome/browser/chromeos/app_mode/web_app/web_kiosk_app_manager.h"
#include "components/user_manager/user.h"
@@ -156,7 +157,7 @@
}
}
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
// Some Google-affiliated domains are not allowed to delete cookies for
// supervised accounts.
bool ChromePermissionsClient::IsCookieDeletionDisabled(
@@ -191,7 +192,7 @@
permissions::PermissionRequest::IconId
ChromePermissionsClient::GetOverrideIconId(ContentSettingsType type) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(xhwang): fix this icon, see crbug.com/446263.
if (type == ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER)
return kProductIcon;
@@ -263,7 +264,7 @@
}
base::Optional<url::Origin> ChromePermissionsClient::GetAutoApprovalOrigin() {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// In web kiosk mode, all permission requests are auto-approved for the origin
// of the main app.
if (user_manager::UserManager::IsInitialized() &&
diff --git a/chrome/browser/permissions/chrome_permissions_client.h b/chrome/browser/permissions/chrome_permissions_client.h
index f386781..b39b21b 100644
--- a/chrome/browser/permissions/chrome_permissions_client.h
+++ b/chrome/browser/permissions/chrome_permissions_client.h
@@ -7,6 +7,7 @@
#include "base/no_destructor.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "components/permissions/permissions_client.h"
class ChromePermissionsClient : public permissions::PermissionsClient {
@@ -32,7 +33,7 @@
void AreSitesImportant(
content::BrowserContext* browser_context,
std::vector<std::pair<url::Origin, bool>>* urls) override;
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
bool IsCookieDeletionDisabled(content::BrowserContext* browser_context,
const GURL& origin) override;
#endif
diff --git a/chrome/browser/permissions/permission_manager_factory.cc b/chrome/browser/permissions/permission_manager_factory.cc
index 84074108..630ff22 100644
--- a/chrome/browser/permissions/permission_manager_factory.cc
+++ b/chrome/browser/permissions/permission_manager_factory.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/accessibility_permission_context.h"
#include "chrome/browser/background_fetch/background_fetch_permission_context.h"
#include "chrome/browser/background_sync/periodic_background_sync_permission_context.h"
@@ -37,8 +38,7 @@
#include "components/permissions/permission_manager.h"
#include "ppapi/buildflags/buildflags.h"
-
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/media/protected_media_identifier_permission_context.h"
#endif
@@ -74,7 +74,7 @@
std::make_unique<GeolocationPermissionContextDelegateAndroid>(
profile));
#endif
-#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
permission_contexts[ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER] =
std::make_unique<ProtectedMediaIdentifierPermissionContext>(profile);
#endif
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
index b872cc4..ffe7d58 100644
--- a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
@@ -10,6 +10,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/chrome_content_browser_client.h"
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
@@ -53,7 +54,7 @@
#include "ui/views/controls/button/image_button.h"
#include "ui/views/widget/widget_observer.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/accelerators.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/hit_test.h"
@@ -226,7 +227,7 @@
auto* overlay_window = window_controller()->GetWindowForTesting();
gfx::NativeWindow native_window =
static_cast<OverlayWindowViews*>(overlay_window)->GetNativeWindow();
-#if defined(OS_CHROMEOS) || defined(OS_MAC)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC)
EXPECT_FALSE(platform_util::IsWindowActive(native_window));
#else
EXPECT_TRUE(platform_util::IsWindowActive(native_window));
@@ -234,7 +235,7 @@
#endif
}
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
class PictureInPicturePixelComparisonBrowserTest
: public PictureInPictureWindowControllerBrowserTest {
public:
@@ -434,7 +435,7 @@
ASSERT_TRUE(ReadImageFile(expected_play_image_path, &expected_image));
EXPECT_TRUE(CompareImages(GetResultBitmap(), expected_image));
}
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
// Tests that when an active WebContents accurately tracks whether a video
// is in Picture-in-Picture.
@@ -1288,7 +1289,9 @@
// Tests that when a new surface id is sent to the Picture-in-Picture window, it
// doesn't move back to its default position.
// TODO(crbug.com/1146047): Test is flaky on Linux.
-#if defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_SurfaceIdChangeDoesNotMoveWindow DISABLED_SurfaceIdChangeDoesNotMoveWindow
#else
#define MAYBE_SurfaceIdChangeDoesNotMoveWindow SurfaceIdChangeDoesNotMoveWindow
@@ -1578,7 +1581,7 @@
DevToolsWindowTesting::CloseDevToolsWindowSync(window);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Tests that video in Picture-in-Picture is paused when user presses
// VKEY_MEDIA_PLAY_PAUSE key even if there's another media playing in a
// foreground tab.
@@ -1730,7 +1733,7 @@
EXPECT_EQ(HTBOTTOMRIGHT, overlay_window_views->GetResizeHTComponent());
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Tests that the Play/Pause button is displayed appropriately in the
// Picture-in-Picture window.
@@ -2098,7 +2101,9 @@
// Tests that a Previous Track button is displayed in the Picture-in-Picture
// window when Media Session Action "previoustrack" is handled by the website.
// TODO(crbug.com/985303): Flaky on Linux.
-#if defined(OS_LINUX)
+// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
+// complete.
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_PreviousTrackButtonVisibility \
DISABLED_PreviousTrackButtonVisibility
#else
diff --git a/chrome/browser/platform_util_unittest.cc b/chrome/browser/platform_util_unittest.cc
index ac68307..6b81370 100644
--- a/chrome/browser/platform_util_unittest.cc
+++ b/chrome/browser/platform_util_unittest.cc
@@ -13,10 +13,11 @@
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/platform_util_internal.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/json/json_string_value_serializer.h"
#include "base/values.h"
#include "chrome/browser/chrome_content_browser_client.h"
@@ -40,7 +41,7 @@
namespace {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeContentBrowserClient subclass that sets up a custom file system backend
// that allows the test to grant file access to the file manager extension ID
@@ -248,7 +249,7 @@
};
#endif // OS_POSIX
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeOS doesn't follow symbolic links in sandboxed filesystems. So all the
// symbolic link tests should return PATH_NOT_FOUND.
@@ -277,9 +278,9 @@
EXPECT_EQ(OPEN_FAILED_NO_HANLDER_FOR_FILE_TYPE,
CallOpenItem(unhandled_file, OPEN_FILE));
}
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if defined(OS_POSIX) && !defined(OS_CHROMEOS)
+#if defined(OS_POSIX) && !BUILDFLAG(IS_CHROMEOS_ASH)
// On all other Posix platforms, the symbolic link tests should work as
// expected.
diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser/plugins/plugins_resource_service.cc
index 8a123eb..dea3c4f 100644
--- a/chrome/browser/plugins/plugins_resource_service.cc
+++ b/chrome/browser/plugins/plugins_resource_service.cc
@@ -7,6 +7,7 @@
#include "base/bind.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/net/system_network_context_manager.h"
#include "chrome/browser/plugins/plugin_finder.h"
@@ -59,9 +60,9 @@
std::string filename;
#if defined(OS_WIN)
filename = "plugins_win.json";
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
filename = "plugins_chromeos.json";
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
filename = "plugins_linux.json";
#elif defined(OS_MAC)
filename = "plugins_mac.json";
diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc
index e106657..75bd165 100644
--- a/chrome/browser/policy/policy_prefs_browsertest.cc
+++ b/chrome/browser/policy/policy_prefs_browsertest.cc
@@ -17,6 +17,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/run_loop.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -33,9 +34,9 @@
#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/profiles/profile_helper.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace policy {
@@ -95,7 +96,7 @@
kCrosSettingsPrefix);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Class used to check policy to pref mappings for policies that are mapped into
// the sign-in profile (usually via LoginProfilePolicyProvider).
@@ -125,7 +126,7 @@
&provider_, kCrosSettingsPrefix);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// For WebUI integration tests, see cr_policy_indicator_tests.js and
// cr_policy_pref_indicator_tests.js.
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
index 70a692a..da263fb3 100644
--- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
+++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
@@ -19,6 +19,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/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -411,7 +412,7 @@
} // namespace
// Occasional flakes on Windows (https://crbug.com/1045971).
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.cc
index e13e488..e39169b6 100644
--- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.cc
+++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "build/chromeos_buildflags.h"
#include "mojo/public/cpp/bindings/remote.h"
PrefetchProxyNetworkContextClient::PrefetchProxyNetworkContextClient() =
@@ -94,7 +95,7 @@
}
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
void PrefetchProxyNetworkContextClient::OnTrustAnchorUsed() {}
#endif
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.h b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.h
index e2175df7..0e1e30f 100644
--- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.h
+++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context_client.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_PREFETCH_PREFETCH_PROXY_PREFETCH_PROXY_NETWORK_CONTEXT_CLIENT_H_
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/network/public/mojom/network_context.mojom.h"
@@ -69,7 +70,7 @@
const std::string& spn,
OnGenerateHttpNegotiateAuthTokenCallback callback) override;
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
void OnTrustAnchorUsed() override;
#endif
void OnTrustTokenIssuanceDivertedToSystem(
diff --git a/chrome/browser/previews/previews_test_util.h b/chrome/browser/previews/previews_test_util.h
index fd272cf6..2ba8be5 100644
--- a/chrome/browser/previews/previews_test_util.h
+++ b/chrome/browser/previews/previews_test_util.h
@@ -9,6 +9,7 @@
#include "base/test/metrics/histogram_tester.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/ui/browser.h"
@@ -36,7 +37,7 @@
// Previews InfoBar (which these tests trigger) does not work on Mac.
// See https://crbug.com/782322 for details. Also occasional flakes on win7
// (https://crbug.com/789542).
-#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) DISABLED_##x
#else
#define DISABLE_ON_WIN_MAC_CHROMEOS(x) x
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index 2bdc8ea..137fa56 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -98,7 +98,8 @@
#include "chrome/browser/ui/process_singleton_dialog_linux.h"
#endif
-#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(TOOLKIT_VIEWS) && \
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "ui/views/linux_ui/linux_ui.h"
#endif
@@ -871,7 +872,8 @@
SendRemoteProcessInteractionResultHistogram(REMOTE_PROCESS_SHUTTING_DOWN);
return PROCESS_NONE;
} else if (strncmp(buf, kACKToken, base::size(kACKToken) - 1) == 0) {
-#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(TOOLKIT_VIEWS) && \
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
// Likely NULL in unit tests.
views::LinuxUI* linux_ui = views::LinuxUI::instance();
if (linux_ui)
diff --git a/chrome/browser/push_messaging/push_messaging_notification_manager.cc b/chrome/browser/push_messaging/push_messaging_notification_manager.cc
index daaec7c..3133819 100644
--- a/chrome/browser/push_messaging/push_messaging_notification_manager.cc
+++ b/chrome/browser/push_messaging/push_messaging_notification_manager.cc
@@ -16,6 +16,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/notifications/platform_notification_service_factory.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
@@ -50,7 +51,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/android_sms/android_sms_service_factory.h"
#include "chrome/browser/chromeos/android_sms/android_sms_urls.h"
#include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_client_factory.h"
@@ -109,7 +110,7 @@
EnforceRequirementsCallback message_handled_callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ShouldSkipUserVisibleOnlyRequirements(origin)) {
std::move(message_handled_callback)
.Run(/* did_show_generic_notification= */ false);
@@ -285,7 +286,7 @@
.Run(/* did_show_generic_notification= */ true);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool PushMessagingNotificationManager::ShouldSkipUserVisibleOnlyRequirements(
const GURL& origin) {
// This is a short-term exception to user visible only enforcement added
diff --git a/chrome/browser/push_messaging/push_messaging_notification_manager.h b/chrome/browser/push_messaging/push_messaging_notification_manager.h
index 425c7ec..7f7de31 100644
--- a/chrome/browser/push_messaging/push_messaging_notification_manager.h
+++ b/chrome/browser/push_messaging/push_messaging_notification_manager.h
@@ -12,9 +12,10 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/push_messaging/budget_database.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/android_sms/android_sms_app_manager.h"
#include "chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client.h"
#endif
@@ -85,7 +86,7 @@
bool success,
const std::string& notification_id);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool ShouldSkipUserVisibleOnlyRequirements(const GURL& origin);
void SetTestMultiDeviceSetupClient(
@@ -101,7 +102,7 @@
BudgetDatabase budget_database_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::multidevice_setup::MultiDeviceSetupClient*
test_multidevice_setup_client_ = nullptr;
diff --git a/chrome/browser/push_messaging/push_messaging_notification_manager_unittest.cc b/chrome/browser/push_messaging/push_messaging_notification_manager_unittest.cc
index 1dcbf41..56a1076 100644
--- a/chrome/browser/push_messaging/push_messaging_notification_manager_unittest.cc
+++ b/chrome/browser/push_messaging/push_messaging_notification_manager_unittest.cc
@@ -4,15 +4,16 @@
#include "chrome/browser/push_messaging/push_messaging_notification_manager.h"
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "base/bind.h"
+#include "build/chromeos_buildflags.h"
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/android_sms/fake_android_sms_app_manager.h"
#include "chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h"
#endif
@@ -53,7 +54,7 @@
EXPECT_FALSE(manager.IsTabVisible(profile(), web_contents(), origin));
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PushMessagingNotificationManagerTest,
SkipEnforceUserVisibleOnlyRequirementsForAndroidMessages) {
GURL app_url("https://example.com/test/");
diff --git a/chrome/browser/push_messaging/push_messaging_service_factory.cc b/chrome/browser/push_messaging/push_messaging_service_factory.cc
index 8013e9a2..b77faa81 100644
--- a/chrome/browser/push_messaging/push_messaging_service_factory.cc
+++ b/chrome/browser/push_messaging/push_messaging_service_factory.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/engagement/site_engagement_service_factory.h"
#include "chrome/browser/gcm/gcm_profile_service_factory.h"
@@ -19,7 +20,7 @@
#include "components/gcm_driver/instance_id/instance_id_profile_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/android_sms/android_sms_service_factory.h"
#include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_client_factory.h"
#endif
@@ -50,7 +51,7 @@
DependsOn(HostContentSettingsMapFactory::GetInstance());
DependsOn(PermissionManagerFactory::GetInstance());
DependsOn(SiteEngagementServiceFactory::GetInstance());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
DependsOn(chromeos::android_sms::AndroidSmsServiceFactory::GetInstance());
DependsOn(chromeos::multidevice_setup::MultiDeviceSetupClientFactory::
GetInstance());
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
index ed40422a..399f3b9 100644
--- a/chrome/browser/renderer_preferences_util.cc
+++ b/chrome/browser/renderer_preferences_util.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.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"
@@ -34,7 +35,7 @@
#include "ui/base/cocoa/defaults_utils.h"
#endif
-#if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "ui/views/linux_ui/linux_ui.h"
@@ -134,7 +135,7 @@
pref_service->GetBoolean(prefs::kWebRTCAllowLegacyTLSProtocols);
#if defined(USE_AURA)
prefs->focus_ring_color = SkColorSetRGB(0x4D, 0x90, 0xFE);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// This color is 0x544d90fe modulated with 0xffffff.
prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA);
prefs->active_selection_fg_color = SK_ColorBLACK;
@@ -153,7 +154,7 @@
prefs->caret_blink_interval = interval;
#endif
-#if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
views::LinuxUI* linux_ui = views::LinuxUI::instance();
if (linux_ui) {
if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) {
diff --git a/chrome/browser/resources_util.cc b/chrome/browser/resources_util.cc
index a5701567..88e0b09 100644
--- a/chrome/browser/resources_util.cc
+++ b/chrome/browser/resources_util.cc
@@ -11,11 +11,12 @@
#include "base/containers/flat_map.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/grit/theme_resources_map.h"
#include "components/grit/components_scaled_resources_map.h"
#include "ui/resources/grit/ui_resources_map.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/chromeos/resources/grit/ui_chromeos_resources_map.h"
#endif
@@ -31,7 +32,7 @@
ThemeMap() {
size_t storage_size =
kComponentsScaledResourcesSize + kThemeResourcesSize + kUiResourcesSize;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
storage_size += kUiChromeosResourcesSize;
#endif
@@ -49,7 +50,7 @@
for (size_t i = 0; i < kUiResourcesSize; ++i) {
storage.emplace_back(kUiResources[i].name, kUiResources[i].value);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
for (size_t i = 0; i < kUiChromeosResourcesSize; ++i) {
storage.emplace_back(kUiChromeosResources[i].name,
kUiChromeosResources[i].value);
diff --git a/chrome/browser/resources_util_unittest.cc b/chrome/browser/resources_util_unittest.cc
index 0f7059b3..73fc01e 100644
--- a/chrome/browser/resources_util_unittest.cc
+++ b/chrome/browser/resources_util_unittest.cc
@@ -8,11 +8,12 @@
#include "base/stl_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "components/grit/components_scaled_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/resources/grit/ui_resources.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/chromeos/resources/grit/ui_chromeos_resources.h"
#endif
@@ -25,7 +26,7 @@
{"IDR_ERROR_NETWORK_GENERIC", IDR_ERROR_NETWORK_GENERIC},
// IDRs from ui/resources/ui_resources.grd should be valid.
{"IDR_DEFAULT_FAVICON", IDR_DEFAULT_FAVICON},
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Check IDRs from ui/chromeos/resources/ui_chromeos_resources.grd.
{"IDR_LOGIN_DEFAULT_USER", IDR_LOGIN_DEFAULT_USER},
#endif
diff --git a/chrome/browser/rlz/chrome_rlz_tracker_delegate.cc b/chrome/browser/rlz/chrome_rlz_tracker_delegate.cc
index 4eb38c5..0497e2d9 100644
--- a/chrome/browser/rlz/chrome_rlz_tracker_delegate.cc
+++ b/chrome/browser/rlz/chrome_rlz_tracker_delegate.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/notreached.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/google/google_brand.h"
@@ -39,7 +40,7 @@
#include "chrome/installer/util/google_update_settings.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/command_line.h"
#include "chromeos/constants/chromeos_switches.h"
#endif
@@ -53,7 +54,7 @@
user_prefs::PrefRegistrySyncable* registry) {
#if BUILDFLAG(ENABLE_RLZ)
int rlz_ping_delay_seconds = 90;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kRlzPingDelay)) {
// Use a switch for overwriting the default delay because it doesn't seem
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc
index 7cdbc47..5a414ef 100644
--- a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc
+++ b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_data.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/webui_url_constants.h"
@@ -29,7 +30,7 @@
#include "services/network/public/cpp/simple_url_loader.h"
#include "url/gurl.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/signin/chrome_signin_helper.h"
#include "components/signin/core/browser/chrome_connected_header_helper.h"
#include "components/signin/core/browser/signin_header_helper.h"
@@ -164,7 +165,7 @@
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
const GURL api_url_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const bool account_consistency_mirror_required_;
#endif
@@ -181,7 +182,7 @@
LoadDoneCallback callback)
: url_loader_factory_(url_loader_factory),
api_url_(std::move(api_url)),
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
account_consistency_mirror_required_(account_consistency_mirror_required),
#endif
callback_(std::move(callback)) {
@@ -191,7 +192,7 @@
network::ResourceRequest* request) const {
variations::AppendVariationsHeaderUnknownSignedIn(
api_url_, variations::InIncognito::kNo, request);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
signin::ChromeConnectedHeaderHelper chrome_connected_header_helper(
account_consistency_mirror_required_
? signin::AccountConsistencyMethod::kMirror
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc
index d58cdda9..eadde53 100644
--- a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc
+++ b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc
@@ -13,6 +13,7 @@
#include "base/test/mock_callback.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_data.h"
#include "components/signin/core/browser/signin_header_helper.h"
#include "content/public/test/browser_task_environment.h"
@@ -300,7 +301,7 @@
EXPECT_CALL(callback, Run(_, _)).WillOnce(Quit(&loop));
loop.Run();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// On Chrome OS, X-Chrome-Connected header is present, but
// enable_account_consistency is set to false.
std::string header_value;
@@ -338,7 +339,7 @@
loop.Run();
// Make sure mirror account consistency is requested.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// On Chrome OS, X-Chrome-Connected header is present, and
// enable_account_consistency is set to true.
std::string header_value;
diff --git a/chrome/browser/secure_origin_allowlist_browsertest.cc b/chrome/browser/secure_origin_allowlist_browsertest.cc
index 48f7248..972cf15c 100644
--- a/chrome/browser/secure_origin_allowlist_browsertest.cc
+++ b/chrome/browser/secure_origin_allowlist_browsertest.cc
@@ -5,6 +5,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/ssl/security_state_tab_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -128,7 +129,7 @@
TestVariant::kCommandline,
// The legacy policy isn't defined on ChromeOS or Android, so skip tests that
// use it on those platforms.
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
TestVariant::kPolicyOld,
TestVariant::kPolicyOldAndNew,
#endif
diff --git a/chrome/browser/send_tab_to_self/send_tab_to_self_client_service_factory.cc b/chrome/browser/send_tab_to_self/send_tab_to_self_client_service_factory.cc
index 251d3da..8c71202c 100644
--- a/chrome/browser/send_tab_to_self/send_tab_to_self_client_service_factory.cc
+++ b/chrome/browser/send_tab_to_self/send_tab_to_self_client_service_factory.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/memory/singleton.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/notifications/notification_display_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/send_tab_to_self/send_tab_to_self_client_service.h"
@@ -16,7 +17,7 @@
#include "components/send_tab_to_self/send_tab_to_self_model.h"
#include "components/send_tab_to_self/send_tab_to_self_sync_service.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "components/user_manager/user.h"
#endif
@@ -52,7 +53,7 @@
SendTabToSelfSyncService* sync_service =
SendTabToSelfSyncServiceFactory::GetForProfile(profile);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Create SendTabToSelfClientService only for profiles of Gaia users.
// ChromeOS has system level profiles, such as the sign-in profile, or
// users that are not Gaia users, such as public account users. Do not
diff --git a/chrome/browser/serial/chrome_serial_browsertest.cc b/chrome/browser/serial/chrome_serial_browsertest.cc
index 56949b4..eb1a78d 100644
--- a/chrome/browser/serial/chrome_serial_browsertest.cc
+++ b/chrome/browser/serial/chrome_serial_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/command_line.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/serial/serial_chooser_context.h"
#include "chrome/browser/serial/serial_chooser_context_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -54,7 +55,7 @@
// TODO(crbug/1069695): Flaky on linux-chromeos-chrome.
// TODO(crbug/1116072): Flaky on Linux Ozone Tester (X11).
-#if defined(OS_CHROMEOS) || defined(USE_OZONE)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(USE_OZONE)
#define MAYBE_NavigateWithChooserCrossOrigin \
DISABLED_NavigateWithChooserCrossOrigin
#else
diff --git a/chrome/browser/service_process/service_process_control.h b/chrome/browser/service_process/service_process_control.h
index 6ee902d0..07928e54 100644
--- a/chrome/browser/service_process/service_process_control.h
+++ b/chrome/browser/service_process/service_process_control.h
@@ -20,13 +20,14 @@
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
#include "chrome/common/service_process.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/service_manager/public/cpp/interface_provider.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#error "Not supported on ChromeOS"
#endif
diff --git a/chrome/browser/service_sandbox_type.h b/chrome/browser/service_sandbox_type.h
index 374a2163..03c27ae5 100644
--- a/chrome/browser/service_sandbox_type.h
+++ b/chrome/browser/service_sandbox_type.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_SERVICE_SANDBOX_TYPE_H_
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/browser/service_process_host.h"
#include "media/base/media_switches.h"
#include "sandbox/policy/sandbox_type.h"
@@ -153,7 +154,7 @@
}
#endif // !defined(OS_MAC)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// recording::mojom::RecordingService
namespace recording {
namespace mojom {
@@ -169,6 +170,6 @@
content::GetServiceSandboxType<recording::mojom::RecordingService>() {
return sandbox::policy::SandboxType::kVideoCapture;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // CHROME_BROWSER_SERVICE_SANDBOX_TYPE_H_
diff --git a/chrome/browser/sharesheet/share_action.cc b/chrome/browser/sharesheet/share_action.cc
index 599625b9..9dc3f8e4 100644
--- a/chrome/browser/sharesheet/share_action.cc
+++ b/chrome/browser/sharesheet/share_action.cc
@@ -4,7 +4,9 @@
#include "chrome/browser/sharesheet/share_action.h"
-#if defined(OS_CHROMEOS)
+#include "build/chromeos_buildflags.h"
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/services/app_service/public/cpp/intent_util.h"
#endif
@@ -12,7 +14,7 @@
bool ShareAction::ShouldShowAction(const apps::mojom::IntentPtr& intent,
bool contains_hosted_document) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
return !contains_hosted_document && !apps_util::OnlyShareToDrive(intent) &&
apps_util::IsIntentValid(intent);
#else
diff --git a/chrome/browser/sharesheet/sharesheet_action_cache.cc b/chrome/browser/sharesheet/sharesheet_action_cache.cc
index 1502b70..d06bade 100644
--- a/chrome/browser/sharesheet/sharesheet_action_cache.cc
+++ b/chrome/browser/sharesheet/sharesheet_action_cache.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/sharesheet/sharesheet_action_cache.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/sharesheet/share_action.h"
#include "chrome/browser/sharesheet/sharesheet_types.h"
#include "ui/gfx/vector_icon_types.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/nearby_sharing/common/nearby_share_features.h"
#include "chrome/browser/nearby_sharing/sharesheet/nearby_share_action.h"
#include "chrome/browser/sharesheet/drive_share_action.h"
@@ -18,7 +19,7 @@
SharesheetActionCache::SharesheetActionCache() {
// ShareActions will be initialised here by calling AddShareAction.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (base::FeatureList::IsEnabled(features::kNearbySharing)) {
AddShareAction(std::make_unique<NearbyShareAction>());
}
diff --git a/chrome/browser/sharesheet/sharesheet_service_factory.cc b/chrome/browser/sharesheet/sharesheet_service_factory.cc
index 8eeb5e2..bab33d48 100644
--- a/chrome/browser/sharesheet/sharesheet_service_factory.cc
+++ b/chrome/browser/sharesheet/sharesheet_service_factory.cc
@@ -6,15 +6,16 @@
#include <memory>
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sharesheet/sharesheet_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace sharesheet {
@@ -51,7 +52,7 @@
return nullptr;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
if (chromeos::ProfileHelper::IsSigninProfile(profile)) {
return nullptr;
}
@@ -60,7 +61,7 @@
if (profile->IsGuestSession()) {
return chrome::GetBrowserContextOwnInstanceInIncognito(context);
}
-#endif // OS_CHROMEOS
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
diff --git a/chrome/browser/sharing/sharing_handler_registry_impl.cc b/chrome/browser/sharing/sharing_handler_registry_impl.cc
index f10ee16..7a81cdd 100644
--- a/chrome/browser/sharing/sharing_handler_registry_impl.cc
+++ b/chrome/browser/sharing/sharing_handler_registry_impl.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/sharing/sharing_handler_registry_impl.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/sharing/ack_message_handler.h"
#include "chrome/browser/sharing/ping_message_handler.h"
#include "chrome/browser/sharing/sharing_device_registration.h"
@@ -25,8 +26,8 @@
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
#include "chrome/browser/sharing/shared_clipboard/remote_copy_message_handler.h"
-#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
- // defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || defined(OS_MAC) || (defined(OS_LINUX) ||
+ // BUILDFLAG(IS_CHROMEOS_LACROS)) defined(OS_CHROMEOS)
SharingHandlerRegistryImpl::SharingHandlerRegistryImpl(
Profile* profile,
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index 8c29ed98..21e44bf 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -19,6 +19,7 @@
#include "base/task/task_traits.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/policy/policy_path_parser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -27,7 +28,7 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/constants/chromeos_switches.h"
#endif
@@ -149,7 +150,7 @@
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::FilePath profile = cmd_line.GetSwitchValuePath(
chromeos::switches::kLoginProfile);
if (!profile.empty())
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 291251a..c377440d 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -41,6 +41,7 @@
#include "base/threading/thread_restrictions.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/channel_info.h"
@@ -107,7 +108,7 @@
// If |protocol| is empty this function sets Chrome as the default browser,
// otherwise it sets Chrome as the default handler application for |protocol|.
bool SetDefaultWebClient(const std::string& protocol) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
return true;
#else
std::unique_ptr<base::Environment> env(base::Environment::Create());
@@ -140,7 +141,7 @@
// |protocol|.
shell_integration::DefaultWebClientState GetIsDefaultWebClient(
const std::string& protocol) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
return shell_integration::UNKNOWN_DEFAULT;
#else
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
diff --git a/chrome/browser/shell_integration_linux.h b/chrome/browser/shell_integration_linux.h
index 33b1280..ac787c35 100644
--- a/chrome/browser/shell_integration_linux.h
+++ b/chrome/browser/shell_integration_linux.h
@@ -8,12 +8,13 @@
#include <string>
#include "base/files/file_path.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/web_applications/components/web_app_id.h"
#include "chrome/common/buildflags.h"
#include "components/services/app_service/public/cpp/file_handler.h"
#include "url/gurl.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#error shell_integration_linux is for desktop linux only.
#endif
diff --git a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
index 723bd378..d57d8c1 100644
--- a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
+++ b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
@@ -17,6 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/profiles/profile.h"
@@ -62,7 +63,7 @@
#include "ui/gfx/geometry/point.h"
#include "url/gurl.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/test/shell_test_api.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/screen.h"
@@ -1499,7 +1500,7 @@
EXPECT_TRUE(watcher.did_exit_normally());
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// This test verifies that an OOPIF created in a tab on a secondary display
// doesn't initialize its device scale factor based on the primary display.
// Note: This test could probably be expanded to run on all ASH platforms.
diff --git a/chrome/browser/site_isolation/site_per_process_interactive_browsertest.cc b/chrome/browser/site_isolation/site_per_process_interactive_browsertest.cc
index 5b51984..6d75574 100644
--- a/chrome/browser/site_isolation/site_per_process_interactive_browsertest.cc
+++ b/chrome/browser/site_isolation/site_per_process_interactive_browsertest.cc
@@ -9,6 +9,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h"
#include "chrome/browser/ui/browser.h"
@@ -419,7 +420,9 @@
EXPECT_EQ(main_frame, web_contents->GetFocusedFrame());
}
-#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_WIN)
+// 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)) || defined(OS_WIN)
// Ensures that renderers know to advance focus to sibling frames and parent
// frames in the presence of mouse click initiated focus changes.
// Verifies against regression of https://crbug.com/702330
diff --git a/chrome/browser/site_isolation/site_per_process_text_input_browsertest.cc b/chrome/browser/site_isolation/site_per_process_text_input_browsertest.cc
index 9e813d7..1b40583 100644
--- a/chrome/browser/site_isolation/site_per_process_text_input_browsertest.cc
+++ b/chrome/browser/site_isolation/site_per_process_text_input_browsertest.cc
@@ -10,6 +10,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/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
@@ -40,7 +41,9 @@
#include "ui/base/ime/text_input_type.h"
#include "url/gurl.h"
-#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)
#include "ui/base/ime/linux/text_edit_command_auralinux.h"
#include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h"
#endif
@@ -851,7 +854,7 @@
// This test makes sure browser correctly tracks focused editable element inside
// each RenderFrameHost.
// Test is flaky on chromeOS; https://crbug.com/705203.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_TrackingFocusedElementForAllFrames \
DISABLED_TrackingFocusedElementForAllFrames
#else
@@ -900,7 +903,7 @@
// in both cases the test verifies that WebContents is aware whether or not a
// focused editable element exists on the page.
// Test is flaky on ChromeOS. crbug.com/705289
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_TrackPageFocusEditableElement \
DISABLED_TrackPageFocusEditableElement
#else
@@ -942,7 +945,7 @@
// WebContents to clear focused element and verifies that there is no longer
// a focused editable element on the page.
// Test is flaky on ChromeOS; https://crbug.com/705203.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_ClearFocusedElementOnPage DISABLED_ClearFocusedElementOnPage
#else
#define MAYBE_ClearFocusedElementOnPage ClearFocusedElementOnPage
@@ -1106,7 +1109,9 @@
// Ensure that a cross-process subframe can utilize keyboard edit commands.
// See https://crbug.com/640706. This test is Linux-specific, as it relies on
// overriding TextEditKeyBindingsDelegateAuraLinux, which only exists on Linux.
-#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)
IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
SubframeKeyboardEditCommands) {
GURL main_url(embedded_test_server()->GetURL(
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
index 0013511..df830c42 100644
--- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
+++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
@@ -12,6 +12,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/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -34,7 +35,7 @@
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/common/extensions/extension_constants.h"
#endif
@@ -335,7 +336,7 @@
if (disable_built_in_tts_engine_for_testing_)
return false;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
Profile* profile = Profile::FromBrowserContext(browser_context);
// Load the component extensions into this profile.
@@ -354,7 +355,7 @@
if (!browser_context || disable_built_in_tts_engine_for_testing_)
return true;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::vector<content::VoiceData> voices;
GetVoices(browser_context, &voices);
bool saw_google_tts = false;
diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc
index 7bc2770..30068b13 100644
--- a/chrome/browser/speech/extension_api/tts_extension_api.cc
+++ b/chrome/browser/speech/extension_api/tts_extension_api.cc
@@ -14,6 +14,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/values.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/speech/extension_api/tts_engine_extension_api.h"
#include "chrome/browser/speech/extension_api/tts_extension_api_constants.h"
@@ -25,9 +26,9 @@
#include "third_party/blink/public/mojom/speech/speech_synthesis.mojom.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/speech/extension_api/tts_engine_extension_observer_chromeos.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace constants = tts_extension_api_constants;
@@ -363,11 +364,11 @@
registry.RegisterFunction<TtsPauseFunction>();
registry.RegisterFunction<TtsResumeFunction>();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Ensure we're observing newly added engines for the given context.
TtsEngineExtensionObserverChromeOS::GetInstance(
Profile::FromBrowserContext(context));
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
TtsAPI::~TtsAPI() {
diff --git a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc
index a7444ff..8f43d5e 100644
--- a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc
+++ b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/interstitials/chrome_settings_page_helper.h"
@@ -28,7 +29,7 @@
#if defined(OS_WIN)
#include "base/enterprise_util.h"
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#endif
@@ -80,7 +81,7 @@
if (base::IsMachineExternallyManaged()) {
return true;
}
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
if (g_browser_process->platform_part()->browser_policy_connector_chromeos()) {
return true;
}
@@ -319,7 +320,7 @@
#if defined(OS_WIN)
report->SetIsEnterpriseManaged(base::IsMachineExternallyManaged());
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
report->SetIsEnterpriseManaged(g_browser_process->platform_part()
->browser_policy_connector_chromeos()
->IsEnterpriseManaged());
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
index 53cfff38..c11f6e1c 100644
--- a/chrome/browser/ssl/security_state_tab_helper.cc
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
@@ -13,6 +13,7 @@
#include "base/strings/pattern.h"
#include "base/strings/string_util.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/reputation/reputation_web_contents_observer.h"
@@ -49,10 +50,10 @@
#include "url/gurl.h"
#include "url/origin.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/policy/policy_cert_service.h"
#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
@@ -262,7 +263,7 @@
}
bool SecurityStateTabHelper::UsedPolicyInstalledCertificate() const {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
policy::PolicyCertService* service =
policy::PolicyCertServiceFactory::GetForProfile(
Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
diff --git a/chrome/browser/ssl/ssl_browsertest.cc b/chrome/browser/ssl/ssl_browsertest.cc
index 97a0406..9ca4bf2 100644
--- a/chrome/browser/ssl/ssl_browsertest.cc
+++ b/chrome/browser/ssl/ssl_browsertest.cc
@@ -38,6 +38,7 @@
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_content_browser_client.h"
@@ -203,7 +204,7 @@
#include "net/cert/x509_util_nss.h"
#endif // defined(USE_NSS_CERTS)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/path_service.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/policy/profile_policy_connector.h"
@@ -212,7 +213,7 @@
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_service.h"
#include "components/session_manager/core/session_manager.h"
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_MAC)
#include "base/mac/mac_util.h"
@@ -4073,7 +4074,7 @@
// Visit a page and establish a WebSocket connection over bad https with
// --ignore-certificate-errors-spki-list. The connection should be established
// without interstitial page showing.
-#if !defined(OS_CHROMEOS) // Chrome OS does not support the flag.
+#if !BUILDFLAG(IS_CHROMEOS_ASH) // Chrome OS does not support the flag.
IN_PROC_BROWSER_TEST_F(SSLUITestIgnoreCertErrorsBySPKIWSS, TestWSSExpired) {
ASSERT_TRUE(wss_server_expired_.Start());
@@ -4096,11 +4097,11 @@
const base::string16 result = watcher.WaitAndGetTitle();
EXPECT_TRUE(base::LowerCaseEqualsASCII(result, "pass"));
}
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
// Test that HTTPS pages with a bad certificate don't show an interstitial if
// the public key matches a value from --ignore-certificate-errors-spki-list.
-#if !defined(OS_CHROMEOS) // Chrome OS does not support the flag.
+#if !BUILDFLAG(IS_CHROMEOS_ASH) // Chrome OS does not support the flag.
IN_PROC_BROWSER_TEST_F(SSLUITestIgnoreCertErrorsBySPKIHTTPS, TestHTTPS) {
ASSERT_TRUE(https_server_mismatched_.Start());
@@ -4117,11 +4118,11 @@
ui_test_utils::GetCurrentTabTitle(browser(), &title);
EXPECT_EQ(title, base::ASCIIToUTF16("This script has loaded"));
}
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
// Test subresources from an origin with a bad certificate are loaded if the
// public key matches a value from --ignore-certificate-errors-spki-list.
-#if !defined(OS_CHROMEOS) // Chrome OS does not support the flag.
+#if !BUILDFLAG(IS_CHROMEOS_ASH) // Chrome OS does not support the flag.
IN_PROC_BROWSER_TEST_F(SSLUITestIgnoreCertErrorsBySPKIHTTPS,
TestInsecureSubresource) {
ASSERT_TRUE(https_server_.Start());
@@ -4144,7 +4145,7 @@
tab, "window.domAutomationController.send(ImageWidth());", &img_width));
EXPECT_GT(img_width, 200);
}
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
// Verifies that the interstitial can proceed, even if JavaScript is disabled.
IN_PROC_BROWSER_TEST_F(SSLUITest, TestInterstitialJavaScriptProceeds) {
@@ -5725,7 +5726,7 @@
ssl_test_util::CheckAuthenticatedState(tab, AuthState::NONE);
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
class SSLUITestNoCert : public SSLUITest,
public CertificateManagerModel::Observer {
@@ -5944,7 +5945,7 @@
ssl_test_util::CheckAuthenticatedState(tab_for_profile_2, AuthState::NONE);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Regression test for http://crbug.com/635833 (crash when a window with no
// NavigationEntry commits).
diff --git a/chrome/browser/ssl/ssl_error_controller_client.cc b/chrome/browser/ssl/ssl_error_controller_client.cc
index c155c24..39857960 100644
--- a/chrome/browser/ssl/ssl_error_controller_client.cc
+++ b/chrome/browser/ssl/ssl_error_controller_client.cc
@@ -14,6 +14,7 @@
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/interstitials/enterprise_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -28,7 +29,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/settings_window_manager_chromeos.h"
#include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h"
@@ -139,7 +140,7 @@
void SSLErrorControllerClient::LaunchDateAndTimeSettings() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
ProfileManager::GetActiveUserProfile(),
chromeos::settings::mojom::kDateAndTimeSectionPath);
diff --git a/chrome/browser/sync/test/integration/two_client_send_tab_to_self_sync_test.cc b/chrome/browser/sync/test/integration/two_client_send_tab_to_self_sync_test.cc
index 3f9b7f0..919bfe0 100644
--- a/chrome/browser/sync/test/integration/two_client_send_tab_to_self_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_send_tab_to_self_sync_test.cc
@@ -5,6 +5,7 @@
#include "base/callback_list.h"
#include "base/run_loop.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/send_tab_to_self/send_tab_to_self_util.h"
#include "chrome/browser/sync/device_info_sync_service_factory.h"
@@ -296,7 +297,7 @@
};
// Non-primary accounts don't exist on ChromeOS.
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(
TwoClientSendTabToSelfSyncTestWithSendTabToSelfWhenSignedIn,
SignedInClientCanReceive) {
@@ -328,4 +329,4 @@
EXPECT_TRUE(device_infos[0]->send_tab_to_self_receiving_enabled());
EXPECT_TRUE(device_infos[1]->send_tab_to_self_receiving_enabled());
}
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc
index caec77b..4f82e3d 100644
--- a/chrome/browser/themes/theme_service_factory.cc
+++ b/chrome/browser/themes/theme_service_factory.cc
@@ -6,6 +6,7 @@
#include "base/no_destructor.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -22,7 +23,9 @@
#include "chrome/browser/themes/theme_helper_win.h"
#endif
-#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)
#include "chrome/browser/themes/theme_service_aura_linux.h"
#include "ui/views/linux_ui/linux_ui.h"
#endif
@@ -77,7 +80,9 @@
KeyedService* ThemeServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
-#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)
using ThemeService = ThemeServiceAuraLinux;
#endif
@@ -89,7 +94,9 @@
void ThemeServiceFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
-#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)
bool default_uses_system_theme = false;
const views::LinuxUI* linux_ui = views::LinuxUI::instance();
diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc
index b5aa14b4..bf02f25 100644
--- a/chrome/browser/themes/theme_syncable_service_unittest.cc
+++ b/chrome/browser/themes/theme_syncable_service_unittest.cc
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "base/values.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/browser/profiles/profile.h"
@@ -40,7 +41,7 @@
#include "extensions/common/permissions/permission_set.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
@@ -251,7 +252,7 @@
// Needed for setting up 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/tracing/chrome_tracing_delegate.cc b/chrome/browser/tracing/chrome_tracing_delegate.cc
index 4eb6b5c..a218fbb 100644
--- a/chrome/browser/tracing/chrome_tracing_delegate.cc
+++ b/chrome/browser/tracing/chrome_tracing_delegate.cc
@@ -15,6 +15,7 @@
#include "base/time/time.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.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -179,7 +180,7 @@
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
-#if !defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD)
+#if !BUILDFLAG(IS_CHROMEOS_ASH) && defined(OFFICIAL_BUILD)
if (!local_state->GetBoolean(metrics::prefs::kMetricsReportingEnabled)) {
RecordDisallowedMetric(
TracingFinalizationDisallowedReason::kMetricsReportingDisabled);
diff --git a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc
index 87c01d66..3029677 100644
--- a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc
+++ b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.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/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -35,7 +36,7 @@
started_finalizations_count_(0),
last_on_started_finalizing_success_(false) {}
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
void SetUpOnMainThread() override {
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
diff --git a/chrome/browser/tracing/crash_service_uploader.cc b/chrome/browser/tracing/crash_service_uploader.cc
index d879eea..e59f3a4 100644
--- a/chrome/browser/tracing/crash_service_uploader.cc
+++ b/chrome/browser/tracing/crash_service_uploader.cc
@@ -18,6 +18,7 @@
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "components/tracing/common/tracing_switches.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_task_traits.h"
@@ -152,7 +153,7 @@
const char product[] = "Chrome";
#elif defined(OS_MAC)
const char product[] = "Chrome_Mac";
-#elif defined(OS_CHROMEOS)
+#elif BUILDFLAG(IS_CHROMEOS_ASH)
// On ChromeOS, defined(OS_LINUX) also evalutes to true, so the
// defined(OS_CHROMEOS) block must come first.
const char product[] = "Chrome_ChromeOS";
diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
index 1c550b7..3a5a665 100644
--- a/chrome/browser/translate/chrome_translate_client.cc
+++ b/chrome/browser/translate/chrome_translate_client.cc
@@ -13,6 +13,7 @@
#include "base/path_service.h"
#include "base/strings/string_split.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/infobars/infobar_service.h"
@@ -156,7 +157,7 @@
// static
std::unique_ptr<translate::TranslatePrefs>
ChromeTranslateClient::CreateTranslatePrefs(PrefService* prefs) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
const char* preferred_languages_prefs = language::prefs::kPreferredLanguages;
#else
const char* preferred_languages_prefs = NULL;
diff --git a/chrome/browser/translate/translate_service.cc b/chrome/browser/translate/translate_service.cc
index 9caa667..9fe8c2e 100644
--- a/chrome/browser/translate/translate_service.cc
+++ b/chrome/browser/translate/translate_service.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/translate/chrome_translate_client.h"
@@ -26,7 +27,7 @@
#include "url/gurl.h"
#include "url/url_constants.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "extensions/common/constants.h"
#endif
@@ -147,7 +148,7 @@
!url.SchemeIs(url::kFileScheme) &&
!url.SchemeIs(url::kContentScheme) &&
!url.SchemeIs(content::kChromeDevToolsScheme) && !url.IsAboutBlank() &&
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
!(url.SchemeIs(extensions::kExtensionScheme) &&
url.DomainIs(file_manager::kFileManagerAppId)) &&
#endif
diff --git a/chrome/browser/translate/translate_service_unittest.cc b/chrome/browser/translate/translate_service_unittest.cc
index b77c679..1f20a29 100644
--- a/chrome/browser/translate/translate_service_unittest.cc
+++ b/chrome/browser/translate/translate_service_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/translate/translate_service.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/url_constants.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
@@ -15,7 +16,7 @@
#include "url/gurl.h"
#include "url/url_constants.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "extensions/common/constants.h"
#endif
@@ -49,7 +50,7 @@
GURL file_url = GURL(file);
EXPECT_FALSE(TranslateService::IsTranslatableURL(file_url));
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
std::string filemanager = std::string(extensions::kExtensionScheme) +
std::string("://") +
std::string(file_manager::kFileManagerAppId);
diff --git a/chrome/browser/unload_browsertest.cc b/chrome/browser/unload_browsertest.cc
index f327108..d61b4dc1e 100644
--- a/chrome/browser/unload_browsertest.cc
+++ b/chrome/browser/unload_browsertest.cc
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -515,7 +516,7 @@
// Tests terminating the browser with a beforeunload handler.
// Currently only ChromeOS shuts down gracefully.
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(UnloadTest, BrowserTerminateBeforeUnload) {
NavigateToDataURL(BEFORE_UNLOAD_HTML, "beforeunload");
EXPECT_EQ(kill(base::GetCurrentProcessHandle(), SIGTERM), 0);
diff --git a/chrome/browser/updates/announcement_notification/BUILD.gn b/chrome/browser/updates/announcement_notification/BUILD.gn
index c9fc53c6..476c934 100644
--- a/chrome/browser/updates/announcement_notification/BUILD.gn
+++ b/chrome/browser/updates/announcement_notification/BUILD.gn
@@ -50,6 +50,7 @@
deps = [
":announcement_notification",
+ "//build:chromeos_buildflags",
"//chrome/test:test_support",
"//skia",
"//testing/gmock",
diff --git a/chrome/browser/updates/announcement_notification/announcement_notification_service_unittest.cc b/chrome/browser/updates/announcement_notification/announcement_notification_service_unittest.cc
index 08549be..eaddf88a 100644
--- a/chrome/browser/updates/announcement_notification/announcement_notification_service_unittest.cc
+++ b/chrome/browser/updates/announcement_notification/announcement_notification_service_unittest.cc
@@ -14,6 +14,7 @@
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_features.h"
@@ -102,7 +103,9 @@
else
disabled_features.push_back(kAnnouncementNotification);
-#if defined(OS_WIN) || (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_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || \
defined(OS_MAC)
if (ephemeral_guest_profile)
enabled_features.push_back(
diff --git a/chrome/browser/upgrade_detector/upgrade_detector.h b/chrome/browser/upgrade_detector/upgrade_detector.h
index a78dd0d0..8fb7c37 100644
--- a/chrome/browser/upgrade_detector/upgrade_detector.h
+++ b/chrome/browser/upgrade_detector/upgrade_detector.h
@@ -11,6 +11,7 @@
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
#include "components/prefs/pref_change_registrar.h"
@@ -108,7 +109,7 @@
return critical_update_acknowledged_;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
bool is_factory_reset_required() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return is_factory_reset_required_;
@@ -118,7 +119,7 @@
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return is_rollback_;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
UpgradeNotificationAnnoyanceLevel upgrade_notification_stage() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -259,7 +260,7 @@
upgrade_notification_stage_ = stage;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
void set_is_factory_reset_required(bool is_factory_reset_required) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
is_factory_reset_required_ = is_factory_reset_required;
@@ -269,7 +270,7 @@
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
is_rollback_ = is_rollback;
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
private:
FRIEND_TEST_ALL_PREFIXES(AppMenuModelTest, Basics);
@@ -311,7 +312,7 @@
// Whether the user has acknowledged the critical update.
bool critical_update_acknowledged_;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// Whether a factory reset is needed to complete an update.
bool is_factory_reset_required_ = false;
@@ -319,7 +320,7 @@
// to an earlier version of Chrome OS, which results in the device being
// wiped when it's rebooted.
bool is_rollback_ = false;
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// A timer to check to see if we've been idle for long enough to show the
// critical warning. Should only be set if |upgrade_available_| is
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl_unittest.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl_unittest.cc
index 0b71b9b..b82a6de2 100644
--- a/chrome/browser/upgrade_detector/upgrade_detector_impl_unittest.cc
+++ b/chrome/browser/upgrade_detector/upgrade_detector_impl_unittest.cc
@@ -14,6 +14,7 @@
#include "base/time/tick_clock.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/upgrade_detector/installed_version_poller.h"
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
#include "chrome/common/pref_names.h"
@@ -24,9 +25,9 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if !defined(OS_CHROMEOS)
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/enterprise/browser/controller/fake_browser_dm_token_storage.h"
-#endif // !defined(OS_CHROMEOS)
+#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_WIN)
#include "chrome/install_static/install_modes.h"
@@ -166,9 +167,9 @@
ScopedTestingLocalState scoped_local_state_;
InstalledVersionPoller::ScopedDisableForTesting scoped_poller_disabler_;
-#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(UpgradeDetectorImplTest);
};
@@ -405,9 +406,9 @@
}
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(UpgradeDetectorImplTimerTest);
};
diff --git a/chrome/browser/usb/usb_chooser_context_unittest.cc b/chrome/browser/usb/usb_chooser_context_unittest.cc
index d745b50..01fc46ca 100644
--- a/chrome/browser/usb/usb_chooser_context_unittest.cc
+++ b/chrome/browser/usb/usb_chooser_context_unittest.cc
@@ -10,6 +10,7 @@
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/usb/usb_chooser_context.h"
#include "chrome/browser/usb/usb_chooser_context_factory.h"
@@ -702,7 +703,7 @@
*unrelated_device_info));
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
class DeviceLoginScreenWebUsbChooserContextTest : public UsbChooserContextTest {
public:
@@ -774,7 +775,7 @@
kInvalidRequestingOrigins, *specific_device_info);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
namespace {
diff --git a/chrome/browser/usb/web_usb_detector_unittest.cc b/chrome/browser/usb/web_usb_detector_unittest.cc
index 248d0baa..333bad8 100644
--- a/chrome/browser/usb/web_usb_detector_unittest.cc
+++ b/chrome/browser/usb/web_usb_detector_unittest.cc
@@ -10,6 +10,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/notifications/notification_display_service.h"
#include "chrome/browser/notifications/notification_display_service_tester.h"
@@ -30,7 +31,7 @@
#include "ui/message_center/public/cpp/notification_delegate.h"
#include "url/gurl.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"
#include "components/user_manager/user_manager.h"
@@ -69,7 +70,7 @@
void SetUp() override {
BrowserWithTestWindowTest::SetUp();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>(
std::make_unique<chromeos::FakeChromeUserManager>());
@@ -94,7 +95,7 @@
void TearDown() override {
BrowserWithTestWindowTest::TearDown();
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
user_manager_enabler_.reset();
#endif
web_usb_detector_.reset();
@@ -103,7 +104,7 @@
void Initialize() { web_usb_detector_->Initialize(); }
protected:
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::FakeChromeUserManager* GetFakeUserManager() {
return static_cast<chromeos::FakeChromeUserManager*>(
user_manager::UserManager::Get());
diff --git a/chrome/browser/web_applications/preinstalled_web_apps/BUILD.gn b/chrome/browser/web_applications/preinstalled_web_apps/BUILD.gn
index cb6b93c..09ea5bc9 100644
--- a/chrome/browser/web_applications/preinstalled_web_apps/BUILD.gn
+++ b/chrome/browser/web_applications/preinstalled_web_apps/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("//chrome/browser/buildflags.gni")
source_set("preinstalled_web_apps") {
@@ -38,7 +39,7 @@
"youtube.h",
]
- if (is_chromeos) {
+ if (is_chromeos_ash) {
sources += [
"google_calendar.cc",
"google_calendar.h",
diff --git a/chrome/browser/web_launch/web_launch_files_helper.cc b/chrome/browser/web_launch/web_launch_files_helper.cc
index b5c737c..c3787f6 100644
--- a/chrome/browser/web_launch/web_launch_files_helper.cc
+++ b/chrome/browser/web_launch/web_launch_files_helper.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
@@ -77,7 +78,7 @@
// system implementation.
content::NativeFileSystemEntryFactory::PathType MaybeRemapPath(
base::FilePath* entry_path) {
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
base::FilePath virtual_path;
auto* external_mount_points =
storage::ExternalMountPoints::GetSystemInstance();
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
index aeb99ff0..3dcc011 100644
--- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
+++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.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 "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webauthn/authenticator_request_dialog.h"
@@ -46,7 +47,7 @@
#include "device/fido/win/authenticator.h"
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/webauthn_request_registrar.h"
#include "ui/aura/window.h"
#endif
@@ -468,7 +469,7 @@
}
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ChromeAuthenticatorRequestDelegate::ChromeOSGenerateRequestIdCallback
ChromeAuthenticatorRequestDelegate::GetGenerateRequestIdCallback(
content::RenderFrameHost* render_frame_host) {
@@ -476,7 +477,7 @@
render_frame_host->GetNativeView()->GetToplevelWindow();
return ash::WebAuthnRequestRegistrar::Get()->GetRegisterCallback(window);
}
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
void ChromeAuthenticatorRequestDelegate::UpdateLastTransportUsed(
device::FidoTransportProtocol transport) {
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.h b/chrome/browser/webauthn/chrome_authenticator_request_delegate.h
index e575d1f9..722bbd37 100644
--- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.h
+++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.h
@@ -15,6 +15,7 @@
#include "base/strings/string_piece.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/webauthn/authenticator_request_dialog_model.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "device/fido/cable/cable_discovery_data.h"
@@ -57,10 +58,10 @@
override;
#endif // defined(OS_MAC)
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
ChromeOSGenerateRequestIdCallback GetGenerateRequestIdCallback(
content::RenderFrameHost* render_frame_host) override;
-#endif // defined(OS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
base::WeakPtr<ChromeAuthenticatorRequestDelegate> AsWeakPtr();
diff --git a/chrome/browser/webshare/share_service_browsertest.cc b/chrome/browser/webshare/share_service_browsertest.cc
index 0aeffc4..cafac061 100644
--- a/chrome/browser/webshare/share_service_browsertest.cc
+++ b/chrome/browser/webshare/share_service_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_features.h"
diff --git a/chrome/browser/webshare/share_service_impl.cc b/chrome/browser/webshare/share_service_impl.cc
index 7bfc923..4c241ee 100644
--- a/chrome/browser/webshare/share_service_impl.cc
+++ b/chrome/browser/webshare/share_service_impl.cc
@@ -10,6 +10,7 @@
#include "base/feature_list.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/common/chrome_features.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
@@ -25,7 +26,7 @@
ShareServiceImpl::ShareServiceImpl(content::RenderFrameHost& render_frame_host)
: content::WebContentsObserver(
content::WebContents::FromRenderFrameHost(&render_frame_host)),
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_client_(web_contents()),
#endif
render_frame_host_(&render_frame_host) {
@@ -171,7 +172,7 @@
// the blobs.
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
sharesheet_client_.Share(title, text, share_url, std::move(files),
std::move(callback));
#elif defined(OS_WIN)
diff --git a/chrome/browser/webshare/share_service_impl.h b/chrome/browser/webshare/share_service_impl.h
index 6c4fe12d..97104c9 100644
--- a/chrome/browser/webshare/share_service_impl.h
+++ b/chrome/browser/webshare/share_service_impl.h
@@ -10,10 +10,11 @@
#include "base/strings/string_piece.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/blink/public/mojom/webshare/webshare.mojom.h"
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/webshare/chromeos/sharesheet_client.h"
#endif
@@ -52,7 +53,7 @@
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
private:
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
webshare::SharesheetClient sharesheet_client_;
#endif
content::RenderFrameHost* render_frame_host_;
diff --git a/chrome/browser/webshare/share_service_unittest.cc b/chrome/browser/webshare/share_service_unittest.cc
index 8ae1070..a832c4e 100644
--- a/chrome/browser/webshare/share_service_unittest.cc
+++ b/chrome/browser/webshare/share_service_unittest.cc
@@ -11,6 +11,7 @@
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
+#include "build/chromeos_buildflags.h"
#include "chrome/browser/webshare/share_service_impl.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
@@ -25,7 +26,7 @@
using blink::mojom::ShareError;
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/sharesheet/sharesheet_types.h"
#include "chrome/browser/webshare/chromeos/sharesheet_client.h"
#endif
@@ -44,7 +45,7 @@
ChromeRenderViewHostTestHarness::SetUp();
share_service_ = std::make_unique<ShareServiceImpl>(*main_rfh());
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
webshare::SharesheetClient::SetSharesheetCallbackForTesting(
base::BindRepeating(&ShareServiceUnitTest::AcceptShareRequest));
#endif
@@ -129,7 +130,7 @@
return builder;
}
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
static void AcceptShareRequest(content::WebContents* web_contents,
const std::vector<base::FilePath>& file_paths,
const std::vector<std::string>& content_types,
@@ -226,7 +227,7 @@
}
#endif
-#if defined(OS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
// On Chrome OS, like Android, we prevent sharing of Android applications.
TEST_F(ShareServiceUnitTest, AndroidPackage) {
EXPECT_EQ(ShareError::PERMISSION_DENIED,