| 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/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 // Only log the data types that are shown in the sync settings ui. | 1283 // Only log the data types that are shown in the sync settings ui. |
| 1284 const syncer::ModelType model_types[] = { | 1284 const syncer::ModelType model_types[] = { |
| 1285 syncer::APPS, | 1285 syncer::APPS, |
| 1286 syncer::AUTOFILL, | 1286 syncer::AUTOFILL, |
| 1287 syncer::BOOKMARKS, | 1287 syncer::BOOKMARKS, |
| 1288 syncer::EXTENSIONS, | 1288 syncer::EXTENSIONS, |
| 1289 syncer::PASSWORDS, | 1289 syncer::PASSWORDS, |
| 1290 syncer::PREFERENCES, | 1290 syncer::PREFERENCES, |
| 1291 syncer::PUSH_NOTIFICATIONS, |
| 1291 syncer::SESSIONS, | 1292 syncer::SESSIONS, |
| 1292 syncer::THEMES, | 1293 syncer::THEMES, |
| 1293 syncer::TYPED_URLS | 1294 syncer::TYPED_URLS |
| 1294 }; | 1295 }; |
| 1295 | 1296 |
| 1296 const browser_sync::user_selectable_type::UserSelectableSyncType | 1297 const browser_sync::user_selectable_type::UserSelectableSyncType |
| 1297 user_selectable_types[] = { | 1298 user_selectable_types[] = { |
| 1298 browser_sync::user_selectable_type::APPS, | 1299 browser_sync::user_selectable_type::APPS, |
| 1299 browser_sync::user_selectable_type::AUTOFILL, | 1300 browser_sync::user_selectable_type::AUTOFILL, |
| 1300 browser_sync::user_selectable_type::BOOKMARKS, | 1301 browser_sync::user_selectable_type::BOOKMARKS, |
| 1301 browser_sync::user_selectable_type::EXTENSIONS, | 1302 browser_sync::user_selectable_type::EXTENSIONS, |
| 1302 browser_sync::user_selectable_type::PASSWORDS, | 1303 browser_sync::user_selectable_type::PASSWORDS, |
| 1303 browser_sync::user_selectable_type::PREFERENCES, | 1304 browser_sync::user_selectable_type::PREFERENCES, |
| 1305 browser_sync::user_selectable_type::PUSH_NOTIFICATIONS, |
| 1304 browser_sync::user_selectable_type::SESSIONS, | 1306 browser_sync::user_selectable_type::SESSIONS, |
| 1305 browser_sync::user_selectable_type::THEMES, | 1307 browser_sync::user_selectable_type::THEMES, |
| 1306 browser_sync::user_selectable_type::TYPED_URLS | 1308 browser_sync::user_selectable_type::TYPED_URLS |
| 1307 }; | 1309 }; |
| 1308 | 1310 |
| 1309 COMPILE_ASSERT(20 == syncer::MODEL_TYPE_COUNT, UpdateCustomConfigHistogram); | 1311 COMPILE_ASSERT(21 == syncer::MODEL_TYPE_COUNT, UpdateCustomConfigHistogram); |
| 1310 COMPILE_ASSERT(arraysize(model_types) == | 1312 COMPILE_ASSERT(arraysize(model_types) == |
| 1311 browser_sync::user_selectable_type::SELECTABLE_DATATYPE_COUNT, | 1313 browser_sync::user_selectable_type::SELECTABLE_DATATYPE_COUNT, |
| 1312 UpdateCustomConfigHistogram); | 1314 UpdateCustomConfigHistogram); |
| 1313 COMPILE_ASSERT(arraysize(model_types) == arraysize(user_selectable_types), | 1315 COMPILE_ASSERT(arraysize(model_types) == arraysize(user_selectable_types), |
| 1314 UpdateCustomConfigHistogram); | 1316 UpdateCustomConfigHistogram); |
| 1315 | 1317 |
| 1316 if (!sync_everything) { | 1318 if (!sync_everything) { |
| 1317 const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); | 1319 const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); |
| 1318 for (size_t i = 0; i < arraysize(model_types); ++i) { | 1320 for (size_t i = 0; i < arraysize(model_types); ++i) { |
| 1319 const syncer::ModelType type = model_types[i]; | 1321 const syncer::ModelType type = model_types[i]; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1908 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
| 1907 ProfileSyncService* old_this = this; | 1909 ProfileSyncService* old_this = this; |
| 1908 this->~ProfileSyncService(); | 1910 this->~ProfileSyncService(); |
| 1909 new(old_this) ProfileSyncService( | 1911 new(old_this) ProfileSyncService( |
| 1910 new ProfileSyncComponentsFactoryImpl(profile, | 1912 new ProfileSyncComponentsFactoryImpl(profile, |
| 1911 CommandLine::ForCurrentProcess()), | 1913 CommandLine::ForCurrentProcess()), |
| 1912 profile, | 1914 profile, |
| 1913 signin, | 1915 signin, |
| 1914 behavior); | 1916 behavior); |
| 1915 } | 1917 } |
| OLD | NEW |