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

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

Issue 6537027: Revert 75287 - [Sync] Initial support for encrypting any datatype (no UI hook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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/js_sync_manager_observer.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
===================================================================
--- chrome/browser/sync/glue/sync_backend_host.cc (revision 75295)
+++ chrome/browser/sync/glue/sync_backend_host.cc (working copy)
@@ -30,7 +30,6 @@
// TODO(tim): Remove this! We should have a syncapi pass-thru instead.
#include "chrome/browser/sync/syncable/directory_manager.h" // Cryptographer.
#include "chrome/browser/sync/syncable/model_type.h"
-#include "chrome/browser/sync/syncable/nigori_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/net/gaia/gaia_constants.h"
@@ -126,13 +125,17 @@
registrar_.workers[GROUP_PASSWORD] =
new PasswordModelWorker(password_store);
} else {
- LOG_IF(WARNING, types.count(syncable::PASSWORDS) > 0) << "Password store "
- << "not initialized, cannot sync passwords";
+ LOG(WARNING) << "Password store not initialized, cannot sync passwords";
registrar_.routing_info.erase(syncable::PASSWORDS);
}
- // Nigori is populated by default now.
- registrar_.routing_info[syncable::NIGORI] = GROUP_PASSIVE;
+ // TODO(tim): Remove this special case once NIGORI is populated by
+ // default. We piggy back off of the passwords flag for now to not
+ // require both encryption and passwords flags.
+ bool enable_encryption = !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableSyncPasswords) || types.count(syncable::PASSWORDS);
+ if (enable_encryption)
+ registrar_.routing_info[syncable::NIGORI] = GROUP_PASSIVE;
InitCore(Core::DoInitializeOptions(
sync_service_url,
@@ -404,14 +407,6 @@
}
}
-void SyncBackendHost::EncryptDataTypes(
- const syncable::ModelTypeSet& encrypted_types) {
- core_thread_.message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(core_.get(),
- &SyncBackendHost::Core::DoEncryptDataTypes,
- encrypted_types));
-}
-
void SyncBackendHost::RequestNudge() {
core_thread_.message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoRequestNudge));
@@ -516,14 +511,6 @@
Details<const TokenAvailableDetails>(&details));
}
-void SyncBackendHost::Core::NotifyEncryptionComplete(
- const syncable::ModelTypeSet& encrypted_types) {
- if (!host_)
- return;
- DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_);
- host_->frontend_->OnEncryptionComplete(encrypted_types);
-}
-
SyncBackendHost::Core::DoInitializeOptions::DoInitializeOptions(
const GURL& service_url,
sync_api::HttpPostProviderFactory* http_bridge_factory,
@@ -682,12 +669,6 @@
syncapi_->SetPassphrase(passphrase, is_explicit);
}
-void SyncBackendHost::Core::DoEncryptDataTypes(
- const syncable::ModelTypeSet& encrypted_types) {
- DCHECK(MessageLoop::current() == host_->core_thread_.message_loop());
- syncapi_->EncryptDataTypes(encrypted_types);
-}
-
UIModelWorker* SyncBackendHost::ui_worker() {
ModelSafeWorker* w = registrar_.workers[GROUP_UI];
if (w == NULL)
@@ -907,14 +888,6 @@
&Core::HandleClearServerDataFailedOnFrontendLoop));
}
-void SyncBackendHost::Core::OnEncryptionComplete(
- const syncable::ModelTypeSet& encrypted_types) {
- host_->frontend_loop_->PostTask(
- FROM_HERE,
- NewRunnableMethod(this, &Core::NotifyEncryptionComplete,
- encrypted_types));
-}
-
void SyncBackendHost::Core::RouteJsEvent(
const std::string& name, const JsArgList& args,
const JsEventHandler* target) {
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/js_sync_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698