Index: chrome/browser/sync/profile_sync_service.cc |
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
index 4ea3c799939d6acb3f16d254bb96c213e197e3c5..1af6380a5495ea65f5e4ba1e6633f672a9aaeee5 100644 |
--- a/chrome/browser/sync/profile_sync_service.cc |
+++ b/chrome/browser/sync/profile_sync_service.cc |
@@ -432,11 +432,7 @@ void ProfileSyncService::CreateBackend() { |
} |
bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { |
- // Currently on passwords are an encrypted datatype, so |
- // we check to see if it is enabled. |
- syncable::ModelTypeSet types; |
- GetPreferredDataTypes(&types); |
- return types.count(syncable::PASSWORDS) != 0; |
+ return encrypted_types_.size() > 0; |
} |
void ProfileSyncService::StartUp() { |
@@ -742,6 +738,12 @@ void ProfileSyncService::OnPassphraseAccepted() { |
wizard_.Step(SyncSetupWizard::DONE); |
} |
+void ProfileSyncService::OnEncryptionComplete( |
+ const syncable::ModelTypeSet& encrypted_types) { |
+ encrypted_types_ = encrypted_types; |
+ NotifyObservers(); |
+} |
+ |
void ProfileSyncService::ShowLoginDialog(gfx::NativeWindow parent_window) { |
// TODO(johnnyg): File a bug to make sure this doesn't happen. |
if (!cros_user_.empty()) { |
@@ -1159,6 +1161,16 @@ void ProfileSyncService::SetPassphrase(const std::string& passphrase, |
tried_setting_explicit_passphrase_ = true; |
} |
+void ProfileSyncService::EncryptDataTypes( |
+ const syncable::ModelTypeSet& encrypted_types) { |
+ backend_->EncryptDataTypes(encrypted_types); |
+} |
+ |
+void ProfileSyncService::GetEncryptedDataTypes( |
+ syncable::ModelTypeSet* encrypted_types) const { |
+ *encrypted_types = encrypted_types_; |
+} |
+ |
void ProfileSyncService::Observe(NotificationType type, |
const NotificationSource& source, |
const NotificationDetails& details) { |