| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/settings/syncable_settings_storage.h" | 5 #include "chrome/browser/extensions/settings/syncable_settings_storage.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/extensions/settings/settings_namespace.h" | 8 #include "chrome/browser/extensions/settings/settings_namespace.h" |
| 9 #include "chrome/browser/extensions/settings/settings_sync_processor.h" | 9 #include "chrome/browser/extensions/settings/settings_sync_processor.h" |
| 10 #include "chrome/browser/extensions/settings/settings_sync_util.h" | 10 #include "chrome/browser/extensions/settings/settings_sync_util.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 syncer::SyncError SyncableSettingsStorage::ProcessSyncChanges( | 234 syncer::SyncError SyncableSettingsStorage::ProcessSyncChanges( |
| 235 const SettingSyncDataList& sync_changes) { | 235 const SettingSyncDataList& sync_changes) { |
| 236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 237 DCHECK(!sync_changes.empty()) << "No sync changes for " << extension_id_; | 237 DCHECK(!sync_changes.empty()) << "No sync changes for " << extension_id_; |
| 238 | 238 |
| 239 if (!sync_processor_.get()) { | 239 if (!sync_processor_.get()) { |
| 240 return syncer::SyncError( | 240 return syncer::SyncError( |
| 241 FROM_HERE, | 241 FROM_HERE, |
| 242 std::string("Sync is inactive for ") + extension_id_, | 242 std::string("Sync is inactive for ") + extension_id_, |
| 243 syncable::UNSPECIFIED); | 243 syncer::UNSPECIFIED); |
| 244 } | 244 } |
| 245 | 245 |
| 246 std::vector<syncer::SyncError> errors; | 246 std::vector<syncer::SyncError> errors; |
| 247 ValueStoreChangeList changes; | 247 ValueStoreChangeList changes; |
| 248 | 248 |
| 249 for (SettingSyncDataList::const_iterator it = sync_changes.begin(); | 249 for (SettingSyncDataList::const_iterator it = sync_changes.begin(); |
| 250 it != sync_changes.end(); ++it) { | 250 it != sync_changes.end(); ++it) { |
| 251 DCHECK_EQ(extension_id_, it->extension_id()); | 251 DCHECK_EQ(extension_id_, it->extension_id()); |
| 252 | 252 |
| 253 const std::string& key = it->key(); | 253 const std::string& key = it->key(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 FROM_HERE, | 376 FROM_HERE, |
| 377 std::string("Error pushing sync remove to local settings: ") + | 377 std::string("Error pushing sync remove to local settings: ") + |
| 378 result->error(), | 378 result->error(), |
| 379 sync_processor_->type()); | 379 sync_processor_->type()); |
| 380 } | 380 } |
| 381 changes->push_back(ValueStoreChange(key, old_value, NULL)); | 381 changes->push_back(ValueStoreChange(key, old_value, NULL)); |
| 382 return syncer::SyncError(); | 382 return syncer::SyncError(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace extensions | 385 } // namespace extensions |
| OLD | NEW |