diff --git a/components/sessions/BUILD.gn b/components/sessions/BUILD.gn index 6db298c09b968..6179da74819ea 100644 --- a/components/sessions/BUILD.gn +++ b/components/sessions/BUILD.gn @@ -136,7 +136,6 @@ source_set("shared") { public_deps = [ ":session_id", - "//build:chromeos_buildflags", "//components/keyed_service/core", "//skia", ] diff --git a/components/sessions/core/session_types.h b/components/sessions/core/session_types.h index aa5bcf1948b47..1861d93a1a23d 100644 --- a/components/sessions/core/session_types.h +++ b/components/sessions/core/session_types.h @@ -14,7 +14,6 @@ #include "base/time/time.h" #include "base/token.h" -#include "build/chromeos_buildflags.h" #include "components/sessions/core/serialized_navigation_entry.h" #include "components/sessions/core/serialized_user_agent_override.h" #include "components/sessions/core/session_id.h" @@ -156,7 +155,7 @@ struct SESSIONS_EXPORT SessionWindow { TYPE_APP = 2, TYPE_DEVTOOLS = 3, TYPE_APP_POPUP = 4, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TYPE_CUSTOM_TAB = 5, #endif }; diff --git a/components/sessions/core/tab_restore_service_impl.cc b/components/sessions/core/tab_restore_service_impl.cc index 2da47939180ec..a9e12ccf4cea8 100644 --- a/components/sessions/core/tab_restore_service_impl.cc +++ b/components/sessions/core/tab_restore_service_impl.cc @@ -253,7 +253,7 @@ bool DeserializeWindowType(int type_int, case sessions::SessionWindow::TYPE_APP: case sessions::SessionWindow::TYPE_DEVTOOLS: case sessions::SessionWindow::TYPE_APP_POPUP: -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) case sessions::SessionWindow::TYPE_CUSTOM_TAB: #endif *type = static_cast<sessions::SessionWindow::WindowType>(type_int); diff --git a/components/soda/BUILD.gn b/components/soda/BUILD.gn index d6b0266c0c6d1..a77a42e784566 100644 --- a/components/soda/BUILD.gn +++ b/components/soda/BUILD.gn @@ -3,7 +3,6 @@ # found in the LICENSE file. import("//build/buildflag_header.gni") -import("//build/config/chromeos/ui_mode.gni") import("//components/soda/buildflags.gni") assert(!is_android) @@ -26,13 +25,12 @@ component("soda") { deps = [ ":constants", "//base", - "//build:chromeos_buildflags", "//components/live_caption:constants", "//components/prefs", "//media", ] - if (is_chromeos_ash) { + if (is_chromeos) { sources += [ "soda_installer_impl_chromeos.cc", "soda_installer_impl_chromeos.h", @@ -45,10 +43,6 @@ component("soda") { "//ui/base", ] } - - if (is_chromeos_lacros) { - deps += [ "//chromeos/startup:startup" ] - } } source_set("constants") { @@ -85,18 +79,14 @@ source_set("utils") { "//ui/base", ] - if (is_chromeos_ash) { + if (is_chromeos) { deps += [ "//ash/constants:constants" ] } - - if (is_chromeos_lacros) { - deps += [ "//chromeos/startup:startup" ] - } } source_set("unit_tests") { testonly = true - if (is_chromeos_ash) { + if (is_chromeos) { sources = [ "soda_installer_impl_chromeos_unittest.cc" ] deps = [ diff --git a/components/soda/soda_features.cc b/components/soda/soda_features.cc index 04c34dc0bb755..8f1b20b701b64 100644 --- a/components/soda/soda_features.cc +++ b/components/soda/soda_features.cc @@ -7,7 +7,7 @@ #include "base/feature_list.h" namespace speech { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) BASE_FEATURE(kCrosExpandSodaLanguages, "CrosExpandSodaLanguages", base::FEATURE_ENABLED_BY_DEFAULT); diff --git a/components/soda/soda_installer.cc b/components/soda/soda_installer.cc index 4e13e669a3fec..474353f48466a 100644 --- a/components/soda/soda_installer.cc +++ b/components/soda/soda_installer.cc @@ -12,7 +12,6 @@ #include "base/observer_list.h" #include "base/strings/string_split.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "components/live_caption/pref_names.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" @@ -20,10 +19,10 @@ #include "components/soda/pref_names.h" #include "media/base/media_switches.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) namespace { @@ -41,10 +40,10 @@ SodaInstaller* g_instance = nullptr; // static SodaInstaller* SodaInstaller::GetInstance() { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) DCHECK( base::FeatureList::IsEnabled(ash::features::kOnDeviceSpeechRecognition)); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) return g_instance; } @@ -63,7 +62,7 @@ void SodaInstaller::RegisterLocalStatePrefs(PrefRegistrySimple* registry) { registry->RegisterTimePref(prefs::kSodaScheduledDeletionTime, base::Time()); SodaInstaller::RegisterRegisteredLanguagePackPref(registry); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) // Handle non-Chrome-OS logic here. We need to keep the implementation of this // method in the parent class to avoid duplicate declaration build errors // (specifically on Windows). @@ -74,16 +73,16 @@ void SodaInstaller::RegisterLocalStatePrefs(PrefRegistrySimple* registry) { kLanguageComponentConfigs) { registry->RegisterFilePathPref(config.config_path_pref, base::FilePath()); } -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) +#endif // !BUILDFLAG(IS_CHROMEOS) } void SodaInstaller::Init(PrefService* profile_prefs, PrefService* global_prefs) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (!base::FeatureList::IsEnabled( ash::features::kOnDeviceSpeechRecognition) || soda_installer_initialized_) { -#else // !BUILDFLAG(IS_CHROMEOS_ASH) +#else // !BUILDFLAG(IS_CHROMEOS) if (soda_installer_initialized_) { #endif return; @@ -301,13 +300,13 @@ std::optional<SodaInstaller::ErrorCode> SodaInstaller::GetSodaInstallErrorCode( } bool SodaInstaller::IsAnyFeatureUsingSodaEnabled(PrefService* prefs) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return prefs->GetBoolean(prefs::kLiveCaptionEnabled) || prefs->GetBoolean(ash::prefs::kAccessibilityDictationEnabled) || prefs->GetBoolean(ash::prefs::kProjectorCreationFlowEnabled) || prefs->GetString( ash::prefs::kClassManagementToolsAvailabilitySetting) == "teacher"; -#else // !BUILDFLAG(IS_CHROMEOS_ASH) +#else // !BUILDFLAG(IS_CHROMEOS) return prefs->GetBoolean(prefs::kLiveCaptionEnabled); #endif } diff --git a/components/soda/soda_util.cc b/components/soda/soda_util.cc index 9f198e483ddbb..3cf720a59c86e 100644 --- a/components/soda/soda_util.cc +++ b/components/soda/soda_util.cc @@ -8,21 +8,16 @@ #include "base/feature_list.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/soda/constants.h" #include "components/soda/soda_installer.h" #include "media/base/media_switches.h" #include "ui/base/l10n/l10n_util.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "base/feature_list.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/startup/browser_params_proxy.h" -#endif - #if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #endif @@ -37,18 +32,9 @@ namespace { #if BUILDFLAG(IS_CHROMEOS) bool IsSupportedChromeOS() { -// Some Chrome OS devices do not support on-device speech. -#if BUILDFLAG(IS_CHROMEOS_ASH) - if (!base::FeatureList::IsEnabled( - ash::features::kOnDeviceSpeechRecognition)) { - return false; - } -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - if (!chromeos::BrowserParamsProxy::Get()->IsOndeviceSpeechSupported()) { - return false; - } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - return true; + // Some Chrome OS devices do not support on-device speech. + return base::FeatureList::IsEnabled( + ash::features::kOnDeviceSpeechRecognition); } #endif // BUILDFLAG(IS_CHROMEOS) diff --git a/components/storage_monitor/BUILD.gn b/components/storage_monitor/BUILD.gn index c6bbb5ef6a8ac..3cce5f29463fb 100644 --- a/components/storage_monitor/BUILD.gn +++ b/components/storage_monitor/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") import("//build/config/features.gni") static_library("storage_monitor") { @@ -22,7 +21,6 @@ static_library("storage_monitor") { deps = [ "//base", - "//build:chromeos_buildflags", "//content/public/browser", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", @@ -53,9 +51,7 @@ static_library("storage_monitor") { "ImageCaptureCore.framework", "UniformTypeIdentifiers.framework", ] - } else if (is_chromeos_ash) { - # For Chrome OS, |is_linux| is also true. Put this in an else-if block above - # the |is_linux| else-if block, so they do not clash. + } else if (is_chromeos) { sources += [ "storage_monitor_chromeos.cc", "storage_monitor_chromeos.h", @@ -74,7 +70,7 @@ static_library("storage_monitor") { ] deps += [ "//services/device/public/mojom" ] } - } else if (is_linux || is_chromeos_lacros) { + } else if (is_linux) { if (use_udev) { sources += [ "mtab_watcher_linux.cc", @@ -117,9 +113,9 @@ static_library("test_support") { "//content/public/browser", ] - deps = [ "//build:chromeos_buildflags" ] + deps = [] - if (is_chromeos_ash) { + if (is_chromeos) { sources += [ "test_media_transfer_protocol_manager_chromeos.cc", "test_media_transfer_protocol_manager_chromeos.h", @@ -169,7 +165,8 @@ source_set("unit_tests") { frameworks = [ "UniformTypeIdentifiers.framework" ] } - if (is_chromeos_ash) { + if (is_chromeos) { + deps += [ "//chromeos/ash/components/disks:test_support" ] if (use_dbus) { deps += [ "//services/device/public/mojom", @@ -180,12 +177,9 @@ source_set("unit_tests") { "storage_monitor_chromeos_unittest.cc", ] } - } else if (is_linux || is_chromeos_lacros) { + } else if (is_linux) { if (use_udev) { sources += [ "storage_monitor_linux_unittest.cc" ] } } - if (is_chromeos_ash) { - deps += [ "//chromeos/ash/components/disks:test_support" ] - } } diff --git a/components/storage_monitor/mtab_watcher_linux.h b/components/storage_monitor/mtab_watcher_linux.h index 69687f61816bf..0f1fabe014c5f 100644 --- a/components/storage_monitor/mtab_watcher_linux.h +++ b/components/storage_monitor/mtab_watcher_linux.h @@ -5,12 +5,6 @@ #ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ #define COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ -#include "build/chromeos_buildflags.h" - -#if BUILDFLAG(IS_CHROMEOS_ASH) -#error "ChromeOS does not use MtabWatcherLinux." -#endif - #include <map> #include "base/files/file_path.h" @@ -19,6 +13,10 @@ #include "base/sequence_checker.h" #include "build/build_config.h" +#if BUILDFLAG(IS_CHROMEOS) +#error "ChromeOS does not use MtabWatcherLinux." +#endif + namespace storage_monitor { // MtabWatcherLinux listens for mount point changes from a mtab file and diff --git a/components/storage_monitor/storage_monitor.h b/components/storage_monitor/storage_monitor.h index 6ec8a3521bc3f..71680e1cb1876 100644 --- a/components/storage_monitor/storage_monitor.h +++ b/components/storage_monitor/storage_monitor.h @@ -16,10 +16,9 @@ #include "base/sequence_checker.h" #include "base/synchronization/lock.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/storage_monitor/storage_info.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "services/device/public/mojom/mtp_manager.mojom-forward.h" #endif @@ -120,7 +119,7 @@ class StorageMonitor { std::wstring* storage_object_id) const = 0; #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) virtual device::mojom::MtpManager* media_transfer_protocol_manager() = 0; #endif diff --git a/components/storage_monitor/storage_monitor_chromeos.h b/components/storage_monitor/storage_monitor_chromeos.h index 431bacc53ae9a..68ede462e49c2 100644 --- a/components/storage_monitor/storage_monitor_chromeos.h +++ b/components/storage_monitor/storage_monitor_chromeos.h @@ -9,12 +9,6 @@ #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_ -#include "build/chromeos_buildflags.h" - -#if !BUILDFLAG(IS_CHROMEOS_ASH) -#error "Should only be used on ChromeOS." -#endif - #include <map> #include <memory> #include <string> @@ -27,6 +21,10 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/mtp_manager.mojom.h" +#if !BUILDFLAG(IS_CHROMEOS) +#error "Should only be used on ChromeOS." +#endif + namespace storage_monitor { class MtpManagerClientChromeOS; diff --git a/components/storage_monitor/storage_monitor_linux.h b/components/storage_monitor/storage_monitor_linux.h index aa6ac9b8af3c5..3657e2c2e61bd 100644 --- a/components/storage_monitor/storage_monitor_linux.h +++ b/components/storage_monitor/storage_monitor_linux.h @@ -10,12 +10,6 @@ #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ -#include "build/chromeos_buildflags.h" - -#if BUILDFLAG(IS_CHROMEOS_ASH) -#error "Use the ChromeOS-specific implementation instead." -#endif - #include <map> #include <memory> #include <string> @@ -29,6 +23,10 @@ #include "components/storage_monitor/mtab_watcher_linux.h" #include "components/storage_monitor/storage_monitor.h" +#if BUILDFLAG(IS_CHROMEOS) +#error "Use the ChromeOS-specific implementation instead." +#endif + namespace base { class SequencedTaskRunner; } diff --git a/components/storage_monitor/test_storage_monitor.cc b/components/storage_monitor/test_storage_monitor.cc index e388b3688fe35..8a68e60c3b9ef 100644 --- a/components/storage_monitor/test_storage_monitor.cc +++ b/components/storage_monitor/test_storage_monitor.cc @@ -10,17 +10,16 @@ #include "base/run_loop.h" #include "base/synchronization/waitable_event.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/storage_monitor/storage_info.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "components/storage_monitor/test_media_transfer_protocol_manager_chromeos.h" #endif namespace storage_monitor { TestStorageMonitor::TestStorageMonitor() : init_called_(false) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) auto* fake_mtp_manager = TestMediaTransferProtocolManagerChromeOS::GetFakeMtpManager(); fake_mtp_manager->AddReceiver( @@ -115,7 +114,7 @@ bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( } #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) device::mojom::MtpManager* TestStorageMonitor::media_transfer_protocol_manager() { return media_transfer_protocol_manager_.get(); diff --git a/components/storage_monitor/test_storage_monitor.h b/components/storage_monitor/test_storage_monitor.h index 0b4593dec0299..e12b5de22baf7 100644 --- a/components/storage_monitor/test_storage_monitor.h +++ b/components/storage_monitor/test_storage_monitor.h @@ -10,10 +10,9 @@ #include <vector> #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/storage_monitor/storage_monitor.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/mtp_manager.mojom.h" #endif @@ -53,7 +52,7 @@ class TestStorageMonitor : public StorageMonitor { std::wstring* storage_object_id) const override; #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) device::mojom::MtpManager* media_transfer_protocol_manager() override; #endif @@ -79,7 +78,7 @@ class TestStorageMonitor : public StorageMonitor { // Paths considered for testing purposes to be on removable storage. std::vector<base::FilePath> removable_paths_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) mojo::Remote<device::mojom::MtpManager> media_transfer_protocol_manager_; #endif }; diff --git a/components/supervised_user/core/browser/child_account_service.cc b/components/supervised_user/core/browser/child_account_service.cc index bf25357d438d3..1dc514175aab7 100644 --- a/components/supervised_user/core/browser/child_account_service.cc +++ b/components/supervised_user/core/browser/child_account_service.cc @@ -14,7 +14,6 @@ #include "base/no_destructor.h" #include "base/values.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/policy/core/common/policy_pref_names.h" #include "components/signin/public/base/consent_level.h" #include "components/signin/public/base/signin_switches.h" diff --git a/components/supervised_user/core/browser/list_family_members_service_unittest.cc b/components/supervised_user/core/browser/list_family_members_service_unittest.cc index f79ba9381919e..ad625a48aefb6 100644 --- a/components/supervised_user/core/browser/list_family_members_service_unittest.cc +++ b/components/supervised_user/core/browser/list_family_members_service_unittest.cc @@ -360,8 +360,6 @@ TEST_F(ListFamilyMembersServiceTest, test_list_family_members_service_->Shutdown(); } -// Sign-out test is not supported for ChromeOS -#if !BUILDFLAG(IS_CHROMEOS_ASH) // Data cleanup is only available for Windows, Mac and Linux #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) TEST_F(ListFamilyMembersServiceTest, ListFamilyFetcherClearsResponseOnSignout) { @@ -454,7 +452,6 @@ TEST_F(ListFamilyMembersServiceTest, ListFamilyFetcherResetsPrefOnSignout) { test_list_family_members_service_->Shutdown(); } #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) } // namespace } // namespace supervised_user diff --git a/components/supervised_user/core/browser/supervised_user_url_filter.h b/components/supervised_user/core/browser/supervised_user_url_filter.h index 4794f5694ed0a..6b5bd9f89550e 100644 --- a/components/supervised_user/core/browser/supervised_user_url_filter.h +++ b/components/supervised_user/core/browser/supervised_user_url_filter.h @@ -14,7 +14,6 @@ #include "base/functional/callback_forward.h" #include "base/observer_list.h" #include "base/sequence_checker.h" -#include "build/chromeos_buildflags.h" #include "components/safe_search_api/url_checker.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/supervised_user/core/browser/supervised_user_error_page.h" diff --git a/components/sync_preferences/BUILD.gn b/components/sync_preferences/BUILD.gn index 6667fcf41cbdd..575b4e849b332 100644 --- a/components/sync_preferences/BUILD.gn +++ b/components/sync_preferences/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") import("//build/config/features.gni") static_library("sync_preferences") { @@ -27,7 +26,6 @@ static_library("sync_preferences") { deps = [ "//base", - "//build:chromeos_buildflags", "//components/metrics/demographics", "//components/policy/core/browser", "//components/pref_registry", @@ -35,7 +33,7 @@ static_library("sync_preferences") { "//components/sync", ] - if (is_chromeos_ash) { + if (is_chromeos) { deps += [ "//ash/constants" ] } } @@ -104,7 +102,6 @@ source_set("unit_tests") { ":sync_preferences", ":test_support", "//base/test:test_support", - "//build:chromeos_buildflags", "//components/pref_registry", "//components/prefs", "//components/prefs:test_support", @@ -113,7 +110,7 @@ source_set("unit_tests") { "//testing/gtest", ] - if (is_chromeos_ash) { + if (is_chromeos) { deps += [ "//ash/constants" ] } } diff --git a/components/sync_preferences/common_syncable_prefs_database.cc b/components/sync_preferences/common_syncable_prefs_database.cc index 5ecd85d9d9929..53d0e653bc575 100644 --- a/components/sync_preferences/common_syncable_prefs_database.cc +++ b/components/sync_preferences/common_syncable_prefs_database.cc @@ -274,7 +274,7 @@ constexpr auto kCommonSyncablePrefsAllowlist = PrefSensitivity::kNone, MergeBehavior::kNone}}, // For Ash, the OS_PRIORITY_PREFERENCES equivalent is defined in // chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc instead. -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) {variations::kDogfoodGroupsSyncPrefName, {syncable_prefs_ids::kDogfoodGroupsSyncPrefName, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone, diff --git a/components/sync_preferences/dual_layer_user_pref_store.cc b/components/sync_preferences/dual_layer_user_pref_store.cc index 3a4685b4b40e8..313cf0e53aa6d 100644 --- a/components/sync_preferences/dual_layer_user_pref_store.cc +++ b/components/sync_preferences/dual_layer_user_pref_store.cc @@ -15,7 +15,6 @@ #include "base/observer_list.h" #include "base/strings/string_util.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "components/sync/service/sync_service.h" #include "components/sync/service/sync_user_settings.h" #include "components/sync_preferences/pref_model_associator_client.h" diff --git a/components/sync_preferences/dual_layer_user_pref_store_unittest.cc b/components/sync_preferences/dual_layer_user_pref_store_unittest.cc index 6120a0f80ba6c..37adf0c19c747 100644 --- a/components/sync_preferences/dual_layer_user_pref_store_unittest.cc +++ b/components/sync_preferences/dual_layer_user_pref_store_unittest.cc @@ -12,7 +12,6 @@ #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "components/prefs/testing_pref_store.h" #include "components/sync/test/test_sync_service.h" #include "components/sync_preferences/pref_model_associator_client.h" @@ -189,7 +188,7 @@ class DualLayerUserPrefStoreTest : public DualLayerUserPrefStoreTestBase { // data types appropriately. dual_layer_store_->EnableType(syncer::PREFERENCES); dual_layer_store_->EnableType(syncer::PRIORITY_PREFERENCES); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) dual_layer_store_->EnableType(syncer::OS_PREFERENCES); dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES); #endif @@ -1257,7 +1256,7 @@ class DualLayerUserPrefStoreMergeTest : public testing::Test { dual_layer_store_->EnableType(syncer::PREFERENCES); dual_layer_store_->EnableType(syncer::PRIORITY_PREFERENCES); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) dual_layer_store_->EnableType(syncer::OS_PREFERENCES); dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES); #endif diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc index 68820d7ca623d..790889b1d9a4e 100644 --- a/components/sync_preferences/pref_model_associator.cc +++ b/components/sync_preferences/pref_model_associator.cc @@ -22,7 +22,6 @@ #include "base/observer_list.h" #include "base/types/expected_macros.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "components/sync/base/data_type.h" #include "components/sync/base/features.h" #include "components/sync/model/sync_change.h" @@ -43,7 +42,7 @@ const sync_pb::PreferenceSpecifics& GetSpecifics(const syncer::SyncData& pref) { return pref.GetSpecifics().preference(); case syncer::PRIORITY_PREFERENCES: return pref.GetSpecifics().priority_preference().preference(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) case syncer::OS_PREFERENCES: return pref.GetSpecifics().os_preference().preference(); case syncer::OS_PRIORITY_PREFERENCES: @@ -77,7 +76,7 @@ PrefModelAssociator::PrefModelAssociator( user_prefs_(user_prefs), dual_layer_user_prefs_(nullptr) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) DCHECK(type_ == syncer::PREFERENCES || type_ == syncer::PRIORITY_PREFERENCES || type_ == syncer::OS_PREFERENCES || @@ -119,7 +118,7 @@ sync_pb::PreferenceSpecifics* PrefModelAssociator::GetMutableSpecifics( return specifics->mutable_preference(); case syncer::PRIORITY_PREFERENCES: return specifics->mutable_priority_preference()->mutable_preference(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) case syncer::OS_PREFERENCES: return specifics->mutable_os_preference()->mutable_preference(); case syncer::OS_PRIORITY_PREFERENCES: diff --git a/components/sync_preferences/pref_model_associator_unittest.cc b/components/sync_preferences/pref_model_associator_unittest.cc index e7e3fc977f1b3..42594826555cc 100644 --- a/components/sync_preferences/pref_model_associator_unittest.cc +++ b/components/sync_preferences/pref_model_associator_unittest.cc @@ -44,10 +44,10 @@ const char kDictionaryPrefName[] = "pref.dictionary"; const char kCustomMergePrefName[] = "pref.custom"; const char kStringPriorityPrefName[] = "priority.pref.string"; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const char kStringOsPrefName[] = "os.pref.string"; const char kStringOsPriorityPrefName[] = "os.priority.pref.string"; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // Assigning an id of 0 to all the test prefs. const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = { @@ -64,13 +64,13 @@ const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = { {kStringPriorityPrefName, {0, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}}, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) {kStringOsPrefName, {0, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}}, {kStringOsPriorityPrefName, {0, syncer::OS_PRIORITY_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}}, -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) }; // Creates SyncData for a remote pref change. @@ -597,7 +597,7 @@ TEST_F(SyncablePrefsDatabaseTest, ShouldAllowRegisteringSyncablePriorityPrefs) { NotNull()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(SyncablePrefsDatabaseTest, ShouldAllowRegisteringSyncableOSPrefs) { pref_registry_->RegisterStringPref( kStringOsPrefName, std::string(), @@ -660,7 +660,7 @@ TEST_F(SyncablePrefsDatabaseDeathTest, kExpectedErrorMessageHint); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(SyncablePrefsDatabaseDeathTest, ShouldFailRegisteringIllegalOSPrefs) { const std::string kIllegalStringPrefName = "not-allowed_string_pref"; const std::string kIllegalListPrefName = "not-allowed_list_pref"; @@ -721,7 +721,7 @@ TEST_F(SyncablePrefsDatabaseDeathTest, kStringPriorityPrefName, std::string(), user_prefs::PrefRegistrySyncable::SYNCABLE_PREF), kExpectedErrorMessageHint); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) EXPECT_DCHECK_DEATH_WITH( pref_registry_->RegisterStringPref( kStringOsPrefName, std::string(), diff --git a/components/sync_preferences/pref_service_syncable.cc b/components/sync_preferences/pref_service_syncable.cc index 329a77a218765..4430d97e5cf16 100644 --- a/components/sync_preferences/pref_service_syncable.cc +++ b/components/sync_preferences/pref_service_syncable.cc @@ -12,7 +12,6 @@ #include "base/functional/callback_helpers.h" #include "base/observer_list.h" #include "base/scoped_observation.h" -#include "build/chromeos_buildflags.h" #include "components/metrics/demographics/user_demographics.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/in_memory_pref_store.h" @@ -27,7 +26,7 @@ #include "components/sync_preferences/pref_service_syncable_observer.h" #include "components/sync_preferences/synced_pref_observer.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #endif @@ -92,7 +91,7 @@ PrefServiceSyncable::PrefServiceSyncable( priority_pref_sync_associator_(pref_model_associator_client, user_prefs, syncer::PRIORITY_PREFERENCES), -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) os_pref_sync_associator_(pref_model_associator_client, user_prefs, syncer::OS_PREFERENCES), @@ -127,7 +126,7 @@ PrefServiceSyncable::PrefServiceSyncable( priority_pref_sync_associator_(pref_model_associator_client, dual_layer_user_prefs, syncer::PRIORITY_PREFERENCES), -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) os_pref_sync_associator_(pref_model_associator_client, dual_layer_user_prefs, syncer::OS_PREFERENCES), @@ -145,7 +144,7 @@ PrefServiceSyncable::PrefServiceSyncable( void PrefServiceSyncable::ConnectAssociatorsAndRegisterPreferences() { pref_sync_associator_.SetPrefService(this); priority_pref_sync_associator_.SetPrefService(this); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) os_pref_sync_associator_.SetPrefService(this); os_priority_pref_sync_associator_.SetPrefService(this); #endif @@ -213,7 +212,7 @@ bool PrefServiceSyncable::IsPrioritySyncing() { return priority_pref_sync_associator_.models_associated(); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool PrefServiceSyncable::AreOsPrefsSyncing() { return os_pref_sync_associator_.models_associated(); } @@ -221,7 +220,7 @@ bool PrefServiceSyncable::AreOsPrefsSyncing() { bool PrefServiceSyncable::AreOsPriorityPrefsSyncing() { return os_priority_pref_sync_associator_.models_associated(); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) void PrefServiceSyncable::AddObserver(PrefServiceSyncableObserver* observer) { observer_list_.AddObserver(observer); @@ -239,7 +238,7 @@ syncer::SyncableService* PrefServiceSyncable::GetSyncableService( return &pref_sync_associator_; case syncer::PRIORITY_PREFERENCES: return &priority_pref_sync_associator_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) case syncer::OS_PREFERENCES: return &os_pref_sync_associator_; case syncer::OS_PRIORITY_PREFERENCES: @@ -262,7 +261,7 @@ void PrefServiceSyncable::AddSyncedPrefObserver(const std::string& name, SyncedPrefObserver* observer) { pref_sync_associator_.AddSyncedPrefObserver(name, observer); priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) os_pref_sync_associator_.AddSyncedPrefObserver(name, observer); os_priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer); #endif @@ -273,7 +272,7 @@ void PrefServiceSyncable::RemoveSyncedPrefObserver( SyncedPrefObserver* observer) { pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) os_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); os_priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); #endif @@ -290,7 +289,7 @@ void PrefServiceSyncable::AddRegisteredSyncablePreference(std::string_view path, priority_pref_sync_associator_.RegisterPref(path); return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF) { os_pref_sync_associator_.RegisterPref(path); return; diff --git a/components/sync_preferences/pref_service_syncable.h b/components/sync_preferences/pref_service_syncable.h index c0c9f01b24afe..c670c1cb91ce2 100644 --- a/components/sync_preferences/pref_service_syncable.h +++ b/components/sync_preferences/pref_service_syncable.h @@ -15,7 +15,6 @@ #include "base/functional/callback_forward.h" #include "base/functional/callback_helpers.h" #include "base/observer_list.h" -#include "build/chromeos_buildflags.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" #include "components/sync_preferences/pref_model_associator.h" @@ -95,7 +94,7 @@ class PrefServiceSyncable : public PrefService, // priority preferences. bool IsPrioritySyncing(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // As above, but for OS preferences. bool AreOsPrefsSyncing(); @@ -138,7 +137,7 @@ class PrefServiceSyncable : public PrefService, PrefModelAssociator pref_sync_associator_; PrefModelAssociator priority_pref_sync_associator_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Associators for Chrome OS system preferences. PrefModelAssociator os_pref_sync_associator_; PrefModelAssociator os_priority_pref_sync_associator_; diff --git a/components/sync_preferences/pref_service_syncable_unittest.cc b/components/sync_preferences/pref_service_syncable_unittest.cc index 00bbb3b727d9c..7e4262db1579c 100644 --- a/components/sync_preferences/pref_service_syncable_unittest.cc +++ b/components/sync_preferences/pref_service_syncable_unittest.cc @@ -16,7 +16,6 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_notifier_impl.h" #include "components/prefs/scoped_user_pref_update.h" @@ -41,7 +40,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "testing/gmock/include/gmock/gmock-matchers.h" #endif @@ -74,7 +73,7 @@ const char kNonDefaultCharsetValue[] = "foo"; const char kDefaultCharsetValue[] = "utf-8"; const char kBrowserPrefName[] = "browser_pref"; const char kBrowserPriorityPrefName[] = "browser_priority_pref"; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const char kOsPrefName[] = "os_pref"; const char kOsPriorityPrefName[] = "os_priority_pref"; #endif @@ -101,7 +100,7 @@ const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = { {kBrowserPriorityPrefName, {8, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}}, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) {kOsPrefName, {9, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}}, {kOsPriorityPrefName, @@ -129,7 +128,7 @@ std::optional<base::Value> FindValue( return std::nullopt; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) constexpr DataTypeSet kAllPreferenceDataTypes = { syncer::PREFERENCES, syncer::PRIORITY_PREFERENCES, syncer::OS_PREFERENCES, syncer::OS_PRIORITY_PREFERENCES}; @@ -138,7 +137,7 @@ MATCHER_P(MatchesDataType, data_type, "") { const syncer::SyncChange& sync_change = arg; return Matches(data_type)(sync_change.sync_data().GetDataType()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class TestSyncProcessorStub : public syncer::SyncChangeProcessor { public: @@ -991,7 +990,7 @@ TEST_F(PrefServiceSyncableTest, DeletePreference) { EXPECT_TRUE(pref->IsDefaultValue()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // The Chrome OS tests exercise pref model association that happens in the // constructor of PrefServiceSyncable. The tests must register prefs first, // then create the PrefServiceSyncable object. The tests live in this file @@ -1391,7 +1390,7 @@ TEST_F(PrefServiceSyncableChromeOsTest, } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class PrefServiceSyncableFactoryTest : public PrefServiceSyncableTest { public: @@ -1421,7 +1420,7 @@ TEST_F(PrefServiceSyncableFactoryTest, static_cast<PrefModelAssociator*>( pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES)) ->IsUsingDualLayerUserPrefStoreForTesting()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) EXPECT_FALSE(static_cast<PrefModelAssociator*>( pref_service->GetSyncableService(syncer::OS_PREFERENCES)) ->IsUsingDualLayerUserPrefStoreForTesting()); @@ -1445,7 +1444,7 @@ TEST_F(PrefServiceSyncableFactoryTest, static_cast<PrefModelAssociator*>( pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES)) ->IsUsingDualLayerUserPrefStoreForTesting()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) EXPECT_TRUE(static_cast<PrefModelAssociator*>( pref_service->GetSyncableService(syncer::OS_PREFERENCES)) ->IsUsingDualLayerUserPrefStoreForTesting()); diff --git a/components/sync_preferences/syncable_prefs_database.cc b/components/sync_preferences/syncable_prefs_database.cc index aa71d316f16e7..9c97b08e0ad44 100644 --- a/components/sync_preferences/syncable_prefs_database.cc +++ b/components/sync_preferences/syncable_prefs_database.cc @@ -7,7 +7,6 @@ #include <string_view> #include "base/logging.h" -#include "build/chromeos_buildflags.h" namespace sync_preferences { diff --git a/components/sync_preferences/syncable_prefs_database.h b/components/sync_preferences/syncable_prefs_database.h index f127c7ac5661f..f8dfbbac8a9f3 100644 --- a/components/sync_preferences/syncable_prefs_database.h +++ b/components/sync_preferences/syncable_prefs_database.h @@ -11,7 +11,6 @@ #include "base/check.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/sync/base/data_type.h" namespace sync_preferences { @@ -56,10 +55,10 @@ class SyncablePrefMetadata { merge_behaviour_(merge_behavior) { CHECK(data_type_ == syncer::PREFERENCES || data_type_ == syncer::PRIORITY_PREFERENCES -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) || data_type_ == syncer::OS_PREFERENCES || data_type_ == syncer::OS_PRIORITY_PREFERENCES -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) ) << "Invalid type " << data_type_ << " for syncable pref with id=" << syncable_pref_id_; diff --git a/components/system_media_controls/linux/buildflags/buildflags.gni b/components/system_media_controls/linux/buildflags/buildflags.gni index 693bed3a79a22..539eea3c1fff6 100644 --- a/components/system_media_controls/linux/buildflags/buildflags.gni +++ b/components/system_media_controls/linux/buildflags/buildflags.gni @@ -2,11 +2,10 @@ # 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() { # Enables Chromium implementation of the MPRIS D-Bus interface for controlling # media playback. See ../README.md for details. - use_mpris = (is_linux || is_chromeos_lacros) && use_dbus + use_mpris = is_linux && use_dbus } diff --git a/components/translate/core/browser/BUILD.gn b/components/translate/core/browser/BUILD.gn index 5510f45387e91..1063102bd5fa8 100644 --- a/components/translate/core/browser/BUILD.gn +++ b/components/translate/core/browser/BUILD.gn @@ -51,7 +51,6 @@ static_library("browser") { deps = [ "//base", "//base:i18n", - "//build:chromeos_buildflags", "//components/assist_ranker", "//components/assist_ranker/proto", "//components/keyed_service/core", @@ -111,7 +110,6 @@ source_set("unit_tests") { ":browser", ":test_support", "//base", - "//build:chromeos_buildflags", "//components/assist_ranker", "//components/assist_ranker/proto", "//components/infobars/core", @@ -154,7 +152,6 @@ source_set("test_support") { ] deps = [ "//base", - "//build:chromeos_buildflags", "//components/infobars/core", "//components/language/core/browser", "//components/sync_preferences", diff --git a/components/translate/core/browser/mock_translate_client.cc b/components/translate/core/browser/mock_translate_client.cc index db697642cdade..ff046fb1da98d 100644 --- a/components/translate/core/browser/mock_translate_client.cc +++ b/components/translate/core/browser/mock_translate_client.cc @@ -4,7 +4,6 @@ #include <memory> -#include "build/chromeos_buildflags.h" #include "components/translate/core/browser/mock_translate_client.h" #include "components/translate/core/browser/translate_prefs.h" @@ -12,7 +11,7 @@ namespace translate { namespace testing { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const char* preferred_languages_prefs = "settings.language.preferred_languages"; #else const char* preferred_languages_prefs = nullptr; diff --git a/components/translate/core/browser/translate_infobar_delegate_unittest.cc b/components/translate/core/browser/translate_infobar_delegate_unittest.cc index ea310f40c261e..4071b76f4c03c 100644 --- a/components/translate/core/browser/translate_infobar_delegate_unittest.cc +++ b/components/translate/core/browser/translate_infobar_delegate_unittest.cc @@ -8,7 +8,6 @@ #include <vector> #include "base/test/task_environment.h" -#include "build/chromeos_buildflags.h" #include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar_manager.h" #include "components/language/core/browser/accept_languages_service.h" @@ -105,7 +104,7 @@ class TranslateInfoBarDelegateTest : public ::testing::Test { language::LanguagePrefs::RegisterProfilePrefs(pref_service_->registry()); pref_service_->SetString(testing::accept_languages_prefs, std::string()); pref_service_->SetString(language::prefs::kAcceptLanguages, std::string()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) pref_service_->SetString(language::prefs::kPreferredLanguages, std::string()); #endif @@ -290,7 +289,7 @@ TEST_F(TranslateInfoBarDelegateTest, IsTranslatableLanguage) { base::Value::List& update_list = update.Get(); update_list.Append(kSourceLanguage); pref_service_->SetString(language::prefs::kAcceptLanguages, kSourceLanguage); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) pref_service_->SetString(language::prefs::kPreferredLanguages, kSourceLanguage); #endif diff --git a/components/translate/core/browser/translate_manager_unittest.cc b/components/translate/core/browser/translate_manager_unittest.cc index bf0c1d106136a..9b428f1a3c311 100644 --- a/components/translate/core/browser/translate_manager_unittest.cc +++ b/components/translate/core/browser/translate_manager_unittest.cc @@ -15,7 +15,6 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/infobars/core/infobar.h" #include "components/language/core/browser/accept_languages_service.h" #include "components/language/core/browser/language_model.h" @@ -125,7 +124,7 @@ struct ProfilePrefRegistration { sync_preferences::TestingPrefServiceSyncable* prefs) { language::LanguagePrefs::RegisterProfilePrefs(prefs->registry()); prefs->SetString(accept_languages_prefs, std::string()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) prefs->SetString(preferred_languages_prefs, std::string()); #endif TranslatePrefs::RegisterProfilePrefs(prefs->registry()); diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc index 7e556a9a85653..ca7cab8efac92 100644 --- a/components/translate/core/browser/translate_prefs.cc +++ b/components/translate/core/browser/translate_prefs.cc @@ -22,7 +22,6 @@ #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/language/core/browser/accept_languages_service.h" #include "components/language/core/browser/language_prefs.h" #include "components/language/core/browser/pref_names.h" @@ -213,7 +212,7 @@ void TranslatePrefs::ResetToDefaults() { // static base::Value::List TranslatePrefs::GetDefaultBlockedLanguages() { base::Value::List languages; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Preferred languages. std::string language = language::kFallbackInputMethodLocale; language::ToTranslateLanguageSynonym(&language); diff --git a/components/translate/core/browser/translate_prefs_unittest.cc b/components/translate/core/browser/translate_prefs_unittest.cc index 3543d69a6de37..6ea1aa2657446 100644 --- a/components/translate/core/browser/translate_prefs_unittest.cc +++ b/components/translate/core/browser/translate_prefs_unittest.cc @@ -19,7 +19,6 @@ #include "base/time/time.h" #include "base/values.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/language/core/browser/language_prefs.h" #include "components/language/core/browser/language_prefs_test_util.h" #include "components/language/core/browser/pref_names.h" @@ -71,7 +70,7 @@ class TranslatePrefsTest : public testing::Test { void SetUp() override { prefs_.SetString(language::prefs::kAcceptLanguages, std::string()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) prefs_.SetString(language::prefs::kPreferredLanguages, std::string()); #endif prefs_.registry()->RegisterBooleanPref( @@ -591,7 +590,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageUp) { {"it", "es"}); accept_languages_tester_->ExpectAcceptLanguagePrefs("it,en,fr,es"); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) //--------------------------------------------------------------------------- // Move with policy-forced languages present. // Forced languages should always remain at the top of the languages list and @@ -720,7 +719,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageUp) { {"en", "fr", "it", "es", "zh"}); accept_languages_tester_->ExpectAcceptLanguagePrefs("es,en,fr,it,zh"); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) //--------------------------------------------------------------------------- // Move with policy-forced languages present. // Only test on non-Chrome OS platforms. @@ -810,7 +809,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageDown) { {"fr", "it"}); accept_languages_tester_->ExpectAcceptLanguagePrefs("en,fr,es,it"); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) //--------------------------------------------------------------------------- // Move with policy-forced languages present. // Only test on non-Chrome OS platforms. diff --git a/components/translate/core/browser/translate_ui_delegate.cc b/components/translate/core/browser/translate_ui_delegate.cc index bb402a9360de5..0e711231d3500 100644 --- a/components/translate/core/browser/translate_ui_delegate.cc +++ b/components/translate/core/browser/translate_ui_delegate.cc @@ -51,7 +51,7 @@ TranslateUIDelegate::TranslateUIDelegate( language::kContentLanguagesInLanguagePicker, language::kContentLanguagesDisableObserversParam, false /* default */)) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const std::string& pref_name = language::prefs::kPreferredLanguages; #else const std::string& pref_name = language::prefs::kAcceptLanguages; diff --git a/components/translate/core/browser/translate_ui_delegate_unittest.cc b/components/translate/core/browser/translate_ui_delegate_unittest.cc index 0802bc4b2a472..80e7527ac3a2c 100644 --- a/components/translate/core/browser/translate_ui_delegate_unittest.cc +++ b/components/translate/core/browser/translate_ui_delegate_unittest.cc @@ -9,7 +9,6 @@ #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 "components/infobars/core/infobar.h" #include "components/language/core/browser/language_model.h" #include "components/language/core/browser/language_prefs.h" @@ -60,7 +59,7 @@ class TranslateUIDelegateTest : public ::testing::Test { std::make_unique<sync_preferences::TestingPrefServiceSyncable>(); language::LanguagePrefs::RegisterProfilePrefs(pref_service_->registry()); pref_service_->SetString(language::prefs::kAcceptLanguages, std::string()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) pref_service_->SetString(language::prefs::kPreferredLanguages, std::string()); #endif diff --git a/components/translate/core/browser/translate_ui_languages_manager.cc b/components/translate/core/browser/translate_ui_languages_manager.cc index ec6d94416daf2..f13457bf4027f 100644 --- a/components/translate/core/browser/translate_ui_languages_manager.cc +++ b/components/translate/core/browser/translate_ui_languages_manager.cc @@ -12,7 +12,6 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/language/core/common/language_experiments.h" #include "components/strings/grit/components_strings.h" #include "components/translate/core/browser/language_state.h" diff --git a/components/trusted_vault/BUILD.gn b/components/trusted_vault/BUILD.gn index 97ee306415128..3a7565d12a1b2 100644 --- a/components/trusted_vault/BUILD.gn +++ b/components/trusted_vault/BUILD.gn @@ -146,20 +146,4 @@ static_library("test_support") { "//url", ] } - - if (is_chromeos_lacros) { - sources += [ - "test/fake_crosapi_trusted_vault_backend.cc", - "test/fake_crosapi_trusted_vault_backend.h", - "test/fake_crosapi_trusted_vault_backend_service.cc", - "test/fake_crosapi_trusted_vault_backend_service.h", - ] - - public_deps += [ - "//chromeos/crosapi/mojom", - "//mojo/public/cpp/bindings", - ] - - deps += [ "//components/account_manager_core" ] - } } diff --git a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.cc b/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.cc deleted file mode 100644 index b652b80dd4041..0000000000000 --- a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.cc +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h" - -#include <utility> - -#include "base/check.h" -#include "chromeos/crosapi/mojom/account_manager.mojom.h" -#include "components/account_manager_core/account.h" -#include "components/account_manager_core/account_manager_util.h" - -namespace trusted_vault { - -FakeCrosapiTrustedVaultBackend::FakeCrosapiTrustedVaultBackend( - TrustedVaultClient* client) - : trusted_vault_client_(client) { - CHECK(trusted_vault_client_); - trusted_vault_client_->AddObserver(this); -} - -FakeCrosapiTrustedVaultBackend::~FakeCrosapiTrustedVaultBackend() { - trusted_vault_client_->RemoveObserver(this); -} - -void FakeCrosapiTrustedVaultBackend::BindReceiver( - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackend> - pending_receiver) { - receiver_.Bind(std::move(pending_receiver)); -} - -mojo::PendingRemote<crosapi::mojom::TrustedVaultBackend> -FakeCrosapiTrustedVaultBackend::BindNewPipeAndPassRemote() { - return receiver_.BindNewPipeAndPassRemote(); -} - -void FakeCrosapiTrustedVaultBackend::FlushMojo() { - receiver_.FlushForTesting(); - observer_.FlushForTesting(); -} - -void FakeCrosapiTrustedVaultBackend::SetPrimaryAccountInfo( - const CoreAccountInfo& primary_account_info) { - primary_account_info_ = primary_account_info; -} - -void FakeCrosapiTrustedVaultBackend::OnTrustedVaultKeysChanged() { - if (observer_.is_bound()) { - observer_->OnTrustedVaultKeysChanged(); - } -} - -void FakeCrosapiTrustedVaultBackend::OnTrustedVaultRecoverabilityChanged() { - if (observer_.is_bound()) { - observer_->OnTrustedVaultRecoverabilityChanged(); - } -} - -void FakeCrosapiTrustedVaultBackend::AddObserver( - mojo::PendingRemote<crosapi::mojom::TrustedVaultBackendObserver> observer) { - observer_.Bind(std::move(observer)); -} - -void FakeCrosapiTrustedVaultBackend::FetchKeys( - crosapi::mojom::AccountKeyPtr account_key, - FetchKeysCallback callback) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - std::move(callback).Run(std::vector<std::vector<uint8_t>>()); - return; - } - trusted_vault_client_->FetchKeys(primary_account_info_, std::move(callback)); -} - -void FakeCrosapiTrustedVaultBackend::MarkLocalKeysAsStale( - crosapi::mojom::AccountKeyPtr account_key, - MarkLocalKeysAsStaleCallback callback) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - std::move(callback).Run(false); - return; - } - trusted_vault_client_->MarkLocalKeysAsStale(primary_account_info_, - std::move(callback)); -} - -void FakeCrosapiTrustedVaultBackend::StoreKeys( - crosapi::mojom::AccountKeyPtr account_key, - const std::vector<std::vector<uint8_t>>& keys, - int32_t last_key_version) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - return; - } - trusted_vault_client_->StoreKeys(primary_account_info_.gaia, keys, - last_key_version); -} - -void FakeCrosapiTrustedVaultBackend::GetIsRecoverabilityDegraded( - crosapi::mojom::AccountKeyPtr account_key, - GetIsRecoverabilityDegradedCallback callback) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - std::move(callback).Run(false); - return; - } - trusted_vault_client_->GetIsRecoverabilityDegraded(primary_account_info_, - std::move(callback)); -} - -void FakeCrosapiTrustedVaultBackend::AddTrustedRecoveryMethod( - crosapi::mojom::AccountKeyPtr account_key, - const std::vector<uint8_t>& public_key, - int32_t method_type_hint, - AddTrustedRecoveryMethodCallback callback) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - std::move(callback).Run(); - return; - } - trusted_vault_client_->AddTrustedRecoveryMethod(primary_account_info_.gaia, - public_key, method_type_hint, - std::move(callback)); -} - -void FakeCrosapiTrustedVaultBackend::ClearLocalDataForAccount( - crosapi::mojom::AccountKeyPtr account_key) { - if (!ValidateAccountKeyIsPrimaryAccount(account_key)) { - return; - } - trusted_vault_client_->ClearLocalDataForAccount(primary_account_info_); -} - -bool FakeCrosapiTrustedVaultBackend::ValidateAccountKeyIsPrimaryAccount( - const crosapi::mojom::AccountKeyPtr& mojo_account_key) const { - const std::optional<account_manager::AccountKey> account_key = - account_manager::FromMojoAccountKey(mojo_account_key); - return account_key.has_value() && - account_key->account_type() == account_manager::AccountType::kGaia && - account_key->id() == primary_account_info_.gaia; -} - -} // namespace trusted_vault diff --git a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h b/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h deleted file mode 100644 index 21d62af80a6d1..0000000000000 --- a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_H_ -#define COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_H_ - -#include "chromeos/crosapi/mojom/account_manager.mojom-forward.h" -#include "chromeos/crosapi/mojom/trusted_vault.mojom.h" -#include "components/signin/public/identity_manager/account_info.h" -#include "components/trusted_vault/trusted_vault_client.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace trusted_vault { - -// Fake implementation of TrustedVaultBackend mojo interface, that allows to -// test Lacros counterpart of counterpart (real implementation lives in Ash). -class FakeCrosapiTrustedVaultBackend - : public crosapi::mojom::TrustedVaultBackend, - public TrustedVaultClient::Observer { - public: - explicit FakeCrosapiTrustedVaultBackend( - TrustedVaultClient* client); - ~FakeCrosapiTrustedVaultBackend() override; - - void BindReceiver( - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackend> receiver); - mojo::PendingRemote<crosapi::mojom::TrustedVaultBackend> - BindNewPipeAndPassRemote(); - void FlushMojo(); - void SetPrimaryAccountInfo(const CoreAccountInfo& primary_account_info); - - // TrustedVaultClient::Observer implementation. - void OnTrustedVaultKeysChanged() override; - void OnTrustedVaultRecoverabilityChanged() override; - - // crosapi::mojom::TrustedVaultBackend implementation. - void AddObserver( - mojo::PendingRemote<crosapi::mojom::TrustedVaultBackendObserver> observer) - override; - void FetchKeys(crosapi::mojom::AccountKeyPtr account_key, - FetchKeysCallback callback) override; - void MarkLocalKeysAsStale(crosapi::mojom::AccountKeyPtr account_key, - MarkLocalKeysAsStaleCallback callback) override; - void StoreKeys(crosapi::mojom::AccountKeyPtr account_key, - const std::vector<std::vector<uint8_t>>& keys, - int32_t last_key_version) override; - void GetIsRecoverabilityDegraded( - crosapi::mojom::AccountKeyPtr account_key, - GetIsRecoverabilityDegradedCallback callback) override; - void AddTrustedRecoveryMethod( - crosapi::mojom::AccountKeyPtr account_key, - const std::vector<uint8_t>& public_key, - int32_t method_type_hint, - AddTrustedRecoveryMethodCallback callback) override; - void ClearLocalDataForAccount( - crosapi::mojom::AccountKeyPtr account_key) override; - - private: - bool ValidateAccountKeyIsPrimaryAccount( - const crosapi::mojom::AccountKeyPtr& account_key) const; - - CoreAccountInfo primary_account_info_; - const raw_ptr<TrustedVaultClient> trusted_vault_client_; - - mojo::Receiver<crosapi::mojom::TrustedVaultBackend> receiver_{this}; - mojo::Remote<crosapi::mojom::TrustedVaultBackendObserver> observer_; -}; - -} // namespace trusted_vault - -#endif // COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_H_ diff --git a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.cc b/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.cc deleted file mode 100644 index 301f32954774c..0000000000000 --- a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.h" - -#include "base/check.h" -#include "base/notreached.h" -#include "chromeos/crosapi/mojom/account_manager.mojom.h" -#include "chromeos/crosapi/mojom/trusted_vault.mojom.h" -#include "components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h" - -namespace trusted_vault { - -FakeCrosapiTrustedVaultBackendService::FakeCrosapiTrustedVaultBackendService( - TrustedVaultClient* chrome_sync_trusted_vault_client, - TrustedVaultClient* passkeys_trusted_vault_client) - : chrome_sync_trusted_vault_backend_( - std::make_unique<trusted_vault::FakeCrosapiTrustedVaultBackend>( - chrome_sync_trusted_vault_client)), - passkeys_trusted_vault_backend_( - std::make_unique<trusted_vault::FakeCrosapiTrustedVaultBackend>( - passkeys_trusted_vault_client)) {} - -FakeCrosapiTrustedVaultBackendService:: - ~FakeCrosapiTrustedVaultBackendService() = default; - -void FakeCrosapiTrustedVaultBackendService::BindReceiver( - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackendService> - pending_receiver) { - receiver_.Bind(std::move(pending_receiver)); -} - -mojo::PendingRemote<crosapi::mojom::TrustedVaultBackendService> -FakeCrosapiTrustedVaultBackendService::BindNewPipeAndPassRemote() { - return receiver_.BindNewPipeAndPassRemote(); -} - -FakeCrosapiTrustedVaultBackend& -FakeCrosapiTrustedVaultBackendService::chrome_sync_backend() { - return *chrome_sync_trusted_vault_backend_; -} - -FakeCrosapiTrustedVaultBackend& -FakeCrosapiTrustedVaultBackendService::passkeys_backend() { - return *passkeys_trusted_vault_backend_; -} - -void FakeCrosapiTrustedVaultBackendService::GetTrustedVaultBackend( - crosapi::mojom::SecurityDomainId security_domain, - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackend> backend) { - switch (security_domain) { - case crosapi::mojom::SecurityDomainId::kUnknown: - NOTREACHED(); - case crosapi::mojom::SecurityDomainId::kChromeSync: - chrome_sync_trusted_vault_backend_->BindReceiver(std::move(backend)); - break; - case crosapi::mojom::SecurityDomainId::kPasskeys: - passkeys_trusted_vault_backend_->BindReceiver(std::move(backend)); - break; - } -} - -} // namespace trusted_vault diff --git a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.h b/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.h deleted file mode 100644 index 774725b9dd6ac..0000000000000 --- a/components/trusted_vault/test/fake_crosapi_trusted_vault_backend_service.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_SERVICE_H_ -#define COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_SERVICE_H_ - -#include <memory> - -#include "chromeos/crosapi/mojom/trusted_vault.mojom.h" -#include "components/trusted_vault/test/fake_crosapi_trusted_vault_backend.h" -#include "components/trusted_vault/trusted_vault_client.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace trusted_vault { - -// Fake implementation of TrustedVaultBackendService mojo interface, that allows -// to test Lacros counterpart of counterpart (real implementation lives in Ash). -class FakeCrosapiTrustedVaultBackendService - : public crosapi::mojom::TrustedVaultBackendService { - public: - FakeCrosapiTrustedVaultBackendService( - TrustedVaultClient* chrome_sync_trusted_vault_client, - TrustedVaultClient* passkeys_trusted_vault_client); - ~FakeCrosapiTrustedVaultBackendService() override; - - void BindReceiver( - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackendService> - receiver); - mojo::PendingRemote<crosapi::mojom::TrustedVaultBackendService> - BindNewPipeAndPassRemote(); - - FakeCrosapiTrustedVaultBackend& chrome_sync_backend(); - FakeCrosapiTrustedVaultBackend& passkeys_backend(); - - // crosapi::mojom::TrustedVaultBackendService: - void GetTrustedVaultBackend( - crosapi::mojom::SecurityDomainId security_domain, - mojo::PendingReceiver<crosapi::mojom::TrustedVaultBackend> backend) - override; - - private: - std::unique_ptr<trusted_vault::FakeCrosapiTrustedVaultBackend> - chrome_sync_trusted_vault_backend_; - std::unique_ptr<trusted_vault::FakeCrosapiTrustedVaultBackend> - passkeys_trusted_vault_backend_; - - mojo::Receiver<crosapi::mojom::TrustedVaultBackendService> receiver_{this}; -}; - -} // namespace trusted_vault - -#endif // COMPONENTS_TRUSTED_VAULT_TEST_FAKE_CROSAPI_TRUSTED_VAULT_BACKEND_SERVICE_H_ diff --git a/components/unified_consent/BUILD.gn b/components/unified_consent/BUILD.gn index 0a55ab85b8b3a..78759bc9cc24b 100644 --- a/components/unified_consent/BUILD.gn +++ b/components/unified_consent/BUILD.gn @@ -40,7 +40,6 @@ source_set("unit_tests") { deps = [ ":unified_consent", "//base/test:test_support", - "//build:chromeos_buildflags", "//components/signin/public/identity_manager:test_support", "//components/sync:test_support", "//components/sync_preferences:test_support", diff --git a/components/unified_consent/pref_names.cc b/components/unified_consent/pref_names.cc index b71abb0238019..241b1974459b1 100644 --- a/components/unified_consent/pref_names.cc +++ b/components/unified_consent/pref_names.cc @@ -7,9 +7,9 @@ namespace unified_consent { namespace prefs { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const char kUnifiedConsentMigrationState[] = "unified_consent.migration_state"; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) const char kUrlKeyedAnonymizedDataCollectionEnabled[] = "url_keyed_anonymized_data_collection.enabled"; diff --git a/components/unified_consent/pref_names.h b/components/unified_consent/pref_names.h index b59514d1c8872..b4f65dc325916 100644 --- a/components/unified_consent/pref_names.h +++ b/components/unified_consent/pref_names.h @@ -6,11 +6,10 @@ #define COMPONENTS_UNIFIED_CONSENT_PREF_NAMES_H_ #include "build/build_config.h" -#include "build/chromeos_buildflags.h" namespace unified_consent::prefs { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Integer indicating the migration state of unified consent, defined in // unified_consent::MigrationState. // diff --git a/components/unified_consent/unified_consent_service.cc b/components/unified_consent/unified_consent_service.cc index d90746c5ddd58..a8833b7e6e858 100644 --- a/components/unified_consent/unified_consent_service.cc +++ b/components/unified_consent/unified_consent_service.cc @@ -164,7 +164,7 @@ UnifiedConsentService::UnifiedConsentService( DCHECK(identity_manager_); DCHECK(sync_service_); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (GetMigrationState() == MigrationState::kNotInitialized) MigrateProfileToUnifiedConsent(); #endif @@ -186,7 +186,7 @@ void UnifiedConsentService::RegisterPrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref(prefs::kUrlKeyedAnonymizedDataCollectionEnabled, false); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) registry->RegisterIntegerPref( prefs::kUnifiedConsentMigrationState, static_cast<int>(MigrationState::kNotInitialized)); @@ -195,7 +195,7 @@ void UnifiedConsentService::RegisterPrefs( void UnifiedConsentService::SetUrlKeyedAnonymizedDataCollectionEnabled( bool enabled) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (GetMigrationState() != MigrationState::kCompleted) SetMigrationState(MigrationState::kCompleted); #endif @@ -267,7 +267,7 @@ void UnifiedConsentService::OnStateChanged(syncer::SyncService* sync) { service_pref_changes_.clear(); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // TODO(crbug.com/40066949): Simplify (remove the following block) after // Sync-the-feature users are migrated to ConsentLevel::kSignin (and thus // CanSyncFeatureStart() always returns false). @@ -317,7 +317,7 @@ void UnifiedConsentService::ServicePrefChanged(const std::string& name) { service_pref_changes_[name] = value.Clone(); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) MigrationState UnifiedConsentService::GetMigrationState() { int migration_state_int = pref_service_->GetInteger(prefs::kUnifiedConsentMigrationState); @@ -365,6 +365,6 @@ void UnifiedConsentService::UpdateSettingsForMigration() { !sync_service_->GetUserSettings()->IsUsingExplicitPassphrase(); SetUrlKeyedAnonymizedDataCollectionEnabled(url_keyed_metrics_enabled); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace unified_consent diff --git a/components/unified_consent/unified_consent_service.h b/components/unified_consent/unified_consent_service.h index 12c1e97e57625..c9281536ac5ad 100644 --- a/components/unified_consent/unified_consent_service.h +++ b/components/unified_consent/unified_consent_service.h @@ -32,14 +32,14 @@ class SyncService; namespace unified_consent { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) enum class MigrationState : int { kNotInitialized = 0, kInProgressWaitForSyncInit = 1, // Reserve space for other kInProgress* entries to be added here. kCompleted = 10, }; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // A browser-context keyed service that is used to manage the user consent // when UnifiedConsent feature is enabled. @@ -127,7 +127,7 @@ class UnifiedConsentService void StopObservingServicePrefChanges(); void ServicePrefChanged(const std::string& name); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Migration helpers. MigrationState GetMigrationState(); void SetMigrationState(MigrationState migration_state); diff --git a/components/unified_consent/unified_consent_service_unittest.cc b/components/unified_consent/unified_consent_service_unittest.cc index 7291b5cfcb9a3..f07ed97aaa81e 100644 --- a/components/unified_consent/unified_consent_service_unittest.cc +++ b/components/unified_consent/unified_consent_service_unittest.cc @@ -13,7 +13,6 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/signin/public/identity_manager/identity_test_environment.h" #include "components/sync/base/features.h" #include "components/sync/base/user_selectable_type.h" @@ -91,7 +90,7 @@ class UnifiedConsentServiceTest : public testing::Test { } } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) unified_consent::MigrationState GetMigrationState() { int migration_state_int = pref_service_.GetInteger(prefs::kUnifiedConsentMigrationState); @@ -199,7 +198,7 @@ TEST_F(UnifiedConsentServiceTest, ReplaceSync_HistorySyncIgnoredForSyncUsers) { prefs::kUrlKeyedAnonymizedDataCollectionEnabled)); } -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) // Tests that kUrlKeyedAnonymizedDataCollectionEnabled is enabled after // syncing user signs out, then in again and enabled history sync opt-in. TEST_F(UnifiedConsentServiceTest, @@ -238,7 +237,7 @@ TEST_F(UnifiedConsentServiceTest, EXPECT_FALSE(pref_service()->GetBoolean( prefs::kUrlKeyedAnonymizedDataCollectionEnabled)); } -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) +#endif // !BUILDFLAG(IS_CHROMEOS) // Tests that any change to history sync opt-in, is reflected in the state // of `kUrlKeyedAnonymizedDataCollectionEnabled`. @@ -361,7 +360,7 @@ TEST_F(UnifiedConsentServiceTest, ReplaceSync_StateTransitions) { } } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(UnifiedConsentServiceTest, Migration_UpdateSettings) { // Create user that syncs history and has no custom passphrase. SignIn(signin::ConsentLevel::kSync); @@ -402,6 +401,6 @@ TEST_F(UnifiedConsentServiceTest, ClearPrimaryAccountDisablesSomeServices) { EXPECT_FALSE(pref_service()->GetBoolean( prefs::kUrlKeyedAnonymizedDataCollectionEnabled)); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace unified_consent diff --git a/components/update_client/BUILD.gn b/components/update_client/BUILD.gn index 3f795f9a49681..aa23adbe74a3c 100644 --- a/components/update_client/BUILD.gn +++ b/components/update_client/BUILD.gn @@ -65,7 +65,6 @@ source_set("patch_impl") { ] deps = [ ":update_client", - "//build:chromeos_buildflags", "//components/services/patch/public/cpp", "//components/services/patch/public/mojom", "//mojo/public/cpp/bindings", @@ -163,7 +162,6 @@ static_library("update_client") { deps = [ "//base", "//build:branding_buildflags", - "//build:chromeos_buildflags", "//components/client_update_protocol", "//components/crx_file", "//components/prefs", diff --git a/components/update_client/update_query_params.cc b/components/update_client/update_query_params.cc index 1a8b4459fca5c..b1701d056cb05 100644 --- a/components/update_client/update_query_params.cc +++ b/components/update_client/update_query_params.cc @@ -9,7 +9,6 @@ #include "base/system/sys_info.h" #include "build/branding_buildflags.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/update_client/update_query_params_delegate.h" #include "components/version_info/version_info.h" @@ -34,7 +33,7 @@ const char kOs[] = "android"; #elif BUILDFLAG(IS_CHROMEOS) "cros"; -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#elif BUILDFLAG(IS_LINUX) "linux"; #elif BUILDFLAG(IS_FUCHSIA) "fuchsia"; diff --git a/components/user_manager/BUILD.gn b/components/user_manager/BUILD.gn index 1453abeb852b1..ad904ecea7e9a 100644 --- a/components/user_manager/BUILD.gn +++ b/components/user_manager/BUILD.gn @@ -2,8 +2,6 @@ # 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") - component("common") { sources = [ "user_type.cc", @@ -41,7 +39,7 @@ component("user_manager") { defines = [ "USER_MANAGER_IMPLEMENTATION" ] - if (is_chromeos_ash) { + if (is_chromeos) { sources += [ "account_id_util.cc", "account_id_util.h", @@ -82,7 +80,7 @@ component("user_manager") { } } -if (is_chromeos_ash) { +if (is_chromeos) { source_set("test_support") { testonly = true sources = [ diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index 1dcab778676a6..2d20fe5a82e35 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn @@ -2,7 +2,6 @@ # 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/util/branding.gni") import("//components/vector_icons/vector_icons.gni") @@ -259,11 +258,10 @@ aggregate_vector_icons("components_vector_icons") { ] if (is_chromeos) { - sources += [ "notification_download.icon" ] - } - - if (is_chromeos_ash) { - sources += [ "videogame_asset_outline.icon" ] + sources += [ + "notification_download.icon", + "videogame_asset_outline.icon", + ] } if (is_chrome_branded) { diff --git a/components/version_ui/BUILD.gn b/components/version_ui/BUILD.gn index 913cf913dca7a..49f73fb885870 100644 --- a/components/version_ui/BUILD.gn +++ b/components/version_ui/BUILD.gn @@ -12,7 +12,6 @@ static_library("version_ui") { deps = [ "//base", - "//build:chromeos_buildflags", "//components/variations", "//components/variations/net", "//components/variations/service", diff --git a/components/version_ui/version_ui_constants.cc b/components/version_ui/version_ui_constants.cc index 1054d152285f7..a4677847706a6 100644 --- a/components/version_ui/version_ui_constants.cc +++ b/components/version_ui/version_ui_constants.cc @@ -5,7 +5,6 @@ #include "components/version_ui/version_ui_constants.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" namespace version_ui { @@ -49,7 +48,7 @@ const char kJSVersion[] = "js_version"; #endif const char kLogoAltText[] = "logo_alt_text"; const char kOfficial[] = "official"; -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) const char kOSName[] = "os_name"; const char kOSType[] = "os_type"; #endif diff --git a/components/version_ui/version_ui_constants.h b/components/version_ui/version_ui_constants.h index 0d35047553461..5d43d7626b3c3 100644 --- a/components/version_ui/version_ui_constants.h +++ b/components/version_ui/version_ui_constants.h @@ -6,7 +6,6 @@ #define COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_ #include "build/build_config.h" -#include "build/chromeos_buildflags.h" namespace version_ui { @@ -51,7 +50,7 @@ extern const char kJSVersion[]; #endif extern const char kLogoAltText[]; extern const char kOfficial[]; -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) extern const char kOSName[]; extern const char kOSType[]; #endif diff --git a/components/web_resource/BUILD.gn b/components/web_resource/BUILD.gn index b9fc4bfa19103..ab73617524a74 100644 --- a/components/web_resource/BUILD.gn +++ b/components/web_resource/BUILD.gn @@ -15,7 +15,6 @@ static_library("web_resource") { deps = [ "//base", "//build:branding_buildflags", - "//build:chromeos_buildflags", "//components/pref_registry", "//components/prefs", "//services/network/public/cpp", diff --git a/components/web_resource/eula_accepted_notifier.cc b/components/web_resource/eula_accepted_notifier.cc index 23cb39cfc197e..ac78d2f6f7594 100644 --- a/components/web_resource/eula_accepted_notifier.cc +++ b/components/web_resource/eula_accepted_notifier.cc @@ -8,7 +8,6 @@ #include "base/functional/bind.h" #include "build/branding_buildflags.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "components/prefs/pref_service.h" #include "components/web_resource/web_resource_pref_names.h" @@ -44,7 +43,7 @@ bool EulaAcceptedNotifier::IsEulaAccepted() { EulaAcceptedNotifier* EulaAcceptedNotifier::Create(PrefService* local_state) { // First run EULA only exists on ChromeOS, Android and iOS. On ChromeOS, it is // only shown in official builds. -#if (BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(GOOGLE_CHROME_BRANDING)) || \ +#if (BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(GOOGLE_CHROME_BRANDING)) || \ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) // Tests that use higher-level classes that use EulaAcceptNotifier may not // have local state or may not register this pref. Return null to indicate not