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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 10917246: [Sync] Add keystore encryption info to about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make const Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/sync_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 5e0a0c3609fd768ff680ab34daf21a8b2d9261f6..30f69f1f433223f5cd28c3e80f3e4a27f1af361f 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -31,6 +31,7 @@
#include "sync/internal_api/public/read_transaction.h"
#include "sync/internal_api/public/user_share.h"
#include "sync/internal_api/public/util/experiments.h"
+#include "sync/internal_api/public/util/sync_string_conversions.h"
#include "sync/internal_api/public/write_node.h"
#include "sync/internal_api/public/write_transaction.h"
#include "sync/internal_api/syncapi_internal.h"
@@ -87,6 +88,15 @@ GetUpdatesCallerInfo::GetUpdatesSource GetSourceFromReason(
return GetUpdatesCallerInfo::UNKNOWN;
}
+std::string GetKeystoreMigrationTimeStr(base::Time migration_time) {
+ std::string migration_time_str;
+ if (migration_time.is_null())
+ migration_time_str = "Not Migrated";
+ else
+ migration_time_str = GetTimeDebugString(migration_time);
+ return migration_time_str;
+}
+
} // namespace
// A class to calculate nudge delays for types.
@@ -383,6 +393,8 @@ void SyncManagerImpl::Init(
unrecoverable_error_handler_ = unrecoverable_error_handler;
report_unrecoverable_error_function_ = report_unrecoverable_error_function;
+ allstatus_.SetHasKeystoreKey(
+ !restored_keystore_key_for_bootstrapping.empty());
sync_encryption_handler_.reset(new SyncEncryptionHandlerImpl(
&share_,
encryptor,
@@ -534,7 +546,8 @@ void SyncManagerImpl::OnPassphraseAccepted() {
void SyncManagerImpl::OnBootstrapTokenUpdated(
const std::string& bootstrap_token,
BootstrapTokenType type) {
- // Does nothing.
+ if (type == KEYSTORE_BOOTSTRAP_TOKEN)
+ allstatus_.SetHasKeystoreKey(true);
akalin 2012/09/17 18:07:20 SetHasKeystoreKey(type == KEYSTORE_BOOKSTRAP_TOKEN
Nicolas Zea 2012/09/17 21:00:24 Can't, that will set the boolean to false if the n
}
void SyncManagerImpl::OnEncryptedTypesChanged(ModelTypeSet encrypted_types,
@@ -550,10 +563,16 @@ void SyncManagerImpl::OnCryptographerStateChanged(
Cryptographer* cryptographer) {
allstatus_.SetCryptographerReady(cryptographer->is_ready());
allstatus_.SetCryptoHasPendingKeys(cryptographer->has_pending_keys());
+ allstatus_.SetKeystoreMigrationTime(
+ GetKeystoreMigrationTimeStr(
+ sync_encryption_handler_->GetKeystoreMigrationTime()));
}
void SyncManagerImpl::OnPassphraseTypeChanged(PassphraseType type) {
- // Does nothing.
+ allstatus_.SetPassphraseType(PassphraseTypeToString(type));
+ allstatus_.SetKeystoreMigrationTime(
+ GetKeystoreMigrationTimeStr(
+ sync_encryption_handler_->GetKeystoreMigrationTime()));
}
void SyncManagerImpl::StartSyncingNormally(

Powered by Google App Engine
This is Rietveld 408576698