| 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/themes/theme_syncable_service.h" | 5 #include "chrome/browser/themes/theme_syncable_service.h" |
| 6 | 6 |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 syncer::SyncDataList ThemeSyncableService::GetAllSyncData( | 109 syncer::SyncDataList ThemeSyncableService::GetAllSyncData( |
| 110 syncer::ModelType type) const { | 110 syncer::ModelType type) const { |
| 111 DCHECK(thread_checker_.CalledOnValidThread()); | 111 DCHECK(thread_checker_.CalledOnValidThread()); |
| 112 DCHECK_EQ(type, syncer::THEMES); | 112 DCHECK_EQ(type, syncer::THEMES); |
| 113 | 113 |
| 114 syncer::SyncDataList list; | 114 syncer::SyncDataList list; |
| 115 sync_pb::EntitySpecifics entity_specifics; | 115 sync_pb::EntitySpecifics entity_specifics; |
| 116 GetThemeSpecificsFromCurrentTheme(entity_specifics.mutable_theme()); | 116 GetThemeSpecificsFromCurrentTheme(entity_specifics.mutable_theme()); |
| 117 list.push_back(syncer::SyncData::CreateLocalData(kCurrentThemeClientTag, | 117 list.push_back(syncer::SyncData::CreateLocalData(kCurrentThemeClientTag, |
| 118 kCurrentThemeNodeTitle, | 118 kCurrentThemeNodeTitle, |
| 119 entity_specifics)); | 119 entity_specifics, false)); |
| 120 return list; | 120 return list; |
| 121 } | 121 } |
| 122 | 122 |
| 123 syncer::SyncError ThemeSyncableService::ProcessSyncChanges( | 123 syncer::SyncError ThemeSyncableService::ProcessSyncChanges( |
| 124 const tracked_objects::Location& from_here, | 124 const tracked_objects::Location& from_here, |
| 125 const syncer::SyncChangeList& change_list) { | 125 const syncer::SyncChangeList& change_list) { |
| 126 DCHECK(thread_checker_.CalledOnValidThread()); | 126 DCHECK(thread_checker_.CalledOnValidThread()); |
| 127 | 127 |
| 128 if (!sync_processor_.get()) { | 128 if (!sync_processor_.get()) { |
| 129 return syncer::SyncError(FROM_HERE, | 129 return syncer::SyncError(FROM_HERE, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 syncer::SyncChange::SyncChangeType change_type, | 305 syncer::SyncChange::SyncChangeType change_type, |
| 306 const sync_pb::ThemeSpecifics& theme_specifics) { | 306 const sync_pb::ThemeSpecifics& theme_specifics) { |
| 307 syncer::SyncChangeList changes; | 307 syncer::SyncChangeList changes; |
| 308 sync_pb::EntitySpecifics entity_specifics; | 308 sync_pb::EntitySpecifics entity_specifics; |
| 309 entity_specifics.mutable_theme()->CopyFrom(theme_specifics); | 309 entity_specifics.mutable_theme()->CopyFrom(theme_specifics); |
| 310 | 310 |
| 311 changes.push_back( | 311 changes.push_back( |
| 312 syncer::SyncChange(FROM_HERE, change_type, | 312 syncer::SyncChange(FROM_HERE, change_type, |
| 313 syncer::SyncData::CreateLocalData( | 313 syncer::SyncData::CreateLocalData( |
| 314 kCurrentThemeClientTag, kCurrentThemeNodeTitle, | 314 kCurrentThemeClientTag, kCurrentThemeNodeTitle, |
| 315 entity_specifics))); | 315 entity_specifics, false))); |
| 316 | 316 |
| 317 DVLOG(1) << "Update theme specifics from current theme: " | 317 DVLOG(1) << "Update theme specifics from current theme: " |
| 318 << changes.back().ToString(); | 318 << changes.back().ToString(); |
| 319 | 319 |
| 320 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 320 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
| 321 } | 321 } |
| OLD | NEW |