Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: components/password_manager/sync/browser/password_manager_setting_migrator_service.h

Issue 2376123003: [Sync] Move //components/sync to the syncer namespace. (Closed)
Patch Set: Rebase. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIGRAT OR_SERVICE_H_ 5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIGRAT OR_SERVICE_H_
6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIGRAT OR_SERVICE_H_ 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIGRAT OR_SERVICE_H_
7 7
8 #include <string>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
12 #include "components/keyed_service/core/keyed_service.h" 13 #include "components/keyed_service/core/keyed_service.h"
13 #include "components/prefs/pref_change_registrar.h" 14 #include "components/prefs/pref_change_registrar.h"
14 #include "components/syncable_prefs/pref_service_syncable_observer.h" 15 #include "components/syncable_prefs/pref_service_syncable_observer.h"
15 16
16 namespace sync_driver { 17 namespace syncer {
17 class SyncService; 18 class SyncService;
18 } 19 }
19 20
20 namespace syncable_prefs { 21 namespace syncable_prefs {
21 class PrefServiceSyncable; 22 class PrefServiceSyncable;
22 } 23 }
23 24
24 namespace password_manager { 25 namespace password_manager {
25 26
26 // Service that is responsible for reconciling the legacy "Offer to save your 27 // Service that is responsible for reconciling the legacy "Offer to save your
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 public: 81 public:
81 explicit PasswordManagerSettingMigratorService( 82 explicit PasswordManagerSettingMigratorService(
82 syncable_prefs::PrefServiceSyncable* prefs); 83 syncable_prefs::PrefServiceSyncable* prefs);
83 ~PasswordManagerSettingMigratorService() override; 84 ~PasswordManagerSettingMigratorService() override;
84 85
85 void Shutdown() override; 86 void Shutdown() override;
86 87
87 // PrefServiceSyncableObserver: 88 // PrefServiceSyncableObserver:
88 void OnIsSyncingChanged() override; 89 void OnIsSyncingChanged() override;
89 90
90 void InitializeMigration(sync_driver::SyncService* sync_service); 91 void InitializeMigration(syncer::SyncService* sync_service);
91 92
92 // Only use for testing. 93 // Only use for testing.
93 static void set_force_disabled_for_testing(bool force_disabled) { 94 static void set_force_disabled_for_testing(bool force_disabled) {
94 force_disabled_for_testing_ = force_disabled; 95 force_disabled_for_testing_ = force_disabled;
95 } 96 }
96 97
97 private: 98 private:
98 // Initializes the observers: preferences observers and sync status observers. 99 // Initializes the observers: preferences observers and sync status observers.
99 void InitObservers(); 100 void InitObservers();
100 101
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // corresponds to kPasswordManagerSavingEnabled if size of sync_data_ equals 141 // corresponds to kPasswordManagerSavingEnabled if size of sync_data_ equals
141 // to 4, otherwise the vector contains the value only for one preference. 142 // to 4, otherwise the vector contains the value only for one preference.
142 std::vector<bool> sync_data_; 143 std::vector<bool> sync_data_;
143 144
144 // The initial value for kCredentialsEnableService. 145 // The initial value for kCredentialsEnableService.
145 bool initial_new_pref_value_; 146 bool initial_new_pref_value_;
146 // The initial value for kPasswordManagerSavingEnabled. 147 // The initial value for kPasswordManagerSavingEnabled.
147 bool initial_legacy_pref_value_; 148 bool initial_legacy_pref_value_;
148 149
149 syncable_prefs::PrefServiceSyncable* prefs_; 150 syncable_prefs::PrefServiceSyncable* prefs_;
150 sync_driver::SyncService* sync_service_; 151 syncer::SyncService* sync_service_;
151 152
152 PrefChangeRegistrar pref_change_registrar_; 153 PrefChangeRegistrar pref_change_registrar_;
153 154
154 // If true, the service will refuse to initialize despite Field Trial 155 // If true, the service will refuse to initialize despite Field Trial
155 // settings. 156 // settings.
156 // Default value is false. Only use for testing. 157 // Default value is false. Only use for testing.
157 static bool force_disabled_for_testing_; 158 static bool force_disabled_for_testing_;
158 159
159 DISALLOW_COPY_AND_ASSIGN(PasswordManagerSettingMigratorService); 160 DISALLOW_COPY_AND_ASSIGN(PasswordManagerSettingMigratorService);
160 }; 161 };
161 162
162 } // namespace password_manager 163 } // namespace password_manager
163 164
164 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIG RATOR_SERVICE_H_ 165 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIG RATOR_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698