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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 DCHECK(sync_processor.get()); | 69 DCHECK(sync_processor.get()); |
70 DCHECK(error_handler.get()); | 70 DCHECK(error_handler.get()); |
71 | 71 |
72 syncer::SyncMergeResult merge_result(type); | 72 syncer::SyncMergeResult merge_result(type); |
73 sync_processor_ = sync_processor.Pass(); | 73 sync_processor_ = sync_processor.Pass(); |
74 sync_error_handler_ = error_handler.Pass(); | 74 sync_error_handler_ = error_handler.Pass(); |
75 | 75 |
76 if (initial_sync_data.size() > 1) { | 76 if (initial_sync_data.size() > 1) { |
77 sync_error_handler_->CreateAndUploadError( | 77 sync_error_handler_->CreateAndUploadError( |
78 FROM_HERE, | 78 FROM_HERE, |
79 StringPrintf("Received %d theme specifics.", | 79 base::StringPrintf("Received %d theme specifics.", |
80 static_cast<int>(initial_sync_data.size()))); | 80 static_cast<int>(initial_sync_data.size()))); |
81 } | 81 } |
82 | 82 |
83 sync_pb::ThemeSpecifics current_specifics; | 83 sync_pb::ThemeSpecifics current_specifics; |
84 if (!GetThemeSpecificsFromCurrentTheme(¤t_specifics)) { | 84 if (!GetThemeSpecificsFromCurrentTheme(¤t_specifics)) { |
85 // Current theme is unsyncable - don't overwrite from sync data, and don't | 85 // Current theme is unsyncable - don't overwrite from sync data, and don't |
86 // save the unsyncable theme to sync data. | 86 // save the unsyncable theme to sync data. |
87 return merge_result; | 87 return merge_result; |
88 } | 88 } |
89 | 89 |
90 // Find the last SyncData that has theme data and set the current theme from | 90 // Find the last SyncData that has theme data and set the current theme from |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 syncer::SyncChange(FROM_HERE, change_type, | 328 syncer::SyncChange(FROM_HERE, change_type, |
329 syncer::SyncData::CreateLocalData( | 329 syncer::SyncData::CreateLocalData( |
330 kCurrentThemeClientTag, kCurrentThemeNodeTitle, | 330 kCurrentThemeClientTag, kCurrentThemeNodeTitle, |
331 entity_specifics))); | 331 entity_specifics))); |
332 | 332 |
333 DVLOG(1) << "Update theme specifics from current theme: " | 333 DVLOG(1) << "Update theme specifics from current theme: " |
334 << changes.back().ToString(); | 334 << changes.back().ToString(); |
335 | 335 |
336 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 336 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
337 } | 337 } |
OLD | NEW |