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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 2828021: Take 2: sync changes to support encryption (Closed)
Patch Set: fix flaky password test under valgrind Created 10 years, 6 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
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index d765273e16a0bbcf8f369438714f8034fb58df22..0c36f3d78bda2b461c15232f179baed0c7ab70ec 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -101,6 +101,7 @@ void SyncBackendHost::Initialize(
it != types.end(); ++it) {
registrar_.routing_info[(*it)] = GROUP_PASSIVE;
}
+ registrar_.routing_info[syncable::NIGORI] = GROUP_PASSIVE;
core_thread_.message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoInitialize,
@@ -129,6 +130,12 @@ void SyncBackendHost::StartSyncing() {
NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoStartSyncing));
}
+void SyncBackendHost::SetPassphrase(const std::string& passphrase) {
+ core_thread_.message_loop()->PostTask(FROM_HERE,
+ NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoSetPassphrase,
+ passphrase));
+}
+
void SyncBackendHost::Shutdown(bool sync_disabled) {
// Thread shutdown should occur in the following order:
// - SyncerThread
@@ -275,6 +282,20 @@ void SyncBackendHost::Core::NotifyResumed() {
NotificationService::NoDetails());
}
+void SyncBackendHost::Core::NotifyPassphraseRequired() {
+ NotificationService::current()->Notify(
+ NotificationType::SYNC_PASSPHRASE_REQUIRED,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
+}
+
+void SyncBackendHost::Core::NotifyPassphraseAccepted() {
+ NotificationService::current()->Notify(
+ NotificationType::SYNC_PASSPHRASE_ACCEPTED,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
+}
+
SyncBackendHost::UserShareHandle SyncBackendHost::GetUserShareHandle() const {
return core_->syncapi()->GetUserShare();
}
@@ -400,6 +421,11 @@ void SyncBackendHost::Core::DoStartSyncing() {
syncapi_->StartSyncing();
}
+void SyncBackendHost::Core::DoSetPassphrase(const std::string& passphrase) {
+ DCHECK(MessageLoop::current() == host_->core_thread_.message_loop());
+ syncapi_->SetPassphrase(passphrase);
+}
+
UIModelWorker* SyncBackendHost::ui_worker() {
ModelSafeWorker* w = registrar_.workers[GROUP_UI];
if (w == NULL)
@@ -543,6 +569,16 @@ void SyncBackendHost::Core::OnAuthError(const AuthError& auth_error) {
auth_error));
}
+void SyncBackendHost::Core::OnPassphraseRequired() {
+ host_->frontend_loop_->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &Core::NotifyPassphraseRequired));
+}
+
+void SyncBackendHost::Core::OnPassphraseAccepted() {
+ host_->frontend_loop_->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &Core::NotifyPassphraseAccepted));
+}
+
void SyncBackendHost::Core::OnPaused() {
host_->frontend_loop_->PostTask(
FROM_HERE,
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698