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