| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
| 27 #include "base/threading/thread_restrictions.h" | 27 #include "base/threading/thread_restrictions.h" |
| 28 #include "base/threading/thread_task_runner_handle.h" | 28 #include "base/threading/thread_task_runner_handle.h" |
| 29 #include "components/autofill/core/common/autofill_pref_names.h" | 29 #include "components/autofill/core/common/autofill_pref_names.h" |
| 30 #include "components/browser_sync/browser_sync_switches.h" | 30 #include "components/browser_sync/browser_sync_switches.h" |
| 31 #include "components/history/core/browser/typed_url_data_type_controller.h" | 31 #include "components/history/core/browser/typed_url_data_type_controller.h" |
| 32 #include "components/invalidation/impl/invalidation_prefs.h" | 32 #include "components/invalidation/impl/invalidation_prefs.h" |
| 33 #include "components/invalidation/public/invalidation_service.h" | 33 #include "components/invalidation/public/invalidation_service.h" |
| 34 #include "components/pref_registry/pref_registry_syncable.h" | 34 #include "components/pref_registry/pref_registry_syncable.h" |
| 35 #include "components/prefs/json_pref_store.h" | 35 #include "components/prefs/json_pref_store.h" |
| 36 #include "components/reading_list/core/reading_list_enable_flags.h" |
| 36 #include "components/signin/core/browser/about_signin_internals.h" | 37 #include "components/signin/core/browser/about_signin_internals.h" |
| 37 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 38 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 38 #include "components/signin/core/browser/signin_manager.h" | 39 #include "components/signin/core/browser/signin_manager.h" |
| 39 #include "components/signin/core/browser/signin_metrics.h" | 40 #include "components/signin/core/browser/signin_metrics.h" |
| 40 #include "components/strings/grit/components_strings.h" | 41 #include "components/strings/grit/components_strings.h" |
| 41 #include "components/sync/base/bind_to_task_runner.h" | 42 #include "components/sync/base/bind_to_task_runner.h" |
| 42 #include "components/sync/base/cryptographer.h" | 43 #include "components/sync/base/cryptographer.h" |
| 43 #include "components/sync/base/passphrase_type.h" | 44 #include "components/sync/base/passphrase_type.h" |
| 44 #include "components/sync/base/pref_names.h" | 45 #include "components/sync/base/pref_names.h" |
| 45 #include "components/sync/base/report_unrecoverable_error.h" | 46 #include "components/sync/base/report_unrecoverable_error.h" |
| (...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 if (!IsFirstSetupComplete() || | 1681 if (!IsFirstSetupComplete() || |
| 1681 sync_everything != sync_prefs_.HasKeepEverythingSynced()) { | 1682 sync_everything != sync_prefs_.HasKeepEverythingSynced()) { |
| 1682 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); | 1683 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); |
| 1683 } | 1684 } |
| 1684 | 1685 |
| 1685 // Only log the data types that are shown in the sync settings ui. | 1686 // Only log the data types that are shown in the sync settings ui. |
| 1686 // Note: the order of these types must match the ordering of | 1687 // Note: the order of these types must match the ordering of |
| 1687 // the respective types in ModelType | 1688 // the respective types in ModelType |
| 1688 const syncer::user_selectable_type::UserSelectableSyncType | 1689 const syncer::user_selectable_type::UserSelectableSyncType |
| 1689 user_selectable_types[] = { | 1690 user_selectable_types[] = { |
| 1690 syncer::user_selectable_type::BOOKMARKS, | 1691 syncer::user_selectable_type::BOOKMARKS, |
| 1691 syncer::user_selectable_type::PREFERENCES, | 1692 syncer::user_selectable_type::PREFERENCES, |
| 1692 syncer::user_selectable_type::PASSWORDS, | 1693 syncer::user_selectable_type::PASSWORDS, |
| 1693 syncer::user_selectable_type::AUTOFILL, | 1694 syncer::user_selectable_type::AUTOFILL, |
| 1694 syncer::user_selectable_type::THEMES, | 1695 syncer::user_selectable_type::THEMES, |
| 1695 syncer::user_selectable_type::TYPED_URLS, | 1696 syncer::user_selectable_type::TYPED_URLS, |
| 1696 syncer::user_selectable_type::EXTENSIONS, | 1697 syncer::user_selectable_type::EXTENSIONS, |
| 1697 syncer::user_selectable_type::APPS, | 1698 syncer::user_selectable_type::APPS, |
| 1698 syncer::user_selectable_type::PROXY_TABS, | 1699 #if BUILDFLAG(ENABLE_READING_LIST) |
| 1700 syncer::user_selectable_type::READING_LIST, |
| 1701 #endif |
| 1702 syncer::user_selectable_type::PROXY_TABS, |
| 1699 }; | 1703 }; |
| 1700 | 1704 |
| 1701 static_assert(39 == syncer::MODEL_TYPE_COUNT, | 1705 static_assert(39 == syncer::MODEL_TYPE_COUNT, |
| 1702 "custom config histogram must be updated"); | 1706 "custom config histogram must be updated"); |
| 1703 | 1707 |
| 1704 if (!sync_everything) { | 1708 if (!sync_everything) { |
| 1705 const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); | 1709 const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); |
| 1706 | 1710 |
| 1707 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); | 1711 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); |
| 1708 syncer::ModelTypeSet::Iterator it = type_set.First(); | 1712 syncer::ModelTypeSet::Iterator it = type_set.First(); |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2675 | 2679 |
| 2676 DCHECK(startup_controller_->IsSetupInProgress()); | 2680 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2677 startup_controller_->SetSetupInProgress(false); | 2681 startup_controller_->SetSetupInProgress(false); |
| 2678 | 2682 |
| 2679 if (IsEngineInitialized()) | 2683 if (IsEngineInitialized()) |
| 2680 ReconfigureDatatypeManager(); | 2684 ReconfigureDatatypeManager(); |
| 2681 NotifyObservers(); | 2685 NotifyObservers(); |
| 2682 } | 2686 } |
| 2683 | 2687 |
| 2684 } // namespace browser_sync | 2688 } // namespace browser_sync |
| OLD | NEW |