| OLD | NEW |
| 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> | |
| 9 #include <vector> | 8 #include <vector> |
| 10 | 9 |
| 11 #include "base/macros.h" | 10 #include "base/macros.h" |
| 12 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
| 14 #include "components/prefs/pref_change_registrar.h" | 13 #include "components/prefs/pref_change_registrar.h" |
| 15 #include "components/syncable_prefs/pref_service_syncable_observer.h" | 14 #include "components/syncable_prefs/pref_service_syncable_observer.h" |
| 16 | 15 |
| 17 namespace syncer { | 16 namespace sync_driver { |
| 18 class SyncService; | 17 class SyncService; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace syncable_prefs { | 20 namespace syncable_prefs { |
| 22 class PrefServiceSyncable; | 21 class PrefServiceSyncable; |
| 23 } | 22 } |
| 24 | 23 |
| 25 namespace password_manager { | 24 namespace password_manager { |
| 26 | 25 |
| 27 // Service that is responsible for reconciling the legacy "Offer to save your | 26 // Service that is responsible for reconciling the legacy "Offer to save your |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 public: | 80 public: |
| 82 explicit PasswordManagerSettingMigratorService( | 81 explicit PasswordManagerSettingMigratorService( |
| 83 syncable_prefs::PrefServiceSyncable* prefs); | 82 syncable_prefs::PrefServiceSyncable* prefs); |
| 84 ~PasswordManagerSettingMigratorService() override; | 83 ~PasswordManagerSettingMigratorService() override; |
| 85 | 84 |
| 86 void Shutdown() override; | 85 void Shutdown() override; |
| 87 | 86 |
| 88 // PrefServiceSyncableObserver: | 87 // PrefServiceSyncableObserver: |
| 89 void OnIsSyncingChanged() override; | 88 void OnIsSyncingChanged() override; |
| 90 | 89 |
| 91 void InitializeMigration(syncer::SyncService* sync_service); | 90 void InitializeMigration(sync_driver::SyncService* sync_service); |
| 92 | 91 |
| 93 // Only use for testing. | 92 // Only use for testing. |
| 94 static void set_force_disabled_for_testing(bool force_disabled) { | 93 static void set_force_disabled_for_testing(bool force_disabled) { |
| 95 force_disabled_for_testing_ = force_disabled; | 94 force_disabled_for_testing_ = force_disabled; |
| 96 } | 95 } |
| 97 | 96 |
| 98 private: | 97 private: |
| 99 // Initializes the observers: preferences observers and sync status observers. | 98 // Initializes the observers: preferences observers and sync status observers. |
| 100 void InitObservers(); | 99 void InitObservers(); |
| 101 | 100 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // corresponds to kPasswordManagerSavingEnabled if size of sync_data_ equals | 140 // corresponds to kPasswordManagerSavingEnabled if size of sync_data_ equals |
| 142 // to 4, otherwise the vector contains the value only for one preference. | 141 // to 4, otherwise the vector contains the value only for one preference. |
| 143 std::vector<bool> sync_data_; | 142 std::vector<bool> sync_data_; |
| 144 | 143 |
| 145 // The initial value for kCredentialsEnableService. | 144 // The initial value for kCredentialsEnableService. |
| 146 bool initial_new_pref_value_; | 145 bool initial_new_pref_value_; |
| 147 // The initial value for kPasswordManagerSavingEnabled. | 146 // The initial value for kPasswordManagerSavingEnabled. |
| 148 bool initial_legacy_pref_value_; | 147 bool initial_legacy_pref_value_; |
| 149 | 148 |
| 150 syncable_prefs::PrefServiceSyncable* prefs_; | 149 syncable_prefs::PrefServiceSyncable* prefs_; |
| 151 syncer::SyncService* sync_service_; | 150 sync_driver::SyncService* sync_service_; |
| 152 | 151 |
| 153 PrefChangeRegistrar pref_change_registrar_; | 152 PrefChangeRegistrar pref_change_registrar_; |
| 154 | 153 |
| 155 // If true, the service will refuse to initialize despite Field Trial | 154 // If true, the service will refuse to initialize despite Field Trial |
| 156 // settings. | 155 // settings. |
| 157 // Default value is false. Only use for testing. | 156 // Default value is false. Only use for testing. |
| 158 static bool force_disabled_for_testing_; | 157 static bool force_disabled_for_testing_; |
| 159 | 158 |
| 160 DISALLOW_COPY_AND_ASSIGN(PasswordManagerSettingMigratorService); | 159 DISALLOW_COPY_AND_ASSIGN(PasswordManagerSettingMigratorService); |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 } // namespace password_manager | 162 } // namespace password_manager |
| 164 | 163 |
| 165 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIG
RATOR_SERVICE_H_ | 164 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MANAGER_SETTING_MIG
RATOR_SERVICE_H_ |
| OLD | NEW |