Remove IS_CHROMEOS_ASH from //components/*
This cleans up the following subdirectories: sessions, soda, storage_monitor, supervised_user, sync_preferences, system_media_controls, translate, trusted_vault, unified_consent, update_client, user_manager, vector_icons, version_ui, web_resource 1) Removed IS_CHROMEOS_LACROS usages and code it guarded 2) Renamed IS_CHROMEOS_ASH to IS_CHROMEOS 3) Removed chromeos_buildflags.h includes 4) Cleaned up *.gn files from IS_CHROMEOS_*. Bug: 375523816, 373972275, 373971535 Change-Id: I973920d2078526bede68a84dbea53029d202c22d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097194 Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Maksim Sisov <msisov@igalia.com> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org> Cr-Commit-Position: refs/heads/main@{#1397771}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cf38e29997
commit
764f01d25d
components
sessions
soda
storage_monitor
BUILD.gnmtab_watcher_linux.hstorage_monitor.hstorage_monitor_chromeos.hstorage_monitor_linux.htest_storage_monitor.cctest_storage_monitor.h
supervised_user
core
sync_preferences
BUILD.gncommon_syncable_prefs_database.ccdual_layer_user_pref_store.ccdual_layer_user_pref_store_unittest.ccpref_model_associator.ccpref_model_associator_unittest.ccpref_service_syncable.ccpref_service_syncable.hpref_service_syncable_unittest.ccsyncable_prefs_database.ccsyncable_prefs_database.h
system_media_controls
linux
buildflags
translate
core
trusted_vault
BUILD.gn
test
unified_consent
BUILD.gnpref_names.ccpref_names.hunified_consent_service.ccunified_consent_service.hunified_consent_service_unittest.cc
update_client
user_manager
vector_icons
version_ui
web_resource
@@ -136,7 +136,6 @@ source_set("shared") {
|
|||||||
|
|
||||||
public_deps = [
|
public_deps = [
|
||||||
":session_id",
|
":session_id",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/keyed_service/core",
|
"//components/keyed_service/core",
|
||||||
"//skia",
|
"//skia",
|
||||||
]
|
]
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "base/token.h"
|
#include "base/token.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/sessions/core/serialized_navigation_entry.h"
|
#include "components/sessions/core/serialized_navigation_entry.h"
|
||||||
#include "components/sessions/core/serialized_user_agent_override.h"
|
#include "components/sessions/core/serialized_user_agent_override.h"
|
||||||
#include "components/sessions/core/session_id.h"
|
#include "components/sessions/core/session_id.h"
|
||||||
@@ -156,7 +155,7 @@ struct SESSIONS_EXPORT SessionWindow {
|
|||||||
TYPE_APP = 2,
|
TYPE_APP = 2,
|
||||||
TYPE_DEVTOOLS = 3,
|
TYPE_DEVTOOLS = 3,
|
||||||
TYPE_APP_POPUP = 4,
|
TYPE_APP_POPUP = 4,
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
TYPE_CUSTOM_TAB = 5,
|
TYPE_CUSTOM_TAB = 5,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@@ -253,7 +253,7 @@ bool DeserializeWindowType(int type_int,
|
|||||||
case sessions::SessionWindow::TYPE_APP:
|
case sessions::SessionWindow::TYPE_APP:
|
||||||
case sessions::SessionWindow::TYPE_DEVTOOLS:
|
case sessions::SessionWindow::TYPE_DEVTOOLS:
|
||||||
case sessions::SessionWindow::TYPE_APP_POPUP:
|
case sessions::SessionWindow::TYPE_APP_POPUP:
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
case sessions::SessionWindow::TYPE_CUSTOM_TAB:
|
case sessions::SessionWindow::TYPE_CUSTOM_TAB:
|
||||||
#endif
|
#endif
|
||||||
*type = static_cast<sessions::SessionWindow::WindowType>(type_int);
|
*type = static_cast<sessions::SessionWindow::WindowType>(type_int);
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/buildflag_header.gni")
|
import("//build/buildflag_header.gni")
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
import("//components/soda/buildflags.gni")
|
import("//components/soda/buildflags.gni")
|
||||||
|
|
||||||
assert(!is_android)
|
assert(!is_android)
|
||||||
@@ -26,13 +25,12 @@ component("soda") {
|
|||||||
deps = [
|
deps = [
|
||||||
":constants",
|
":constants",
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/live_caption:constants",
|
"//components/live_caption:constants",
|
||||||
"//components/prefs",
|
"//components/prefs",
|
||||||
"//media",
|
"//media",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
sources += [
|
sources += [
|
||||||
"soda_installer_impl_chromeos.cc",
|
"soda_installer_impl_chromeos.cc",
|
||||||
"soda_installer_impl_chromeos.h",
|
"soda_installer_impl_chromeos.h",
|
||||||
@@ -45,10 +43,6 @@ component("soda") {
|
|||||||
"//ui/base",
|
"//ui/base",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_chromeos_lacros) {
|
|
||||||
deps += [ "//chromeos/startup:startup" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("constants") {
|
source_set("constants") {
|
||||||
@@ -85,18 +79,14 @@ source_set("utils") {
|
|||||||
"//ui/base",
|
"//ui/base",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
deps += [ "//ash/constants:constants" ]
|
deps += [ "//ash/constants:constants" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_chromeos_lacros) {
|
|
||||||
deps += [ "//chromeos/startup:startup" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("unit_tests") {
|
source_set("unit_tests") {
|
||||||
testonly = true
|
testonly = true
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
sources = [ "soda_installer_impl_chromeos_unittest.cc" ]
|
sources = [ "soda_installer_impl_chromeos_unittest.cc" ]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
|
|
||||||
namespace speech {
|
namespace speech {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
BASE_FEATURE(kCrosExpandSodaLanguages,
|
BASE_FEATURE(kCrosExpandSodaLanguages,
|
||||||
"CrosExpandSodaLanguages",
|
"CrosExpandSodaLanguages",
|
||||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "base/strings/string_split.h"
|
#include "base/strings/string_split.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/live_caption/pref_names.h"
|
#include "components/live_caption/pref_names.h"
|
||||||
#include "components/prefs/pref_service.h"
|
#include "components/prefs/pref_service.h"
|
||||||
#include "components/prefs/scoped_user_pref_update.h"
|
#include "components/prefs/scoped_user_pref_update.h"
|
||||||
@@ -20,10 +19,10 @@
|
|||||||
#include "components/soda/pref_names.h"
|
#include "components/soda/pref_names.h"
|
||||||
#include "media/base/media_switches.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_features.h"
|
||||||
#include "ash/constants/ash_pref_names.h"
|
#include "ash/constants/ash_pref_names.h"
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -41,10 +40,10 @@ SodaInstaller* g_instance = nullptr;
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
SodaInstaller* SodaInstaller::GetInstance() {
|
SodaInstaller* SodaInstaller::GetInstance() {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
DCHECK(
|
DCHECK(
|
||||||
base::FeatureList::IsEnabled(ash::features::kOnDeviceSpeechRecognition));
|
base::FeatureList::IsEnabled(ash::features::kOnDeviceSpeechRecognition));
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
return g_instance;
|
return g_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +62,7 @@ void SodaInstaller::RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
|
|||||||
registry->RegisterTimePref(prefs::kSodaScheduledDeletionTime, base::Time());
|
registry->RegisterTimePref(prefs::kSodaScheduledDeletionTime, base::Time());
|
||||||
SodaInstaller::RegisterRegisteredLanguagePackPref(registry);
|
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
|
// 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
|
// method in the parent class to avoid duplicate declaration build errors
|
||||||
// (specifically on Windows).
|
// (specifically on Windows).
|
||||||
@@ -74,16 +73,16 @@ void SodaInstaller::RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
|
|||||||
kLanguageComponentConfigs) {
|
kLanguageComponentConfigs) {
|
||||||
registry->RegisterFilePathPref(config.config_path_pref, base::FilePath());
|
registry->RegisterFilePathPref(config.config_path_pref, base::FilePath());
|
||||||
}
|
}
|
||||||
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // !BUILDFLAG(IS_CHROMEOS)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SodaInstaller::Init(PrefService* profile_prefs,
|
void SodaInstaller::Init(PrefService* profile_prefs,
|
||||||
PrefService* global_prefs) {
|
PrefService* global_prefs) {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
if (!base::FeatureList::IsEnabled(
|
if (!base::FeatureList::IsEnabled(
|
||||||
ash::features::kOnDeviceSpeechRecognition) ||
|
ash::features::kOnDeviceSpeechRecognition) ||
|
||||||
soda_installer_initialized_) {
|
soda_installer_initialized_) {
|
||||||
#else // !BUILDFLAG(IS_CHROMEOS_ASH)
|
#else // !BUILDFLAG(IS_CHROMEOS)
|
||||||
if (soda_installer_initialized_) {
|
if (soda_installer_initialized_) {
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
@@ -301,13 +300,13 @@ std::optional<SodaInstaller::ErrorCode> SodaInstaller::GetSodaInstallErrorCode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SodaInstaller::IsAnyFeatureUsingSodaEnabled(PrefService* prefs) {
|
bool SodaInstaller::IsAnyFeatureUsingSodaEnabled(PrefService* prefs) {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
return prefs->GetBoolean(prefs::kLiveCaptionEnabled) ||
|
return prefs->GetBoolean(prefs::kLiveCaptionEnabled) ||
|
||||||
prefs->GetBoolean(ash::prefs::kAccessibilityDictationEnabled) ||
|
prefs->GetBoolean(ash::prefs::kAccessibilityDictationEnabled) ||
|
||||||
prefs->GetBoolean(ash::prefs::kProjectorCreationFlowEnabled) ||
|
prefs->GetBoolean(ash::prefs::kProjectorCreationFlowEnabled) ||
|
||||||
prefs->GetString(
|
prefs->GetString(
|
||||||
ash::prefs::kClassManagementToolsAvailabilitySetting) == "teacher";
|
ash::prefs::kClassManagementToolsAvailabilitySetting) == "teacher";
|
||||||
#else // !BUILDFLAG(IS_CHROMEOS_ASH)
|
#else // !BUILDFLAG(IS_CHROMEOS)
|
||||||
return prefs->GetBoolean(prefs::kLiveCaptionEnabled);
|
return prefs->GetBoolean(prefs::kLiveCaptionEnabled);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -8,21 +8,16 @@
|
|||||||
|
|
||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/soda/constants.h"
|
#include "components/soda/constants.h"
|
||||||
#include "components/soda/soda_installer.h"
|
#include "components/soda/soda_installer.h"
|
||||||
#include "media/base/media_switches.h"
|
#include "media/base/media_switches.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
#include "ash/constants/ash_features.h"
|
#include "ash/constants/ash_features.h"
|
||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
|
||||||
#include "chromeos/startup/browser_params_proxy.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BUILDFLAG(IS_WIN)
|
#if BUILDFLAG(IS_WIN)
|
||||||
#include "base/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -37,18 +32,9 @@ namespace {
|
|||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
bool IsSupportedChromeOS() {
|
bool IsSupportedChromeOS() {
|
||||||
// Some Chrome OS devices do not support on-device speech.
|
// Some Chrome OS devices do not support on-device speech.
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
return base::FeatureList::IsEnabled(
|
||||||
if (!base::FeatureList::IsEnabled(
|
ash::features::kOnDeviceSpeechRecognition);
|
||||||
ash::features::kOnDeviceSpeechRecognition)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
|
|
||||||
if (!chromeos::BrowserParamsProxy::Get()->IsOndeviceSpeechSupported()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
import("//build/config/features.gni")
|
import("//build/config/features.gni")
|
||||||
|
|
||||||
static_library("storage_monitor") {
|
static_library("storage_monitor") {
|
||||||
@@ -22,7 +21,6 @@ static_library("storage_monitor") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//content/public/browser",
|
"//content/public/browser",
|
||||||
"//mojo/public/cpp/bindings",
|
"//mojo/public/cpp/bindings",
|
||||||
"//services/service_manager/public/cpp",
|
"//services/service_manager/public/cpp",
|
||||||
@@ -53,9 +51,7 @@ static_library("storage_monitor") {
|
|||||||
"ImageCaptureCore.framework",
|
"ImageCaptureCore.framework",
|
||||||
"UniformTypeIdentifiers.framework",
|
"UniformTypeIdentifiers.framework",
|
||||||
]
|
]
|
||||||
} else if (is_chromeos_ash) {
|
} else if (is_chromeos) {
|
||||||
# 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.
|
|
||||||
sources += [
|
sources += [
|
||||||
"storage_monitor_chromeos.cc",
|
"storage_monitor_chromeos.cc",
|
||||||
"storage_monitor_chromeos.h",
|
"storage_monitor_chromeos.h",
|
||||||
@@ -74,7 +70,7 @@ static_library("storage_monitor") {
|
|||||||
]
|
]
|
||||||
deps += [ "//services/device/public/mojom" ]
|
deps += [ "//services/device/public/mojom" ]
|
||||||
}
|
}
|
||||||
} else if (is_linux || is_chromeos_lacros) {
|
} else if (is_linux) {
|
||||||
if (use_udev) {
|
if (use_udev) {
|
||||||
sources += [
|
sources += [
|
||||||
"mtab_watcher_linux.cc",
|
"mtab_watcher_linux.cc",
|
||||||
@@ -117,9 +113,9 @@ static_library("test_support") {
|
|||||||
"//content/public/browser",
|
"//content/public/browser",
|
||||||
]
|
]
|
||||||
|
|
||||||
deps = [ "//build:chromeos_buildflags" ]
|
deps = []
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
sources += [
|
sources += [
|
||||||
"test_media_transfer_protocol_manager_chromeos.cc",
|
"test_media_transfer_protocol_manager_chromeos.cc",
|
||||||
"test_media_transfer_protocol_manager_chromeos.h",
|
"test_media_transfer_protocol_manager_chromeos.h",
|
||||||
@@ -169,7 +165,8 @@ source_set("unit_tests") {
|
|||||||
frameworks = [ "UniformTypeIdentifiers.framework" ]
|
frameworks = [ "UniformTypeIdentifiers.framework" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
|
deps += [ "//chromeos/ash/components/disks:test_support" ]
|
||||||
if (use_dbus) {
|
if (use_dbus) {
|
||||||
deps += [
|
deps += [
|
||||||
"//services/device/public/mojom",
|
"//services/device/public/mojom",
|
||||||
@@ -180,12 +177,9 @@ source_set("unit_tests") {
|
|||||||
"storage_monitor_chromeos_unittest.cc",
|
"storage_monitor_chromeos_unittest.cc",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
} else if (is_linux || is_chromeos_lacros) {
|
} else if (is_linux) {
|
||||||
if (use_udev) {
|
if (use_udev) {
|
||||||
sources += [ "storage_monitor_linux_unittest.cc" ]
|
sources += [ "storage_monitor_linux_unittest.cc" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_chromeos_ash) {
|
|
||||||
deps += [ "//chromeos/ash/components/disks:test_support" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -5,12 +5,6 @@
|
|||||||
#ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_
|
#ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_
|
||||||
#define 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 <map>
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
@@ -19,6 +13,10 @@
|
|||||||
#include "base/sequence_checker.h"
|
#include "base/sequence_checker.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
|
#error "ChromeOS does not use MtabWatcherLinux."
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace storage_monitor {
|
namespace storage_monitor {
|
||||||
|
|
||||||
// MtabWatcherLinux listens for mount point changes from a mtab file and
|
// MtabWatcherLinux listens for mount point changes from a mtab file and
|
||||||
|
@@ -16,10 +16,9 @@
|
|||||||
#include "base/sequence_checker.h"
|
#include "base/sequence_checker.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/storage_monitor/storage_info.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"
|
#include "services/device/public/mojom/mtp_manager.mojom-forward.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -120,7 +119,7 @@ class StorageMonitor {
|
|||||||
std::wstring* storage_object_id) const = 0;
|
std::wstring* storage_object_id) const = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
virtual device::mojom::MtpManager* media_transfer_protocol_manager() = 0;
|
virtual device::mojom::MtpManager* media_transfer_protocol_manager() = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -9,12 +9,6 @@
|
|||||||
#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_
|
#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_CHROMEOS_H_
|
||||||
#define 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 <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -27,6 +21,10 @@
|
|||||||
#include "mojo/public/cpp/bindings/remote.h"
|
#include "mojo/public/cpp/bindings/remote.h"
|
||||||
#include "services/device/public/mojom/mtp_manager.mojom.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 {
|
namespace storage_monitor {
|
||||||
|
|
||||||
class MtpManagerClientChromeOS;
|
class MtpManagerClientChromeOS;
|
||||||
|
@@ -10,12 +10,6 @@
|
|||||||
#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
|
#ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
|
||||||
#define 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 <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -29,6 +23,10 @@
|
|||||||
#include "components/storage_monitor/mtab_watcher_linux.h"
|
#include "components/storage_monitor/mtab_watcher_linux.h"
|
||||||
#include "components/storage_monitor/storage_monitor.h"
|
#include "components/storage_monitor/storage_monitor.h"
|
||||||
|
|
||||||
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
|
#error "Use the ChromeOS-specific implementation instead."
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
class SequencedTaskRunner;
|
class SequencedTaskRunner;
|
||||||
}
|
}
|
||||||
|
@@ -10,17 +10,16 @@
|
|||||||
#include "base/run_loop.h"
|
#include "base/run_loop.h"
|
||||||
#include "base/synchronization/waitable_event.h"
|
#include "base/synchronization/waitable_event.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/storage_monitor/storage_info.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"
|
#include "components/storage_monitor/test_media_transfer_protocol_manager_chromeos.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace storage_monitor {
|
namespace storage_monitor {
|
||||||
|
|
||||||
TestStorageMonitor::TestStorageMonitor() : init_called_(false) {
|
TestStorageMonitor::TestStorageMonitor() : init_called_(false) {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
auto* fake_mtp_manager =
|
auto* fake_mtp_manager =
|
||||||
TestMediaTransferProtocolManagerChromeOS::GetFakeMtpManager();
|
TestMediaTransferProtocolManagerChromeOS::GetFakeMtpManager();
|
||||||
fake_mtp_manager->AddReceiver(
|
fake_mtp_manager->AddReceiver(
|
||||||
@@ -115,7 +114,7 @@ bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
device::mojom::MtpManager*
|
device::mojom::MtpManager*
|
||||||
TestStorageMonitor::media_transfer_protocol_manager() {
|
TestStorageMonitor::media_transfer_protocol_manager() {
|
||||||
return media_transfer_protocol_manager_.get();
|
return media_transfer_protocol_manager_.get();
|
||||||
|
@@ -10,10 +10,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/storage_monitor/storage_monitor.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 "mojo/public/cpp/bindings/remote.h"
|
||||||
#include "services/device/public/mojom/mtp_manager.mojom.h"
|
#include "services/device/public/mojom/mtp_manager.mojom.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -53,7 +52,7 @@ class TestStorageMonitor : public StorageMonitor {
|
|||||||
std::wstring* storage_object_id) const override;
|
std::wstring* storage_object_id) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
device::mojom::MtpManager* media_transfer_protocol_manager() override;
|
device::mojom::MtpManager* media_transfer_protocol_manager() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -79,7 +78,7 @@ class TestStorageMonitor : public StorageMonitor {
|
|||||||
// Paths considered for testing purposes to be on removable storage.
|
// Paths considered for testing purposes to be on removable storage.
|
||||||
std::vector<base::FilePath> removable_paths_;
|
std::vector<base::FilePath> removable_paths_;
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
mojo::Remote<device::mojom::MtpManager> media_transfer_protocol_manager_;
|
mojo::Remote<device::mojom::MtpManager> media_transfer_protocol_manager_;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
#include "base/no_destructor.h"
|
#include "base/no_destructor.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/policy/core/common/policy_pref_names.h"
|
#include "components/policy/core/common/policy_pref_names.h"
|
||||||
#include "components/signin/public/base/consent_level.h"
|
#include "components/signin/public/base/consent_level.h"
|
||||||
#include "components/signin/public/base/signin_switches.h"
|
#include "components/signin/public/base/signin_switches.h"
|
||||||
|
@@ -360,8 +360,6 @@ TEST_F(ListFamilyMembersServiceTest,
|
|||||||
test_list_family_members_service_->Shutdown();
|
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
|
// Data cleanup is only available for Windows, Mac and Linux
|
||||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
||||||
TEST_F(ListFamilyMembersServiceTest, ListFamilyFetcherClearsResponseOnSignout) {
|
TEST_F(ListFamilyMembersServiceTest, ListFamilyFetcherClearsResponseOnSignout) {
|
||||||
@@ -454,7 +452,6 @@ TEST_F(ListFamilyMembersServiceTest, ListFamilyFetcherResetsPrefOnSignout) {
|
|||||||
test_list_family_members_service_->Shutdown();
|
test_list_family_members_service_->Shutdown();
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
||||||
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace supervised_user
|
} // namespace supervised_user
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
#include "base/functional/callback_forward.h"
|
#include "base/functional/callback_forward.h"
|
||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "base/sequence_checker.h"
|
#include "base/sequence_checker.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/safe_search_api/url_checker.h"
|
#include "components/safe_search_api/url_checker.h"
|
||||||
#include "components/signin/public/identity_manager/identity_manager.h"
|
#include "components/signin/public/identity_manager/identity_manager.h"
|
||||||
#include "components/supervised_user/core/browser/supervised_user_error_page.h"
|
#include "components/supervised_user/core/browser/supervised_user_error_page.h"
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
import("//build/config/features.gni")
|
import("//build/config/features.gni")
|
||||||
|
|
||||||
static_library("sync_preferences") {
|
static_library("sync_preferences") {
|
||||||
@@ -27,7 +26,6 @@ static_library("sync_preferences") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/metrics/demographics",
|
"//components/metrics/demographics",
|
||||||
"//components/policy/core/browser",
|
"//components/policy/core/browser",
|
||||||
"//components/pref_registry",
|
"//components/pref_registry",
|
||||||
@@ -35,7 +33,7 @@ static_library("sync_preferences") {
|
|||||||
"//components/sync",
|
"//components/sync",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
deps += [ "//ash/constants" ]
|
deps += [ "//ash/constants" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +102,6 @@ source_set("unit_tests") {
|
|||||||
":sync_preferences",
|
":sync_preferences",
|
||||||
":test_support",
|
":test_support",
|
||||||
"//base/test:test_support",
|
"//base/test:test_support",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/pref_registry",
|
"//components/pref_registry",
|
||||||
"//components/prefs",
|
"//components/prefs",
|
||||||
"//components/prefs:test_support",
|
"//components/prefs:test_support",
|
||||||
@@ -113,7 +110,7 @@ source_set("unit_tests") {
|
|||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
deps += [ "//ash/constants" ]
|
deps += [ "//ash/constants" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -274,7 +274,7 @@ constexpr auto kCommonSyncablePrefsAllowlist =
|
|||||||
PrefSensitivity::kNone, MergeBehavior::kNone}},
|
PrefSensitivity::kNone, MergeBehavior::kNone}},
|
||||||
// For Ash, the OS_PRIORITY_PREFERENCES equivalent is defined in
|
// For Ash, the OS_PRIORITY_PREFERENCES equivalent is defined in
|
||||||
// chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc instead.
|
// chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc instead.
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
{variations::kDogfoodGroupsSyncPrefName,
|
{variations::kDogfoodGroupsSyncPrefName,
|
||||||
{syncable_prefs_ids::kDogfoodGroupsSyncPrefName,
|
{syncable_prefs_ids::kDogfoodGroupsSyncPrefName,
|
||||||
syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/sync/service/sync_service.h"
|
#include "components/sync/service/sync_service.h"
|
||||||
#include "components/sync/service/sync_user_settings.h"
|
#include "components/sync/service/sync_user_settings.h"
|
||||||
#include "components/sync_preferences/pref_model_associator_client.h"
|
#include "components/sync_preferences/pref_model_associator_client.h"
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#include "base/test/mock_callback.h"
|
#include "base/test/mock_callback.h"
|
||||||
#include "base/test/task_environment.h"
|
#include "base/test/task_environment.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/prefs/testing_pref_store.h"
|
#include "components/prefs/testing_pref_store.h"
|
||||||
#include "components/sync/test/test_sync_service.h"
|
#include "components/sync/test/test_sync_service.h"
|
||||||
#include "components/sync_preferences/pref_model_associator_client.h"
|
#include "components/sync_preferences/pref_model_associator_client.h"
|
||||||
@@ -189,7 +188,7 @@ class DualLayerUserPrefStoreTest : public DualLayerUserPrefStoreTestBase {
|
|||||||
// data types appropriately.
|
// data types appropriately.
|
||||||
dual_layer_store_->EnableType(syncer::PREFERENCES);
|
dual_layer_store_->EnableType(syncer::PREFERENCES);
|
||||||
dual_layer_store_->EnableType(syncer::PRIORITY_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_PREFERENCES);
|
||||||
dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES);
|
dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES);
|
||||||
#endif
|
#endif
|
||||||
@@ -1257,7 +1256,7 @@ class DualLayerUserPrefStoreMergeTest : public testing::Test {
|
|||||||
|
|
||||||
dual_layer_store_->EnableType(syncer::PREFERENCES);
|
dual_layer_store_->EnableType(syncer::PREFERENCES);
|
||||||
dual_layer_store_->EnableType(syncer::PRIORITY_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_PREFERENCES);
|
||||||
dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES);
|
dual_layer_store_->EnableType(syncer::OS_PRIORITY_PREFERENCES);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "base/types/expected_macros.h"
|
#include "base/types/expected_macros.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/sync/base/data_type.h"
|
#include "components/sync/base/data_type.h"
|
||||||
#include "components/sync/base/features.h"
|
#include "components/sync/base/features.h"
|
||||||
#include "components/sync/model/sync_change.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();
|
return pref.GetSpecifics().preference();
|
||||||
case syncer::PRIORITY_PREFERENCES:
|
case syncer::PRIORITY_PREFERENCES:
|
||||||
return pref.GetSpecifics().priority_preference().preference();
|
return pref.GetSpecifics().priority_preference().preference();
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
case syncer::OS_PREFERENCES:
|
case syncer::OS_PREFERENCES:
|
||||||
return pref.GetSpecifics().os_preference().preference();
|
return pref.GetSpecifics().os_preference().preference();
|
||||||
case syncer::OS_PRIORITY_PREFERENCES:
|
case syncer::OS_PRIORITY_PREFERENCES:
|
||||||
@@ -77,7 +76,7 @@ PrefModelAssociator::PrefModelAssociator(
|
|||||||
user_prefs_(user_prefs),
|
user_prefs_(user_prefs),
|
||||||
dual_layer_user_prefs_(nullptr) {
|
dual_layer_user_prefs_(nullptr) {
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
DCHECK(type_ == syncer::PREFERENCES ||
|
DCHECK(type_ == syncer::PREFERENCES ||
|
||||||
type_ == syncer::PRIORITY_PREFERENCES ||
|
type_ == syncer::PRIORITY_PREFERENCES ||
|
||||||
type_ == syncer::OS_PREFERENCES ||
|
type_ == syncer::OS_PREFERENCES ||
|
||||||
@@ -119,7 +118,7 @@ sync_pb::PreferenceSpecifics* PrefModelAssociator::GetMutableSpecifics(
|
|||||||
return specifics->mutable_preference();
|
return specifics->mutable_preference();
|
||||||
case syncer::PRIORITY_PREFERENCES:
|
case syncer::PRIORITY_PREFERENCES:
|
||||||
return specifics->mutable_priority_preference()->mutable_preference();
|
return specifics->mutable_priority_preference()->mutable_preference();
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
case syncer::OS_PREFERENCES:
|
case syncer::OS_PREFERENCES:
|
||||||
return specifics->mutable_os_preference()->mutable_preference();
|
return specifics->mutable_os_preference()->mutable_preference();
|
||||||
case syncer::OS_PRIORITY_PREFERENCES:
|
case syncer::OS_PRIORITY_PREFERENCES:
|
||||||
|
@@ -44,10 +44,10 @@ const char kDictionaryPrefName[] = "pref.dictionary";
|
|||||||
const char kCustomMergePrefName[] = "pref.custom";
|
const char kCustomMergePrefName[] = "pref.custom";
|
||||||
|
|
||||||
const char kStringPriorityPrefName[] = "priority.pref.string";
|
const char kStringPriorityPrefName[] = "priority.pref.string";
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
const char kStringOsPrefName[] = "os.pref.string";
|
const char kStringOsPrefName[] = "os.pref.string";
|
||||||
const char kStringOsPriorityPrefName[] = "os.priority.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.
|
// Assigning an id of 0 to all the test prefs.
|
||||||
const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = {
|
const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = {
|
||||||
@@ -64,13 +64,13 @@ const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = {
|
|||||||
{kStringPriorityPrefName,
|
{kStringPriorityPrefName,
|
||||||
{0, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
{0, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
||||||
MergeBehavior::kNone}},
|
MergeBehavior::kNone}},
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
{kStringOsPrefName,
|
{kStringOsPrefName,
|
||||||
{0, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}},
|
{0, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}},
|
||||||
{kStringOsPriorityPrefName,
|
{kStringOsPriorityPrefName,
|
||||||
{0, syncer::OS_PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
{0, syncer::OS_PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
||||||
MergeBehavior::kNone}},
|
MergeBehavior::kNone}},
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Creates SyncData for a remote pref change.
|
// Creates SyncData for a remote pref change.
|
||||||
@@ -597,7 +597,7 @@ TEST_F(SyncablePrefsDatabaseTest, ShouldAllowRegisteringSyncablePriorityPrefs) {
|
|||||||
NotNull());
|
NotNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
TEST_F(SyncablePrefsDatabaseTest, ShouldAllowRegisteringSyncableOSPrefs) {
|
TEST_F(SyncablePrefsDatabaseTest, ShouldAllowRegisteringSyncableOSPrefs) {
|
||||||
pref_registry_->RegisterStringPref(
|
pref_registry_->RegisterStringPref(
|
||||||
kStringOsPrefName, std::string(),
|
kStringOsPrefName, std::string(),
|
||||||
@@ -660,7 +660,7 @@ TEST_F(SyncablePrefsDatabaseDeathTest,
|
|||||||
kExpectedErrorMessageHint);
|
kExpectedErrorMessageHint);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
TEST_F(SyncablePrefsDatabaseDeathTest, ShouldFailRegisteringIllegalOSPrefs) {
|
TEST_F(SyncablePrefsDatabaseDeathTest, ShouldFailRegisteringIllegalOSPrefs) {
|
||||||
const std::string kIllegalStringPrefName = "not-allowed_string_pref";
|
const std::string kIllegalStringPrefName = "not-allowed_string_pref";
|
||||||
const std::string kIllegalListPrefName = "not-allowed_list_pref";
|
const std::string kIllegalListPrefName = "not-allowed_list_pref";
|
||||||
@@ -721,7 +721,7 @@ TEST_F(SyncablePrefsDatabaseDeathTest,
|
|||||||
kStringPriorityPrefName, std::string(),
|
kStringPriorityPrefName, std::string(),
|
||||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF),
|
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF),
|
||||||
kExpectedErrorMessageHint);
|
kExpectedErrorMessageHint);
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
EXPECT_DCHECK_DEATH_WITH(
|
EXPECT_DCHECK_DEATH_WITH(
|
||||||
pref_registry_->RegisterStringPref(
|
pref_registry_->RegisterStringPref(
|
||||||
kStringOsPrefName, std::string(),
|
kStringOsPrefName, std::string(),
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#include "base/functional/callback_helpers.h"
|
#include "base/functional/callback_helpers.h"
|
||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "base/scoped_observation.h"
|
#include "base/scoped_observation.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/metrics/demographics/user_demographics.h"
|
#include "components/metrics/demographics/user_demographics.h"
|
||||||
#include "components/pref_registry/pref_registry_syncable.h"
|
#include "components/pref_registry/pref_registry_syncable.h"
|
||||||
#include "components/prefs/in_memory_pref_store.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/pref_service_syncable_observer.h"
|
||||||
#include "components/sync_preferences/synced_pref_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"
|
#include "ash/constants/ash_features.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ PrefServiceSyncable::PrefServiceSyncable(
|
|||||||
priority_pref_sync_associator_(pref_model_associator_client,
|
priority_pref_sync_associator_(pref_model_associator_client,
|
||||||
user_prefs,
|
user_prefs,
|
||||||
syncer::PRIORITY_PREFERENCES),
|
syncer::PRIORITY_PREFERENCES),
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
os_pref_sync_associator_(pref_model_associator_client,
|
os_pref_sync_associator_(pref_model_associator_client,
|
||||||
user_prefs,
|
user_prefs,
|
||||||
syncer::OS_PREFERENCES),
|
syncer::OS_PREFERENCES),
|
||||||
@@ -127,7 +126,7 @@ PrefServiceSyncable::PrefServiceSyncable(
|
|||||||
priority_pref_sync_associator_(pref_model_associator_client,
|
priority_pref_sync_associator_(pref_model_associator_client,
|
||||||
dual_layer_user_prefs,
|
dual_layer_user_prefs,
|
||||||
syncer::PRIORITY_PREFERENCES),
|
syncer::PRIORITY_PREFERENCES),
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
os_pref_sync_associator_(pref_model_associator_client,
|
os_pref_sync_associator_(pref_model_associator_client,
|
||||||
dual_layer_user_prefs,
|
dual_layer_user_prefs,
|
||||||
syncer::OS_PREFERENCES),
|
syncer::OS_PREFERENCES),
|
||||||
@@ -145,7 +144,7 @@ PrefServiceSyncable::PrefServiceSyncable(
|
|||||||
void PrefServiceSyncable::ConnectAssociatorsAndRegisterPreferences() {
|
void PrefServiceSyncable::ConnectAssociatorsAndRegisterPreferences() {
|
||||||
pref_sync_associator_.SetPrefService(this);
|
pref_sync_associator_.SetPrefService(this);
|
||||||
priority_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_pref_sync_associator_.SetPrefService(this);
|
||||||
os_priority_pref_sync_associator_.SetPrefService(this);
|
os_priority_pref_sync_associator_.SetPrefService(this);
|
||||||
#endif
|
#endif
|
||||||
@@ -213,7 +212,7 @@ bool PrefServiceSyncable::IsPrioritySyncing() {
|
|||||||
return priority_pref_sync_associator_.models_associated();
|
return priority_pref_sync_associator_.models_associated();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
bool PrefServiceSyncable::AreOsPrefsSyncing() {
|
bool PrefServiceSyncable::AreOsPrefsSyncing() {
|
||||||
return os_pref_sync_associator_.models_associated();
|
return os_pref_sync_associator_.models_associated();
|
||||||
}
|
}
|
||||||
@@ -221,7 +220,7 @@ bool PrefServiceSyncable::AreOsPrefsSyncing() {
|
|||||||
bool PrefServiceSyncable::AreOsPriorityPrefsSyncing() {
|
bool PrefServiceSyncable::AreOsPriorityPrefsSyncing() {
|
||||||
return os_priority_pref_sync_associator_.models_associated();
|
return os_priority_pref_sync_associator_.models_associated();
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
void PrefServiceSyncable::AddObserver(PrefServiceSyncableObserver* observer) {
|
void PrefServiceSyncable::AddObserver(PrefServiceSyncableObserver* observer) {
|
||||||
observer_list_.AddObserver(observer);
|
observer_list_.AddObserver(observer);
|
||||||
@@ -239,7 +238,7 @@ syncer::SyncableService* PrefServiceSyncable::GetSyncableService(
|
|||||||
return &pref_sync_associator_;
|
return &pref_sync_associator_;
|
||||||
case syncer::PRIORITY_PREFERENCES:
|
case syncer::PRIORITY_PREFERENCES:
|
||||||
return &priority_pref_sync_associator_;
|
return &priority_pref_sync_associator_;
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
case syncer::OS_PREFERENCES:
|
case syncer::OS_PREFERENCES:
|
||||||
return &os_pref_sync_associator_;
|
return &os_pref_sync_associator_;
|
||||||
case syncer::OS_PRIORITY_PREFERENCES:
|
case syncer::OS_PRIORITY_PREFERENCES:
|
||||||
@@ -262,7 +261,7 @@ void PrefServiceSyncable::AddSyncedPrefObserver(const std::string& name,
|
|||||||
SyncedPrefObserver* observer) {
|
SyncedPrefObserver* observer) {
|
||||||
pref_sync_associator_.AddSyncedPrefObserver(name, observer);
|
pref_sync_associator_.AddSyncedPrefObserver(name, observer);
|
||||||
priority_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_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
|
||||||
os_priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
|
os_priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
|
||||||
#endif
|
#endif
|
||||||
@@ -273,7 +272,7 @@ void PrefServiceSyncable::RemoveSyncedPrefObserver(
|
|||||||
SyncedPrefObserver* observer) {
|
SyncedPrefObserver* observer) {
|
||||||
pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
|
pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
|
||||||
priority_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_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
|
||||||
os_priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
|
os_priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
|
||||||
#endif
|
#endif
|
||||||
@@ -290,7 +289,7 @@ void PrefServiceSyncable::AddRegisteredSyncablePreference(std::string_view path,
|
|||||||
priority_pref_sync_associator_.RegisterPref(path);
|
priority_pref_sync_associator_.RegisterPref(path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF) {
|
if (flags & user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF) {
|
||||||
os_pref_sync_associator_.RegisterPref(path);
|
os_pref_sync_associator_.RegisterPref(path);
|
||||||
return;
|
return;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "base/functional/callback_forward.h"
|
#include "base/functional/callback_forward.h"
|
||||||
#include "base/functional/callback_helpers.h"
|
#include "base/functional/callback_helpers.h"
|
||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/pref_registry/pref_registry_syncable.h"
|
#include "components/pref_registry/pref_registry_syncable.h"
|
||||||
#include "components/prefs/pref_service.h"
|
#include "components/prefs/pref_service.h"
|
||||||
#include "components/sync_preferences/pref_model_associator.h"
|
#include "components/sync_preferences/pref_model_associator.h"
|
||||||
@@ -95,7 +94,7 @@ class PrefServiceSyncable : public PrefService,
|
|||||||
// priority preferences.
|
// priority preferences.
|
||||||
bool IsPrioritySyncing();
|
bool IsPrioritySyncing();
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// As above, but for OS preferences.
|
// As above, but for OS preferences.
|
||||||
bool AreOsPrefsSyncing();
|
bool AreOsPrefsSyncing();
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ class PrefServiceSyncable : public PrefService,
|
|||||||
PrefModelAssociator pref_sync_associator_;
|
PrefModelAssociator pref_sync_associator_;
|
||||||
PrefModelAssociator priority_pref_sync_associator_;
|
PrefModelAssociator priority_pref_sync_associator_;
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// Associators for Chrome OS system preferences.
|
// Associators for Chrome OS system preferences.
|
||||||
PrefModelAssociator os_pref_sync_associator_;
|
PrefModelAssociator os_pref_sync_associator_;
|
||||||
PrefModelAssociator os_priority_pref_sync_associator_;
|
PrefModelAssociator os_priority_pref_sync_associator_;
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
#include "base/test/metrics/histogram_tester.h"
|
#include "base/test/metrics/histogram_tester.h"
|
||||||
#include "base/test/scoped_feature_list.h"
|
#include "base/test/scoped_feature_list.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/pref_registry/pref_registry_syncable.h"
|
#include "components/pref_registry/pref_registry_syncable.h"
|
||||||
#include "components/prefs/pref_notifier_impl.h"
|
#include "components/prefs/pref_notifier_impl.h"
|
||||||
#include "components/prefs/scoped_user_pref_update.h"
|
#include "components/prefs/scoped_user_pref_update.h"
|
||||||
@@ -41,7 +40,7 @@
|
|||||||
#include "testing/gmock/include/gmock/gmock.h"
|
#include "testing/gmock/include/gmock/gmock.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.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"
|
#include "testing/gmock/include/gmock/gmock-matchers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ const char kNonDefaultCharsetValue[] = "foo";
|
|||||||
const char kDefaultCharsetValue[] = "utf-8";
|
const char kDefaultCharsetValue[] = "utf-8";
|
||||||
const char kBrowserPrefName[] = "browser_pref";
|
const char kBrowserPrefName[] = "browser_pref";
|
||||||
const char kBrowserPriorityPrefName[] = "browser_priority_pref";
|
const char kBrowserPriorityPrefName[] = "browser_priority_pref";
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
const char kOsPrefName[] = "os_pref";
|
const char kOsPrefName[] = "os_pref";
|
||||||
const char kOsPriorityPrefName[] = "os_priority_pref";
|
const char kOsPriorityPrefName[] = "os_priority_pref";
|
||||||
#endif
|
#endif
|
||||||
@@ -101,7 +100,7 @@ const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = {
|
|||||||
{kBrowserPriorityPrefName,
|
{kBrowserPriorityPrefName,
|
||||||
{8, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
{8, syncer::PRIORITY_PREFERENCES, PrefSensitivity::kNone,
|
||||||
MergeBehavior::kNone}},
|
MergeBehavior::kNone}},
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
{kOsPrefName,
|
{kOsPrefName,
|
||||||
{9, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}},
|
{9, syncer::OS_PREFERENCES, PrefSensitivity::kNone, MergeBehavior::kNone}},
|
||||||
{kOsPriorityPrefName,
|
{kOsPriorityPrefName,
|
||||||
@@ -129,7 +128,7 @@ std::optional<base::Value> FindValue(
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
constexpr DataTypeSet kAllPreferenceDataTypes = {
|
constexpr DataTypeSet kAllPreferenceDataTypes = {
|
||||||
syncer::PREFERENCES, syncer::PRIORITY_PREFERENCES, syncer::OS_PREFERENCES,
|
syncer::PREFERENCES, syncer::PRIORITY_PREFERENCES, syncer::OS_PREFERENCES,
|
||||||
syncer::OS_PRIORITY_PREFERENCES};
|
syncer::OS_PRIORITY_PREFERENCES};
|
||||||
@@ -138,7 +137,7 @@ MATCHER_P(MatchesDataType, data_type, "") {
|
|||||||
const syncer::SyncChange& sync_change = arg;
|
const syncer::SyncChange& sync_change = arg;
|
||||||
return Matches(data_type)(sync_change.sync_data().GetDataType());
|
return Matches(data_type)(sync_change.sync_data().GetDataType());
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
class TestSyncProcessorStub : public syncer::SyncChangeProcessor {
|
class TestSyncProcessorStub : public syncer::SyncChangeProcessor {
|
||||||
public:
|
public:
|
||||||
@@ -991,7 +990,7 @@ TEST_F(PrefServiceSyncableTest, DeletePreference) {
|
|||||||
EXPECT_TRUE(pref->IsDefaultValue());
|
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
|
// The Chrome OS tests exercise pref model association that happens in the
|
||||||
// constructor of PrefServiceSyncable. The tests must register prefs first,
|
// constructor of PrefServiceSyncable. The tests must register prefs first,
|
||||||
// then create the PrefServiceSyncable object. The tests live in this file
|
// 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 {
|
class PrefServiceSyncableFactoryTest : public PrefServiceSyncableTest {
|
||||||
public:
|
public:
|
||||||
@@ -1421,7 +1420,7 @@ TEST_F(PrefServiceSyncableFactoryTest,
|
|||||||
static_cast<PrefModelAssociator*>(
|
static_cast<PrefModelAssociator*>(
|
||||||
pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES))
|
pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES))
|
||||||
->IsUsingDualLayerUserPrefStoreForTesting());
|
->IsUsingDualLayerUserPrefStoreForTesting());
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
EXPECT_FALSE(static_cast<PrefModelAssociator*>(
|
EXPECT_FALSE(static_cast<PrefModelAssociator*>(
|
||||||
pref_service->GetSyncableService(syncer::OS_PREFERENCES))
|
pref_service->GetSyncableService(syncer::OS_PREFERENCES))
|
||||||
->IsUsingDualLayerUserPrefStoreForTesting());
|
->IsUsingDualLayerUserPrefStoreForTesting());
|
||||||
@@ -1445,7 +1444,7 @@ TEST_F(PrefServiceSyncableFactoryTest,
|
|||||||
static_cast<PrefModelAssociator*>(
|
static_cast<PrefModelAssociator*>(
|
||||||
pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES))
|
pref_service->GetSyncableService(syncer::PRIORITY_PREFERENCES))
|
||||||
->IsUsingDualLayerUserPrefStoreForTesting());
|
->IsUsingDualLayerUserPrefStoreForTesting());
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
EXPECT_TRUE(static_cast<PrefModelAssociator*>(
|
EXPECT_TRUE(static_cast<PrefModelAssociator*>(
|
||||||
pref_service->GetSyncableService(syncer::OS_PREFERENCES))
|
pref_service->GetSyncableService(syncer::OS_PREFERENCES))
|
||||||
->IsUsingDualLayerUserPrefStoreForTesting());
|
->IsUsingDualLayerUserPrefStoreForTesting());
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
|
|
||||||
namespace sync_preferences {
|
namespace sync_preferences {
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "base/check.h"
|
#include "base/check.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/sync/base/data_type.h"
|
#include "components/sync/base/data_type.h"
|
||||||
|
|
||||||
namespace sync_preferences {
|
namespace sync_preferences {
|
||||||
@@ -56,10 +55,10 @@ class SyncablePrefMetadata {
|
|||||||
merge_behaviour_(merge_behavior) {
|
merge_behaviour_(merge_behavior) {
|
||||||
CHECK(data_type_ == syncer::PREFERENCES ||
|
CHECK(data_type_ == syncer::PREFERENCES ||
|
||||||
data_type_ == syncer::PRIORITY_PREFERENCES
|
data_type_ == syncer::PRIORITY_PREFERENCES
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
|| data_type_ == syncer::OS_PREFERENCES ||
|
|| data_type_ == syncer::OS_PREFERENCES ||
|
||||||
data_type_ == syncer::OS_PRIORITY_PREFERENCES
|
data_type_ == syncer::OS_PRIORITY_PREFERENCES
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
)
|
)
|
||||||
<< "Invalid type " << data_type_
|
<< "Invalid type " << data_type_
|
||||||
<< " for syncable pref with id=" << syncable_pref_id_;
|
<< " for syncable pref with id=" << syncable_pref_id_;
|
||||||
|
@@ -2,11 +2,10 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
import("//build/config/features.gni")
|
import("//build/config/features.gni")
|
||||||
|
|
||||||
declare_args() {
|
declare_args() {
|
||||||
# Enables Chromium implementation of the MPRIS D-Bus interface for controlling
|
# Enables Chromium implementation of the MPRIS D-Bus interface for controlling
|
||||||
# media playback. See ../README.md for details.
|
# media playback. See ../README.md for details.
|
||||||
use_mpris = (is_linux || is_chromeos_lacros) && use_dbus
|
use_mpris = is_linux && use_dbus
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,6 @@ static_library("browser") {
|
|||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//base:i18n",
|
"//base:i18n",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/assist_ranker",
|
"//components/assist_ranker",
|
||||||
"//components/assist_ranker/proto",
|
"//components/assist_ranker/proto",
|
||||||
"//components/keyed_service/core",
|
"//components/keyed_service/core",
|
||||||
@@ -111,7 +110,6 @@ source_set("unit_tests") {
|
|||||||
":browser",
|
":browser",
|
||||||
":test_support",
|
":test_support",
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/assist_ranker",
|
"//components/assist_ranker",
|
||||||
"//components/assist_ranker/proto",
|
"//components/assist_ranker/proto",
|
||||||
"//components/infobars/core",
|
"//components/infobars/core",
|
||||||
@@ -154,7 +152,6 @@ source_set("test_support") {
|
|||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/infobars/core",
|
"//components/infobars/core",
|
||||||
"//components/language/core/browser",
|
"//components/language/core/browser",
|
||||||
"//components/sync_preferences",
|
"//components/sync_preferences",
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/translate/core/browser/mock_translate_client.h"
|
#include "components/translate/core/browser/mock_translate_client.h"
|
||||||
#include "components/translate/core/browser/translate_prefs.h"
|
#include "components/translate/core/browser/translate_prefs.h"
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@ namespace translate {
|
|||||||
|
|
||||||
namespace testing {
|
namespace testing {
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
const char* preferred_languages_prefs = "settings.language.preferred_languages";
|
const char* preferred_languages_prefs = "settings.language.preferred_languages";
|
||||||
#else
|
#else
|
||||||
const char* preferred_languages_prefs = nullptr;
|
const char* preferred_languages_prefs = nullptr;
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/test/task_environment.h"
|
#include "base/test/task_environment.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/infobars/core/infobar.h"
|
#include "components/infobars/core/infobar.h"
|
||||||
#include "components/infobars/core/infobar_manager.h"
|
#include "components/infobars/core/infobar_manager.h"
|
||||||
#include "components/language/core/browser/accept_languages_service.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());
|
language::LanguagePrefs::RegisterProfilePrefs(pref_service_->registry());
|
||||||
pref_service_->SetString(testing::accept_languages_prefs, std::string());
|
pref_service_->SetString(testing::accept_languages_prefs, std::string());
|
||||||
pref_service_->SetString(language::prefs::kAcceptLanguages, 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,
|
pref_service_->SetString(language::prefs::kPreferredLanguages,
|
||||||
std::string());
|
std::string());
|
||||||
#endif
|
#endif
|
||||||
@@ -290,7 +289,7 @@ TEST_F(TranslateInfoBarDelegateTest, IsTranslatableLanguage) {
|
|||||||
base::Value::List& update_list = update.Get();
|
base::Value::List& update_list = update.Get();
|
||||||
update_list.Append(kSourceLanguage);
|
update_list.Append(kSourceLanguage);
|
||||||
pref_service_->SetString(language::prefs::kAcceptLanguages, kSourceLanguage);
|
pref_service_->SetString(language::prefs::kAcceptLanguages, kSourceLanguage);
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
pref_service_->SetString(language::prefs::kPreferredLanguages,
|
pref_service_->SetString(language::prefs::kPreferredLanguages,
|
||||||
kSourceLanguage);
|
kSourceLanguage);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "base/test/scoped_feature_list.h"
|
#include "base/test/scoped_feature_list.h"
|
||||||
#include "base/test/task_environment.h"
|
#include "base/test/task_environment.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/infobars/core/infobar.h"
|
#include "components/infobars/core/infobar.h"
|
||||||
#include "components/language/core/browser/accept_languages_service.h"
|
#include "components/language/core/browser/accept_languages_service.h"
|
||||||
#include "components/language/core/browser/language_model.h"
|
#include "components/language/core/browser/language_model.h"
|
||||||
@@ -125,7 +124,7 @@ struct ProfilePrefRegistration {
|
|||||||
sync_preferences::TestingPrefServiceSyncable* prefs) {
|
sync_preferences::TestingPrefServiceSyncable* prefs) {
|
||||||
language::LanguagePrefs::RegisterProfilePrefs(prefs->registry());
|
language::LanguagePrefs::RegisterProfilePrefs(prefs->registry());
|
||||||
prefs->SetString(accept_languages_prefs, std::string());
|
prefs->SetString(accept_languages_prefs, std::string());
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
prefs->SetString(preferred_languages_prefs, std::string());
|
prefs->SetString(preferred_languages_prefs, std::string());
|
||||||
#endif
|
#endif
|
||||||
TranslatePrefs::RegisterProfilePrefs(prefs->registry());
|
TranslatePrefs::RegisterProfilePrefs(prefs->registry());
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/build_config.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/accept_languages_service.h"
|
||||||
#include "components/language/core/browser/language_prefs.h"
|
#include "components/language/core/browser/language_prefs.h"
|
||||||
#include "components/language/core/browser/pref_names.h"
|
#include "components/language/core/browser/pref_names.h"
|
||||||
@@ -213,7 +212,7 @@ void TranslatePrefs::ResetToDefaults() {
|
|||||||
// static
|
// static
|
||||||
base::Value::List TranslatePrefs::GetDefaultBlockedLanguages() {
|
base::Value::List TranslatePrefs::GetDefaultBlockedLanguages() {
|
||||||
base::Value::List languages;
|
base::Value::List languages;
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// Preferred languages.
|
// Preferred languages.
|
||||||
std::string language = language::kFallbackInputMethodLocale;
|
std::string language = language::kFallbackInputMethodLocale;
|
||||||
language::ToTranslateLanguageSynonym(&language);
|
language::ToTranslateLanguageSynonym(&language);
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/build_config.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.h"
|
||||||
#include "components/language/core/browser/language_prefs_test_util.h"
|
#include "components/language/core/browser/language_prefs_test_util.h"
|
||||||
#include "components/language/core/browser/pref_names.h"
|
#include "components/language/core/browser/pref_names.h"
|
||||||
@@ -71,7 +70,7 @@ class TranslatePrefsTest : public testing::Test {
|
|||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
prefs_.SetString(language::prefs::kAcceptLanguages, std::string());
|
prefs_.SetString(language::prefs::kAcceptLanguages, std::string());
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
prefs_.SetString(language::prefs::kPreferredLanguages, std::string());
|
prefs_.SetString(language::prefs::kPreferredLanguages, std::string());
|
||||||
#endif
|
#endif
|
||||||
prefs_.registry()->RegisterBooleanPref(
|
prefs_.registry()->RegisterBooleanPref(
|
||||||
@@ -591,7 +590,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageUp) {
|
|||||||
{"it", "es"});
|
{"it", "es"});
|
||||||
accept_languages_tester_->ExpectAcceptLanguagePrefs("it,en,fr,es");
|
accept_languages_tester_->ExpectAcceptLanguagePrefs("it,en,fr,es");
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Move with policy-forced languages present.
|
// Move with policy-forced languages present.
|
||||||
// Forced languages should always remain at the top of the languages list and
|
// 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"});
|
{"en", "fr", "it", "es", "zh"});
|
||||||
accept_languages_tester_->ExpectAcceptLanguagePrefs("es,en,fr,it,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.
|
// Move with policy-forced languages present.
|
||||||
// Only test on non-Chrome OS platforms.
|
// Only test on non-Chrome OS platforms.
|
||||||
@@ -810,7 +809,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageDown) {
|
|||||||
{"fr", "it"});
|
{"fr", "it"});
|
||||||
accept_languages_tester_->ExpectAcceptLanguagePrefs("en,fr,es,it");
|
accept_languages_tester_->ExpectAcceptLanguagePrefs("en,fr,es,it");
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Move with policy-forced languages present.
|
// Move with policy-forced languages present.
|
||||||
// Only test on non-Chrome OS platforms.
|
// Only test on non-Chrome OS platforms.
|
||||||
|
@@ -51,7 +51,7 @@ TranslateUIDelegate::TranslateUIDelegate(
|
|||||||
language::kContentLanguagesInLanguagePicker,
|
language::kContentLanguagesInLanguagePicker,
|
||||||
language::kContentLanguagesDisableObserversParam,
|
language::kContentLanguagesDisableObserversParam,
|
||||||
false /* default */)) {
|
false /* default */)) {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
const std::string& pref_name = language::prefs::kPreferredLanguages;
|
const std::string& pref_name = language::prefs::kPreferredLanguages;
|
||||||
#else
|
#else
|
||||||
const std::string& pref_name = language::prefs::kAcceptLanguages;
|
const std::string& pref_name = language::prefs::kAcceptLanguages;
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/test/scoped_feature_list.h"
|
#include "base/test/scoped_feature_list.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/infobars/core/infobar.h"
|
#include "components/infobars/core/infobar.h"
|
||||||
#include "components/language/core/browser/language_model.h"
|
#include "components/language/core/browser/language_model.h"
|
||||||
#include "components/language/core/browser/language_prefs.h"
|
#include "components/language/core/browser/language_prefs.h"
|
||||||
@@ -60,7 +59,7 @@ class TranslateUIDelegateTest : public ::testing::Test {
|
|||||||
std::make_unique<sync_preferences::TestingPrefServiceSyncable>();
|
std::make_unique<sync_preferences::TestingPrefServiceSyncable>();
|
||||||
language::LanguagePrefs::RegisterProfilePrefs(pref_service_->registry());
|
language::LanguagePrefs::RegisterProfilePrefs(pref_service_->registry());
|
||||||
pref_service_->SetString(language::prefs::kAcceptLanguages, 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,
|
pref_service_->SetString(language::prefs::kPreferredLanguages,
|
||||||
std::string());
|
std::string());
|
||||||
#endif
|
#endif
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/language/core/common/language_experiments.h"
|
#include "components/language/core/common/language_experiments.h"
|
||||||
#include "components/strings/grit/components_strings.h"
|
#include "components/strings/grit/components_strings.h"
|
||||||
#include "components/translate/core/browser/language_state.h"
|
#include "components/translate/core/browser/language_state.h"
|
||||||
|
@@ -146,20 +146,4 @@ static_library("test_support") {
|
|||||||
"//url",
|
"//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" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -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
|
|
@@ -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_
|
|
@@ -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
|
|
@@ -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_
|
|
@@ -40,7 +40,6 @@ source_set("unit_tests") {
|
|||||||
deps = [
|
deps = [
|
||||||
":unified_consent",
|
":unified_consent",
|
||||||
"//base/test:test_support",
|
"//base/test:test_support",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/signin/public/identity_manager:test_support",
|
"//components/signin/public/identity_manager:test_support",
|
||||||
"//components/sync:test_support",
|
"//components/sync:test_support",
|
||||||
"//components/sync_preferences:test_support",
|
"//components/sync_preferences:test_support",
|
||||||
|
@@ -7,9 +7,9 @@
|
|||||||
namespace unified_consent {
|
namespace unified_consent {
|
||||||
namespace prefs {
|
namespace prefs {
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
const char kUnifiedConsentMigrationState[] = "unified_consent.migration_state";
|
const char kUnifiedConsentMigrationState[] = "unified_consent.migration_state";
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
const char kUrlKeyedAnonymizedDataCollectionEnabled[] =
|
const char kUrlKeyedAnonymizedDataCollectionEnabled[] =
|
||||||
"url_keyed_anonymized_data_collection.enabled";
|
"url_keyed_anonymized_data_collection.enabled";
|
||||||
|
|
||||||
|
@@ -6,11 +6,10 @@
|
|||||||
#define COMPONENTS_UNIFIED_CONSENT_PREF_NAMES_H_
|
#define COMPONENTS_UNIFIED_CONSENT_PREF_NAMES_H_
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
|
|
||||||
namespace unified_consent::prefs {
|
namespace unified_consent::prefs {
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// Integer indicating the migration state of unified consent, defined in
|
// Integer indicating the migration state of unified consent, defined in
|
||||||
// unified_consent::MigrationState.
|
// unified_consent::MigrationState.
|
||||||
//
|
//
|
||||||
|
@@ -164,7 +164,7 @@ UnifiedConsentService::UnifiedConsentService(
|
|||||||
DCHECK(identity_manager_);
|
DCHECK(identity_manager_);
|
||||||
DCHECK(sync_service_);
|
DCHECK(sync_service_);
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
if (GetMigrationState() == MigrationState::kNotInitialized)
|
if (GetMigrationState() == MigrationState::kNotInitialized)
|
||||||
MigrateProfileToUnifiedConsent();
|
MigrateProfileToUnifiedConsent();
|
||||||
#endif
|
#endif
|
||||||
@@ -186,7 +186,7 @@ void UnifiedConsentService::RegisterPrefs(
|
|||||||
user_prefs::PrefRegistrySyncable* registry) {
|
user_prefs::PrefRegistrySyncable* registry) {
|
||||||
registry->RegisterBooleanPref(prefs::kUrlKeyedAnonymizedDataCollectionEnabled,
|
registry->RegisterBooleanPref(prefs::kUrlKeyedAnonymizedDataCollectionEnabled,
|
||||||
false);
|
false);
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
registry->RegisterIntegerPref(
|
registry->RegisterIntegerPref(
|
||||||
prefs::kUnifiedConsentMigrationState,
|
prefs::kUnifiedConsentMigrationState,
|
||||||
static_cast<int>(MigrationState::kNotInitialized));
|
static_cast<int>(MigrationState::kNotInitialized));
|
||||||
@@ -195,7 +195,7 @@ void UnifiedConsentService::RegisterPrefs(
|
|||||||
|
|
||||||
void UnifiedConsentService::SetUrlKeyedAnonymizedDataCollectionEnabled(
|
void UnifiedConsentService::SetUrlKeyedAnonymizedDataCollectionEnabled(
|
||||||
bool enabled) {
|
bool enabled) {
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
if (GetMigrationState() != MigrationState::kCompleted)
|
if (GetMigrationState() != MigrationState::kCompleted)
|
||||||
SetMigrationState(MigrationState::kCompleted);
|
SetMigrationState(MigrationState::kCompleted);
|
||||||
#endif
|
#endif
|
||||||
@@ -267,7 +267,7 @@ void UnifiedConsentService::OnStateChanged(syncer::SyncService* sync) {
|
|||||||
service_pref_changes_.clear();
|
service_pref_changes_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// TODO(crbug.com/40066949): Simplify (remove the following block) after
|
// TODO(crbug.com/40066949): Simplify (remove the following block) after
|
||||||
// Sync-the-feature users are migrated to ConsentLevel::kSignin (and thus
|
// Sync-the-feature users are migrated to ConsentLevel::kSignin (and thus
|
||||||
// CanSyncFeatureStart() always returns false).
|
// CanSyncFeatureStart() always returns false).
|
||||||
@@ -317,7 +317,7 @@ void UnifiedConsentService::ServicePrefChanged(const std::string& name) {
|
|||||||
service_pref_changes_[name] = value.Clone();
|
service_pref_changes_[name] = value.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
MigrationState UnifiedConsentService::GetMigrationState() {
|
MigrationState UnifiedConsentService::GetMigrationState() {
|
||||||
int migration_state_int =
|
int migration_state_int =
|
||||||
pref_service_->GetInteger(prefs::kUnifiedConsentMigrationState);
|
pref_service_->GetInteger(prefs::kUnifiedConsentMigrationState);
|
||||||
@@ -365,6 +365,6 @@ void UnifiedConsentService::UpdateSettingsForMigration() {
|
|||||||
!sync_service_->GetUserSettings()->IsUsingExplicitPassphrase();
|
!sync_service_->GetUserSettings()->IsUsingExplicitPassphrase();
|
||||||
SetUrlKeyedAnonymizedDataCollectionEnabled(url_keyed_metrics_enabled);
|
SetUrlKeyedAnonymizedDataCollectionEnabled(url_keyed_metrics_enabled);
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
} // namespace unified_consent
|
} // namespace unified_consent
|
||||||
|
@@ -32,14 +32,14 @@ class SyncService;
|
|||||||
|
|
||||||
namespace unified_consent {
|
namespace unified_consent {
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
enum class MigrationState : int {
|
enum class MigrationState : int {
|
||||||
kNotInitialized = 0,
|
kNotInitialized = 0,
|
||||||
kInProgressWaitForSyncInit = 1,
|
kInProgressWaitForSyncInit = 1,
|
||||||
// Reserve space for other kInProgress* entries to be added here.
|
// Reserve space for other kInProgress* entries to be added here.
|
||||||
kCompleted = 10,
|
kCompleted = 10,
|
||||||
};
|
};
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
// A browser-context keyed service that is used to manage the user consent
|
// A browser-context keyed service that is used to manage the user consent
|
||||||
// when UnifiedConsent feature is enabled.
|
// when UnifiedConsent feature is enabled.
|
||||||
@@ -127,7 +127,7 @@ class UnifiedConsentService
|
|||||||
void StopObservingServicePrefChanges();
|
void StopObservingServicePrefChanges();
|
||||||
void ServicePrefChanged(const std::string& name);
|
void ServicePrefChanged(const std::string& name);
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS)
|
||||||
// Migration helpers.
|
// Migration helpers.
|
||||||
MigrationState GetMigrationState();
|
MigrationState GetMigrationState();
|
||||||
void SetMigrationState(MigrationState migration_state);
|
void SetMigrationState(MigrationState migration_state);
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
#include "base/test/scoped_feature_list.h"
|
#include "base/test/scoped_feature_list.h"
|
||||||
#include "base/test/task_environment.h"
|
#include "base/test/task_environment.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/signin/public/identity_manager/identity_test_environment.h"
|
#include "components/signin/public/identity_manager/identity_test_environment.h"
|
||||||
#include "components/sync/base/features.h"
|
#include "components/sync/base/features.h"
|
||||||
#include "components/sync/base/user_selectable_type.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() {
|
unified_consent::MigrationState GetMigrationState() {
|
||||||
int migration_state_int =
|
int migration_state_int =
|
||||||
pref_service_.GetInteger(prefs::kUnifiedConsentMigrationState);
|
pref_service_.GetInteger(prefs::kUnifiedConsentMigrationState);
|
||||||
@@ -199,7 +198,7 @@ TEST_F(UnifiedConsentServiceTest, ReplaceSync_HistorySyncIgnoredForSyncUsers) {
|
|||||||
prefs::kUrlKeyedAnonymizedDataCollectionEnabled));
|
prefs::kUrlKeyedAnonymizedDataCollectionEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
// Tests that kUrlKeyedAnonymizedDataCollectionEnabled is enabled after
|
// Tests that kUrlKeyedAnonymizedDataCollectionEnabled is enabled after
|
||||||
// syncing user signs out, then in again and enabled history sync opt-in.
|
// syncing user signs out, then in again and enabled history sync opt-in.
|
||||||
TEST_F(UnifiedConsentServiceTest,
|
TEST_F(UnifiedConsentServiceTest,
|
||||||
@@ -238,7 +237,7 @@ TEST_F(UnifiedConsentServiceTest,
|
|||||||
EXPECT_FALSE(pref_service()->GetBoolean(
|
EXPECT_FALSE(pref_service()->GetBoolean(
|
||||||
prefs::kUrlKeyedAnonymizedDataCollectionEnabled));
|
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
|
// Tests that any change to history sync opt-in, is reflected in the state
|
||||||
// of `kUrlKeyedAnonymizedDataCollectionEnabled`.
|
// 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) {
|
TEST_F(UnifiedConsentServiceTest, Migration_UpdateSettings) {
|
||||||
// Create user that syncs history and has no custom passphrase.
|
// Create user that syncs history and has no custom passphrase.
|
||||||
SignIn(signin::ConsentLevel::kSync);
|
SignIn(signin::ConsentLevel::kSync);
|
||||||
@@ -402,6 +401,6 @@ TEST_F(UnifiedConsentServiceTest, ClearPrimaryAccountDisablesSomeServices) {
|
|||||||
EXPECT_FALSE(pref_service()->GetBoolean(
|
EXPECT_FALSE(pref_service()->GetBoolean(
|
||||||
prefs::kUrlKeyedAnonymizedDataCollectionEnabled));
|
prefs::kUrlKeyedAnonymizedDataCollectionEnabled));
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||||
|
|
||||||
} // namespace unified_consent
|
} // namespace unified_consent
|
||||||
|
@@ -65,7 +65,6 @@ source_set("patch_impl") {
|
|||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
":update_client",
|
":update_client",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/services/patch/public/cpp",
|
"//components/services/patch/public/cpp",
|
||||||
"//components/services/patch/public/mojom",
|
"//components/services/patch/public/mojom",
|
||||||
"//mojo/public/cpp/bindings",
|
"//mojo/public/cpp/bindings",
|
||||||
@@ -163,7 +162,6 @@ static_library("update_client") {
|
|||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:branding_buildflags",
|
"//build:branding_buildflags",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/client_update_protocol",
|
"//components/client_update_protocol",
|
||||||
"//components/crx_file",
|
"//components/crx_file",
|
||||||
"//components/prefs",
|
"//components/prefs",
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include "base/system/sys_info.h"
|
#include "base/system/sys_info.h"
|
||||||
#include "build/branding_buildflags.h"
|
#include "build/branding_buildflags.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/update_client/update_query_params_delegate.h"
|
#include "components/update_client/update_query_params_delegate.h"
|
||||||
#include "components/version_info/version_info.h"
|
#include "components/version_info/version_info.h"
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@ const char kOs[] =
|
|||||||
"android";
|
"android";
|
||||||
#elif BUILDFLAG(IS_CHROMEOS)
|
#elif BUILDFLAG(IS_CHROMEOS)
|
||||||
"cros";
|
"cros";
|
||||||
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
|
#elif BUILDFLAG(IS_LINUX)
|
||||||
"linux";
|
"linux";
|
||||||
#elif BUILDFLAG(IS_FUCHSIA)
|
#elif BUILDFLAG(IS_FUCHSIA)
|
||||||
"fuchsia";
|
"fuchsia";
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
|
|
||||||
component("common") {
|
component("common") {
|
||||||
sources = [
|
sources = [
|
||||||
"user_type.cc",
|
"user_type.cc",
|
||||||
@@ -41,7 +39,7 @@ component("user_manager") {
|
|||||||
|
|
||||||
defines = [ "USER_MANAGER_IMPLEMENTATION" ]
|
defines = [ "USER_MANAGER_IMPLEMENTATION" ]
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
sources += [
|
sources += [
|
||||||
"account_id_util.cc",
|
"account_id_util.cc",
|
||||||
"account_id_util.h",
|
"account_id_util.h",
|
||||||
@@ -82,7 +80,7 @@ component("user_manager") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_chromeos_ash) {
|
if (is_chromeos) {
|
||||||
source_set("test_support") {
|
source_set("test_support") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
import("//build/config/chromeos/ui_mode.gni")
|
|
||||||
import("//build/util/branding.gni")
|
import("//build/util/branding.gni")
|
||||||
import("//components/vector_icons/vector_icons.gni")
|
import("//components/vector_icons/vector_icons.gni")
|
||||||
|
|
||||||
@@ -259,11 +258,10 @@ aggregate_vector_icons("components_vector_icons") {
|
|||||||
]
|
]
|
||||||
|
|
||||||
if (is_chromeos) {
|
if (is_chromeos) {
|
||||||
sources += [ "notification_download.icon" ]
|
sources += [
|
||||||
}
|
"notification_download.icon",
|
||||||
|
"videogame_asset_outline.icon",
|
||||||
if (is_chromeos_ash) {
|
]
|
||||||
sources += [ "videogame_asset_outline.icon" ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_chrome_branded) {
|
if (is_chrome_branded) {
|
||||||
|
@@ -12,7 +12,6 @@ static_library("version_ui") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/variations",
|
"//components/variations",
|
||||||
"//components/variations/net",
|
"//components/variations/net",
|
||||||
"//components/variations/service",
|
"//components/variations/service",
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
#include "components/version_ui/version_ui_constants.h"
|
#include "components/version_ui/version_ui_constants.h"
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
|
|
||||||
namespace version_ui {
|
namespace version_ui {
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ const char kJSVersion[] = "js_version";
|
|||||||
#endif
|
#endif
|
||||||
const char kLogoAltText[] = "logo_alt_text";
|
const char kLogoAltText[] = "logo_alt_text";
|
||||||
const char kOfficial[] = "official";
|
const char kOfficial[] = "official";
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
const char kOSName[] = "os_name";
|
const char kOSName[] = "os_name";
|
||||||
const char kOSType[] = "os_type";
|
const char kOSType[] = "os_type";
|
||||||
#endif
|
#endif
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
#define COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_
|
#define COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
|
|
||||||
namespace version_ui {
|
namespace version_ui {
|
||||||
|
|
||||||
@@ -51,7 +50,7 @@ extern const char kJSVersion[];
|
|||||||
#endif
|
#endif
|
||||||
extern const char kLogoAltText[];
|
extern const char kLogoAltText[];
|
||||||
extern const char kOfficial[];
|
extern const char kOfficial[];
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS)
|
||||||
extern const char kOSName[];
|
extern const char kOSName[];
|
||||||
extern const char kOSType[];
|
extern const char kOSType[];
|
||||||
#endif
|
#endif
|
||||||
|
@@ -15,7 +15,6 @@ static_library("web_resource") {
|
|||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//build:branding_buildflags",
|
"//build:branding_buildflags",
|
||||||
"//build:chromeos_buildflags",
|
|
||||||
"//components/pref_registry",
|
"//components/pref_registry",
|
||||||
"//components/prefs",
|
"//components/prefs",
|
||||||
"//services/network/public/cpp",
|
"//services/network/public/cpp",
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include "base/functional/bind.h"
|
#include "base/functional/bind.h"
|
||||||
#include "build/branding_buildflags.h"
|
#include "build/branding_buildflags.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
|
||||||
#include "components/prefs/pref_service.h"
|
#include "components/prefs/pref_service.h"
|
||||||
#include "components/web_resource/web_resource_pref_names.h"
|
#include "components/web_resource/web_resource_pref_names.h"
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ bool EulaAcceptedNotifier::IsEulaAccepted() {
|
|||||||
EulaAcceptedNotifier* EulaAcceptedNotifier::Create(PrefService* local_state) {
|
EulaAcceptedNotifier* EulaAcceptedNotifier::Create(PrefService* local_state) {
|
||||||
// First run EULA only exists on ChromeOS, Android and iOS. On ChromeOS, it is
|
// First run EULA only exists on ChromeOS, Android and iOS. On ChromeOS, it is
|
||||||
// only shown in official builds.
|
// 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)
|
BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
|
||||||
// Tests that use higher-level classes that use EulaAcceptNotifier may not
|
// 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
|
// have local state or may not register this pref. Return null to indicate not
|
||||||
|
Reference in New Issue
Block a user