| 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_util.h" | 9 #include "chrome/browser/extensions/settings/settings_sync_util.h" |
| 10 #include "chrome/browser/sync/api/sync_data.h" | 10 #include "chrome/browser/sync/api/sync_data.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 SyncError SyncableSettingsStorage::StartSyncing( | 134 SyncError SyncableSettingsStorage::StartSyncing( |
| 135 syncable::ModelType type, | 135 syncable::ModelType type, |
| 136 const DictionaryValue& sync_state, | 136 const DictionaryValue& sync_state, |
| 137 SyncChangeProcessor* sync_processor) { | 137 SyncChangeProcessor* sync_processor) { |
| 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 139 DCHECK(type == syncable::EXTENSION_SETTINGS || | 139 DCHECK(type == syncable::EXTENSION_SETTINGS || |
| 140 type == syncable::APP_SETTINGS); | 140 type == syncable::APP_SETTINGS); |
| 141 DCHECK_EQ(sync_type_, syncable::UNSPECIFIED); | 141 DCHECK_EQ(sync_type_, syncable::UNSPECIFIED); |
| 142 DCHECK(!sync_processor_); | 142 DCHECK(!sync_processor_); |
| 143 DCHECK(sync_processor); |
| 143 DCHECK(synced_keys_.empty()); | 144 DCHECK(synced_keys_.empty()); |
| 144 | 145 |
| 145 sync_type_ = type; | 146 sync_type_ = type; |
| 146 sync_processor_ = sync_processor; | 147 sync_processor_ = sync_processor; |
| 147 | 148 |
| 148 ReadResult maybe_settings = delegate_->Get(); | 149 ReadResult maybe_settings = delegate_->Get(); |
| 149 if (maybe_settings.HasError()) { | 150 if (maybe_settings.HasError()) { |
| 150 return SyncError( | 151 return SyncError( |
| 151 FROM_HERE, | 152 FROM_HERE, |
| 152 std::string("Failed to get settings: ") + maybe_settings.error(), | 153 std::string("Failed to get settings: ") + maybe_settings.error(), |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 FROM_HERE, | 453 FROM_HERE, |
| 453 std::string("Error pushing sync remove to local settings: ") + | 454 std::string("Error pushing sync remove to local settings: ") + |
| 454 result.error(), | 455 result.error(), |
| 455 sync_type_); | 456 sync_type_); |
| 456 } | 457 } |
| 457 changes->push_back(SettingChange(key, old_value, NULL)); | 458 changes->push_back(SettingChange(key, old_value, NULL)); |
| 458 return SyncError(); | 459 return SyncError(); |
| 459 } | 460 } |
| 460 | 461 |
| 461 } // namespace extensions | 462 } // namespace extensions |
| OLD | NEW |