summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2015-09-18 02:47:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-18 09:48:29 +0000
commit50c1e529587af459c14828ebe48d2e018d4b8e98 (patch)
treefce899626a1def4c171c4e348101d67746058eca /chrome/browser/chromeos
parentc956799bbab4a8ef3c3f223f5179847a89d2eda1 (diff)
downloadchromium_src-50c1e529587af459c14828ebe48d2e018d4b8e98.zip
chromium_src-50c1e529587af459c14828ebe48d2e018d4b8e98.tar.gz
chromium_src-50c1e529587af459c14828ebe48d2e018d4b8e98.tar.bz2
Add syncable_prefs namespace.
Move all the code in the syncable_prefs components into the namespace syncable_prefs and fix usage. Change automated with tools/git/mffr.py with manual fixes for the class forward-declaration. BUG=520542 TBR=jochen@chromium.org Review URL: https://codereview.chromium.org/1353913003 Cr-Commit-Position: refs/heads/master@{#349638}
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/customization/customization_document_unittest.cc4
-rw-r--r--chrome/browser/chromeos/events/event_rewriter_unittest.cc50
-rw-r--r--chrome/browser/chromeos/file_system_provider/registry_unittest.cc8
-rw-r--r--chrome/browser/chromeos/input_method/input_method_persistence_unittest.cc2
-rw-r--r--chrome/browser/chromeos/input_method/input_method_syncer.cc5
-rw-r--r--chrome/browser/chromeos/input_method/input_method_syncer.h10
-rw-r--r--chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc11
-rw-r--r--chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h15
-rw-r--r--chrome/browser/chromeos/policy/consumer_enrollment_handler_unittest.cc2
-rw-r--r--chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc13
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc7
-rw-r--r--chrome/browser/chromeos/power/power_prefs_unittest.cc4
-rw-r--r--chrome/browser/chromeos/preferences.cc7
-rw-r--r--chrome/browser/chromeos/preferences.h16
-rw-r--r--chrome/browser/chromeos/preferences_unittest.cc2
15 files changed, 79 insertions, 77 deletions
diff --git a/chrome/browser/chromeos/customization/customization_document_unittest.cc b/chrome/browser/chromeos/customization/customization_document_unittest.cc
index 35b60df..9bc7d88 100644
--- a/chrome/browser/chromeos/customization/customization_document_unittest.cc
+++ b/chrome/browser/chromeos/customization/customization_document_unittest.cc
@@ -282,10 +282,10 @@ class ServicesCustomizationDocumentTest : public testing::Test {
scoped_ptr<TestingProfile> CreateProfile() {
TestingProfile::Builder profile_builder;
- PrefServiceMockFactory factory;
+ syncable_prefs::PrefServiceMockFactory factory;
scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
new user_prefs::PrefRegistrySyncable);
- scoped_ptr<PrefServiceSyncable> prefs(
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs(
factory.CreateSyncable(registry.get()));
chrome::RegisterUserProfilePrefs(registry.get());
profile_builder.SetPrefService(prefs.Pass());
diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
index bb27bb2..2149b91 100644
--- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc
+++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
@@ -160,7 +160,7 @@ class EventRewriterTest : public ash::test::AshTestBase {
TEST_F(EventRewriterTest, TestRewriteCommandToControl) {
// First, test with a PC keyboard.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
rewriter.set_last_keyboard_device_id_for_testing(kKeyboardDeviceId);
@@ -256,7 +256,7 @@ TEST_F(EventRewriterTest, TestRewriteCommandToControl) {
// For crbug.com/133896.
TEST_F(EventRewriterTest, TestRewriteCommandToControlWithControlRemapped) {
// Remap Control to Alt.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapControlKeyTo, &prefs);
@@ -308,7 +308,7 @@ TEST_F(EventRewriterTest, TestRewriteCommandToControlWithControlRemapped) {
}
void EventRewriterTest::TestRewriteNumPadKeys() {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
rewriter.set_last_keyboard_device_id_for_testing(kKeyboardDeviceId);
@@ -500,7 +500,7 @@ TEST_F(EventRewriterTest, TestRewriteNumPadKeysWithDiamondKeyFlag) {
// Tests if the rewriter can handle a Command + Num Pad event.
void EventRewriterTest::TestRewriteNumPadKeysOnAppleKeyboard() {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "Apple Keyboard");
rewriter.set_last_keyboard_device_id_for_testing(kKeyboardDeviceId);
@@ -545,7 +545,7 @@ TEST_F(EventRewriterTest,
}
TEST_F(EventRewriterTest, TestRewriteModifiersNoRemap) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
rewriter.set_pref_service_for_testing(&prefs);
@@ -596,7 +596,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersNoRemap) {
}
TEST_F(EventRewriterTest, TestRewriteModifiersNoRemapMultipleKeys) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
rewriter.set_pref_service_for_testing(&prefs);
@@ -642,7 +642,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersNoRemapMultipleKeys) {
TEST_F(EventRewriterTest, TestRewriteModifiersDisableSome) {
// Disable Search and Control keys.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -735,7 +735,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersDisableSome) {
TEST_F(EventRewriterTest, TestRewriteModifiersRemapToControl) {
// Remap Search to Control.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -813,7 +813,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersRemapToControl) {
TEST_F(EventRewriterTest, TestRewriteModifiersRemapToEscape) {
// Remap Search to ESC.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -838,7 +838,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersRemapToEscape) {
TEST_F(EventRewriterTest, TestRewriteModifiersRemapMany) {
// Remap Search to Alt.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -944,7 +944,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersRemapMany) {
TEST_F(EventRewriterTest, TestRewriteModifiersRemapToCapsLock) {
// Remap Search to Caps Lock.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -1035,7 +1035,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersRemapToCapsLock) {
}
TEST_F(EventRewriterTest, TestRewriteCapsLock) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
chromeos::input_method::FakeImeKeyboard ime_keyboard;
@@ -1057,7 +1057,7 @@ TEST_F(EventRewriterTest, TestRewriteCapsLock) {
}
TEST_F(EventRewriterTest, TestRewriteDiamondKey) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
chromeos::input_method::FakeImeKeyboard ime_keyboard;
@@ -1098,7 +1098,7 @@ TEST_F(EventRewriterTest, TestRewriteDiamondKeyWithFlag) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
chromeos::switches::kHasChromeOSDiamondKey, "");
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
chromeos::input_method::FakeImeKeyboard ime_keyboard;
@@ -1251,7 +1251,7 @@ TEST_F(EventRewriterTest, TestRewriteDiamondKeyWithFlag) {
TEST_F(EventRewriterTest, TestRewriteCapsLockToControl) {
// Remap CapsLock to Control.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapCapsLockKeyTo, &prefs);
@@ -1294,7 +1294,7 @@ TEST_F(EventRewriterTest, TestRewriteCapsLockToControl) {
TEST_F(EventRewriterTest, TestRewriteCapsLockMod3InUse) {
// Remap CapsLock to Control.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapCapsLockKeyTo, &prefs);
@@ -1318,7 +1318,7 @@ TEST_F(EventRewriterTest, TestRewriteCapsLockMod3InUse) {
}
TEST_F(EventRewriterTest, TestRewriteExtendedKeys) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
@@ -1464,7 +1464,7 @@ TEST_F(EventRewriterTest, TestRewriteExtendedKeys) {
}
TEST_F(EventRewriterTest, TestRewriteFunctionKeys) {
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
EventRewriter rewriter(NULL);
rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
@@ -1780,7 +1780,7 @@ TEST_F(EventRewriterTest, TestRewriteFunctionKeys) {
TEST_F(EventRewriterTest, TestRewriteExtendedKeysWithSearchRemapped) {
// Remap Search to Control.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember search;
search.Init(prefs::kLanguageRemapSearchKeyTo, &prefs);
@@ -1812,7 +1812,7 @@ TEST_F(EventRewriterTest, TestRewriteExtendedKeysWithSearchRemapped) {
TEST_F(EventRewriterTest, TestRewriteKeyEventSentByXSendEvent) {
// Remap Control to Alt.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapControlKeyTo, &prefs);
@@ -1854,7 +1854,7 @@ TEST_F(EventRewriterTest, TestRewriteKeyEventSentByXSendEvent) {
TEST_F(EventRewriterTest, TestRewriteNonNativeEvent) {
// Remap Control to Alt.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapControlKeyTo, &prefs);
@@ -1962,7 +1962,7 @@ class EventRewriterAshTest : public ash::test::AshTestBase {
}
protected:
- TestingPrefServiceSyncable* prefs() { return &prefs_; }
+ syncable_prefs::TestingPrefServiceSyncable* prefs() { return &prefs_; }
void PopEvents(ScopedVector<ui::Event>* events) { buffer_.PopEvents(events); }
@@ -1996,7 +1996,7 @@ class EventRewriterAshTest : public ash::test::AshTestBase {
user_manager::FakeUserManager* fake_user_manager_; // Not owned.
chromeos::ScopedUserManagerEnabler user_manager_enabler_;
- TestingPrefServiceSyncable prefs_;
+ syncable_prefs::TestingPrefServiceSyncable prefs_;
DISALLOW_COPY_AND_ASSIGN(EventRewriterAshTest);
};
@@ -2058,7 +2058,7 @@ TEST_F(EventRewriterTest, TestRewrittenModifierClick) {
ui::TouchFactory::GetInstance()->SetPointerDeviceForTest(device_list);
// Remap Control to Alt.
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
chromeos::Preferences::RegisterProfilePrefs(prefs.registry());
IntegerPrefMember control;
control.Init(prefs::kLanguageRemapControlKeyTo, &prefs);
@@ -2097,7 +2097,7 @@ TEST_F(EventRewriterTest, DontRewriteIfNotRewritten) {
device_list.push_back(11);
ui::TouchFactory::GetInstance()->SetPointerDeviceForTest(device_list);
#endif
- TestingPrefServiceSyncable prefs;
+ syncable_prefs::TestingPrefServiceSyncable prefs;
EventRewriter rewriter(NULL);
rewriter.set_pref_service_for_testing(&prefs);
const int kLeftAndAltFlag = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_ALT_DOWN;
diff --git a/chrome/browser/chromeos/file_system_provider/registry_unittest.cc b/chrome/browser/chromeos/file_system_provider/registry_unittest.cc
index 9665dbd..292460d 100644
--- a/chrome/browser/chromeos/file_system_provider/registry_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/registry_unittest.cc
@@ -50,7 +50,7 @@ void RememberFakeFileSystem(TestingProfile* profile,
const Watcher& watcher) {
// Warning. Updating this code means that backward compatibility may be
// broken, what is unexpected and should be avoided.
- TestingPrefServiceSyncable* const pref_service =
+ syncable_prefs::TestingPrefServiceSyncable* const pref_service =
profile->GetTestingPrefService();
ASSERT_TRUE(pref_service);
@@ -167,7 +167,7 @@ TEST_F(FileSystemProviderRegistryTest, RememberFileSystem) {
registry_->RememberFileSystem(file_system_info, watchers);
- TestingPrefServiceSyncable* const pref_service =
+ syncable_prefs::TestingPrefServiceSyncable* const pref_service =
profile_->GetTestingPrefService();
ASSERT_TRUE(pref_service);
@@ -255,7 +255,7 @@ TEST_F(FileSystemProviderRegistryTest, ForgetFileSystem) {
registry_->ForgetFileSystem(kExtensionId, kFileSystemId);
- TestingPrefServiceSyncable* const pref_service =
+ syncable_prefs::TestingPrefServiceSyncable* const pref_service =
profile_->GetTestingPrefService();
ASSERT_TRUE(pref_service);
@@ -286,7 +286,7 @@ TEST_F(FileSystemProviderRegistryTest, UpdateWatcherTag) {
fake_watcher_.last_tag = "updated-tag";
registry_->UpdateWatcherTag(file_system_info, fake_watcher_);
- TestingPrefServiceSyncable* const pref_service =
+ syncable_prefs::TestingPrefServiceSyncable* const pref_service =
profile_->GetTestingPrefService();
ASSERT_TRUE(pref_service);
diff --git a/chrome/browser/chromeos/input_method/input_method_persistence_unittest.cc b/chrome/browser/chromeos/input_method/input_method_persistence_unittest.cc
index b73f429..4811cac 100644
--- a/chrome/browser/chromeos/input_method/input_method_persistence_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_persistence_unittest.cc
@@ -70,7 +70,7 @@ class InputMethodPersistenceTest : public testing::Test {
}
content::TestBrowserThreadBundle thread_bundle_;
- TestingPrefServiceSyncable* mock_user_prefs_;
+ syncable_prefs::TestingPrefServiceSyncable* mock_user_prefs_;
MockInputMethodManager mock_manager_;
TestingProfileManager mock_profile_manager_;
chromeos::FakeChromeUserManager* fake_user_manager_;
diff --git a/chrome/browser/chromeos/input_method/input_method_syncer.cc b/chrome/browser/chromeos/input_method/input_method_syncer.cc
index 61cccf3..90b2db0 100644
--- a/chrome/browser/chromeos/input_method/input_method_syncer.cc
+++ b/chrome/browser/chromeos/input_method/input_method_syncer.cc
@@ -113,13 +113,12 @@ void MergeLists(std::vector<std::string>* dest,
} // anonymous namespace
InputMethodSyncer::InputMethodSyncer(
- PrefServiceSyncable* prefs,
+ syncable_prefs::PrefServiceSyncable* prefs,
scoped_refptr<input_method::InputMethodManager::State> ime_state)
: prefs_(prefs),
ime_state_(ime_state),
merging_(false),
- weak_factory_(this) {
-}
+ weak_factory_(this) {}
InputMethodSyncer::~InputMethodSyncer() {
prefs_->RemoveObserver(this);
diff --git a/chrome/browser/chromeos/input_method/input_method_syncer.h b/chrome/browser/chromeos/input_method/input_method_syncer.h
index e01fffd..f68910b 100644
--- a/chrome/browser/chromeos/input_method/input_method_syncer.h
+++ b/chrome/browser/chromeos/input_method/input_method_syncer.h
@@ -13,7 +13,9 @@
#include "components/syncable_prefs/pref_service_syncable_observer.h"
#include "ui/base/ime/chromeos/input_method_manager.h"
+namespace syncable_prefs {
class PrefServiceSyncable;
+}
namespace user_prefs {
class PrefRegistrySyncable;
@@ -28,10 +30,10 @@ namespace input_method {
// except once: when the user first logs into the device.
// Thus, the user's most recent changes to language and input method preferences
// will be brought down when signing in to a new device but not in future syncs.
-class InputMethodSyncer : public PrefServiceSyncableObserver {
+class InputMethodSyncer : public syncable_prefs::PrefServiceSyncableObserver {
public:
InputMethodSyncer(
- PrefServiceSyncable* prefs,
+ syncable_prefs::PrefServiceSyncable* prefs,
scoped_refptr<input_method::InputMethodManager::State> ime_state);
~InputMethodSyncer() override;
@@ -63,7 +65,7 @@ class InputMethodSyncer : public PrefServiceSyncableObserver {
// the local pref values.
void OnPreferenceChanged(const std::string& pref_name);
- // PrefServiceSyncableObserver implementation.
+ // syncable_prefs::PrefServiceSyncableObserver implementation.
void OnIsSyncingChanged() override;
StringPrefMember preferred_languages_;
@@ -77,7 +79,7 @@ class InputMethodSyncer : public PrefServiceSyncableObserver {
StringPrefMember preload_engines_syncable_;
StringPrefMember enabled_extension_imes_syncable_;
- PrefServiceSyncable* prefs_;
+ syncable_prefs::PrefServiceSyncable* prefs_;
scoped_refptr<input_method::InputMethodManager::State> ime_state_;
// Used to ignore PrefChanged events while InputMethodManager is merging.
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc
index 58648ec..40462b3 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc
@@ -207,17 +207,14 @@ class EasyUnlockTpmKeyManagerTest : public testing::Test {
signin_profile_ = profile_manager_.CreateTestingProfile(
chrome::kInitialProfile,
- scoped_ptr<TestingPrefServiceSyncable>(),
- base::UTF8ToUTF16(chrome::kInitialProfile),
- 0 /* avatar id */,
+ scoped_ptr<syncable_prefs::TestingPrefServiceSyncable>(),
+ base::UTF8ToUTF16(chrome::kInitialProfile), 0 /* avatar id */,
std::string() /* supervized user id */,
TestingProfile::TestingFactories());
user_profile_ = profile_manager_.CreateTestingProfile(
- kTestUserId,
- scoped_ptr<TestingPrefServiceSyncable>(),
- base::UTF8ToUTF16(kTestUserId),
- 0 /* avatar id */,
+ kTestUserId, scoped_ptr<syncable_prefs::TestingPrefServiceSyncable>(),
+ base::UTF8ToUTF16(kTestUserId), 0 /* avatar id */,
std::string() /* supervized user id */,
TestingProfile::TestingFactories());
}
diff --git a/chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h b/chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h
index d2939f4..b972ed8 100644
--- a/chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h
+++ b/chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h
@@ -13,12 +13,16 @@
#include "content/public/browser/notification_observer.h"
class PrefChangeRegistrar;
-class PrefServiceSyncable;
class Profile;
namespace content {
class NotificationRegistrar;
}
+
+namespace syncable_prefs {
+class PrefServiceSyncable;
+}
+
namespace user_prefs {
class PrefRegistrySyncable;
}
@@ -31,8 +35,9 @@ namespace chromeos {
// This class is responsible for keeping local user image synced with
// image saved in syncable preference.
-class UserImageSyncObserver: public PrefServiceSyncableObserver,
- public content::NotificationObserver {
+class UserImageSyncObserver
+ : public syncable_prefs::PrefServiceSyncableObserver,
+ public content::NotificationObserver {
public:
class Observer {
public:
@@ -59,7 +64,7 @@ class UserImageSyncObserver: public PrefServiceSyncableObserver,
void RemoveObserver(Observer* observer);
private:
- // PrefServiceSyncableObserver implementation.
+ // syncable_prefs::PrefServiceSyncableObserver implementation.
void OnIsSyncingChanged() override;
// content::NotificationObserver implementation.
@@ -92,7 +97,7 @@ class UserImageSyncObserver: public PrefServiceSyncableObserver,
const user_manager::User* user_;
scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
scoped_ptr<content::NotificationRegistrar> notification_registrar_;
- PrefServiceSyncable* prefs_;
+ syncable_prefs::PrefServiceSyncable* prefs_;
bool is_synced_;
// Indicates if local user image changed during initialization.
bool local_image_changed_;
diff --git a/chrome/browser/chromeos/policy/consumer_enrollment_handler_unittest.cc b/chrome/browser/chromeos/policy/consumer_enrollment_handler_unittest.cc
index fa0acf2..7116c61 100644
--- a/chrome/browser/chromeos/policy/consumer_enrollment_handler_unittest.cc
+++ b/chrome/browser/chromeos/policy/consumer_enrollment_handler_unittest.cc
@@ -74,7 +74,7 @@ class ConsumerEnrollmentHandlerTest : public testing::Test {
std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(),
BuildAutoIssuingFakeProfileOAuth2TokenService));
profile_ = testing_profile_manager_->CreateTestingProfile(
- kTestUser, scoped_ptr<PrefServiceSyncable>(),
+ kTestUser, scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
base::UTF8ToUTF16(kTestUser), 0, std::string(), factories);
// Set up the authenticated user name and ID.
diff --git a/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc b/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
index ef3a11a..bd8c9d2 100644
--- a/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
+++ b/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
@@ -67,14 +67,14 @@ class RecommendationRestorerTest : public testing::Test {
void VerifyTimerIsRunning() const;
TestingPrefStore* recommended_prefs_; // Not owned.
- TestingPrefServiceSyncable* prefs_; // Not owned.
+ syncable_prefs::TestingPrefServiceSyncable* prefs_; // Not owned.
RecommendationRestorer* restorer_; // Not owned.
scoped_refptr<base::TestSimpleTaskRunner> runner_;
base::ThreadTaskRunnerHandle runner_handler_;
private:
- scoped_ptr<PrefServiceSyncable> prefs_owner_;
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs_owner_;
TestingProfileManager profile_manager_;
@@ -83,7 +83,7 @@ class RecommendationRestorerTest : public testing::Test {
RecommendationRestorerTest::RecommendationRestorerTest()
: recommended_prefs_(new TestingPrefStore),
- prefs_(new TestingPrefServiceSyncable(
+ prefs_(new syncable_prefs::TestingPrefServiceSyncable(
new TestingPrefStore,
new TestingPrefStore,
recommended_prefs_,
@@ -93,8 +93,7 @@ RecommendationRestorerTest::RecommendationRestorerTest()
runner_(new base::TestSimpleTaskRunner),
runner_handler_(runner_),
prefs_owner_(prefs_),
- profile_manager_(TestingBrowserProcess::GetGlobal()) {
-}
+ profile_manager_(TestingBrowserProcess::GetGlobal()) {}
void RecommendationRestorerTest::SetUp() {
testing::Test::SetUp();
@@ -167,7 +166,7 @@ void RecommendationRestorerTest::NotifyOfUserActivity() {
void RecommendationRestorerTest::VerifyPrefFollowsUser(
const char* pref_name,
const base::Value& expected_value) const {
- const PrefServiceSyncable::Preference* pref =
+ const syncable_prefs::PrefServiceSyncable::Preference* pref =
prefs_->FindPreference(pref_name);
ASSERT_TRUE(pref);
EXPECT_TRUE(pref->HasUserSetting());
@@ -194,7 +193,7 @@ void RecommendationRestorerTest::VerifyPrefsFollowUser() const {
void RecommendationRestorerTest::VerifyPrefFollowsRecommendation(
const char* pref_name,
const base::Value& expected_value) const {
- const PrefServiceSyncable::Preference* pref =
+ const syncable_prefs::PrefServiceSyncable::Preference* pref =
prefs_->FindPreference(pref_name);
ASSERT_TRUE(pref);
EXPECT_TRUE(pref->IsRecommended());
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
index 59bbadb..8acc4ab 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
@@ -98,11 +98,8 @@ class UserCloudPolicyManagerChromeOSTest : public testing::Test {
BuildFakeProfileOAuth2TokenService));
profile_ = profile_manager_->CreateTestingProfile(
chrome::kInitialProfile,
- scoped_ptr<PrefServiceSyncable>(),
- base::UTF8ToUTF16(""),
- 0,
- std::string(),
- factories);
+ scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
+ base::UTF8ToUTF16(""), 0, std::string(), factories);
// Usually the signin Profile and the main Profile are separate, but since
// the signin Profile is an OTR Profile then for this test it suffices to
// attach it to the main Profile.
diff --git a/chrome/browser/chromeos/power/power_prefs_unittest.cc b/chrome/browser/chromeos/power/power_prefs_unittest.cc
index 9574f8c..00586c3 100644
--- a/chrome/browser/chromeos/power/power_prefs_unittest.cc
+++ b/chrome/browser/chromeos/power/power_prefs_unittest.cc
@@ -172,8 +172,8 @@ bool PowerPrefsTest::GetExpectedAllowScreenWakeLocksForProfile(
TEST_F(PowerPrefsTest, LoginScreen) {
// Set up login profile.
- scoped_ptr<TestingPrefServiceSyncable> login_profile_prefs(
- new TestingPrefServiceSyncable);
+ scoped_ptr<syncable_prefs::TestingPrefServiceSyncable> login_profile_prefs(
+ new syncable_prefs::TestingPrefServiceSyncable);
chrome::RegisterLoginProfilePrefs(login_profile_prefs->registry());
TestingProfile::Builder builder;
builder.SetPath(
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index c34a92e..b6ed2db 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -285,7 +285,7 @@ void Preferences::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kForceMaximizeOnFirstRun, false);
}
-void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
+void Preferences::InitUserPrefs(syncable_prefs::PrefServiceSyncable* prefs) {
prefs_ = prefs;
BooleanPrefMember::NamedChangeCallback callback =
@@ -333,7 +333,8 @@ void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
void Preferences::Init(Profile* profile, const user_manager::User* user) {
DCHECK(profile);
DCHECK(user);
- PrefServiceSyncable* prefs = PrefServiceSyncableFromProfile(profile);
+ syncable_prefs::PrefServiceSyncable* prefs =
+ PrefServiceSyncableFromProfile(profile);
// This causes OnIsSyncingChanged to be called when the value of
// PrefService::IsSyncing() changes.
prefs->AddObserver(this);
@@ -370,7 +371,7 @@ void Preferences::Init(Profile* profile, const user_manager::User* user) {
}
void Preferences::InitUserPrefsForTesting(
- PrefServiceSyncable* prefs,
+ syncable_prefs::PrefServiceSyncable* prefs,
const user_manager::User* user,
scoped_refptr<input_method::InputMethodManager::State> ime_state) {
user_ = user;
diff --git a/chrome/browser/chromeos/preferences.h b/chrome/browser/chromeos/preferences.h
index 3dffa2d..f3df661 100644
--- a/chrome/browser/chromeos/preferences.h
+++ b/chrome/browser/chromeos/preferences.h
@@ -18,10 +18,12 @@
class PrefRegistrySimple;
class PrefService;
-class PrefServiceSyncable;
-
class TracingManager;
+namespace syncable_prefs {
+class PrefServiceSyncable;
+}
+
namespace user_prefs {
class PrefRegistrySyncable;
}
@@ -39,7 +41,7 @@ class InputMethodSyncer;
// is first initialized, it will initialize the OS settings to what's stored in
// the preferences. These include touchpad settings, etc.
// When the preferences change, we change the settings to reflect the new value.
-class Preferences : public PrefServiceSyncableObserver,
+class Preferences : public syncable_prefs::PrefServiceSyncableObserver,
public ash::ShellObserver,
public user_manager::UserManager::UserSessionStateObserver {
public:
@@ -57,7 +59,7 @@ class Preferences : public PrefServiceSyncableObserver,
void Init(Profile* profile, const user_manager::User* user);
void InitUserPrefsForTesting(
- PrefServiceSyncable* prefs,
+ syncable_prefs::PrefServiceSyncable* prefs,
const user_manager::User* user,
scoped_refptr<input_method::InputMethodManager::State> ime_state);
void SetInputMethodListForTesting();
@@ -70,7 +72,7 @@ class Preferences : public PrefServiceSyncableObserver,
};
// Initializes all member prefs.
- void InitUserPrefs(PrefServiceSyncable* prefs);
+ void InitUserPrefs(syncable_prefs::PrefServiceSyncable* prefs);
// Callback method for preference changes.
void OnPreferenceChanged(const std::string& pref_name);
@@ -101,7 +103,7 @@ class Preferences : public PrefServiceSyncableObserver,
// on the cmd line.
void ForceNaturalScrollDefault();
- // PrefServiceSyncableObserver implementation.
+ // syncable_prefs::PrefServiceSyncableObserver implementation.
void OnIsSyncingChanged() override;
// Overriden from ash::ShellObserver.
@@ -112,7 +114,7 @@ class Preferences : public PrefServiceSyncableObserver,
void ActivateInputMethods(const user_manager::User* active_user);
- PrefServiceSyncable* prefs_;
+ syncable_prefs::PrefServiceSyncable* prefs_;
input_method::InputMethodManager* input_method_manager_;
scoped_ptr<TracingManager> tracing_manager_;
diff --git a/chrome/browser/chromeos/preferences_unittest.cc b/chrome/browser/chromeos/preferences_unittest.cc
index 7554ef2..27af983 100644
--- a/chrome/browser/chromeos/preferences_unittest.cc
+++ b/chrome/browser/chromeos/preferences_unittest.cc
@@ -203,7 +203,7 @@ class PreferencesTest : public testing::Test {
// Not owned.
const user_manager::User* test_user_;
TestingProfile* test_profile_;
- TestingPrefServiceSyncable* pref_service_;
+ syncable_prefs::TestingPrefServiceSyncable* pref_service_;
input_method::MyMockInputMethodManager* mock_manager_;
private: