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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // Only automatically turn on types if we have already finished set up. | 951 // Only automatically turn on types if we have already finished set up. |
952 // Otherwise, just leave the experimental types on by default. | 952 // Otherwise, just leave the experimental types on by default. |
953 if (!to_register.Empty() && HasSyncSetupCompleted() && migrator_.get()) { | 953 if (!to_register.Empty() && HasSyncSetupCompleted() && migrator_.get()) { |
954 DVLOG(1) << "Dynamically enabling new datatypes: " | 954 DVLOG(1) << "Dynamically enabling new datatypes: " |
955 << syncer::ModelTypeSetToString(to_register); | 955 << syncer::ModelTypeSetToString(to_register); |
956 OnMigrationNeededForTypes(to_register); | 956 OnMigrationNeededForTypes(to_register); |
957 } | 957 } |
958 } | 958 } |
959 | 959 |
960 // Now enable any non-datatype features. | 960 // Now enable any non-datatype features. |
961 if (experiments.sync_tab_favicons) { | |
962 DVLOG(1) << "Enabling syncing of tab favicons."; | |
963 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | |
964 "sync-tab-favicons", | |
965 true); | |
966 #if defined(OS_ANDROID) | |
967 // Android does not support about:flags and experiments, so we need to force | |
968 // setting the experiments as command line switches. | |
969 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kSyncTabFavicons); | |
970 #endif | |
971 } | |
972 | |
973 if (experiments.keystore_encryption) { | 961 if (experiments.keystore_encryption) { |
974 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | 962 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
975 syncer::kKeystoreEncryptionFlag, | 963 syncer::kKeystoreEncryptionFlag, |
976 true); | 964 true); |
977 } | 965 } |
978 | 966 |
979 if (experiments.full_history_sync) { | 967 if (experiments.full_history_sync) { |
980 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | 968 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
981 syncer::kFullHistorySyncFlag, | 969 syncer::kFullHistorySyncFlag, |
982 true); | 970 true); |
983 } | 971 } |
984 | 972 |
| 973 if (experiments.favicon_sync) { |
| 974 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
| 975 syncer::kFaviconSyncFlag, |
| 976 true); |
| 977 } |
| 978 |
985 current_experiments_ = experiments; | 979 current_experiments_ = experiments; |
986 } | 980 } |
987 | 981 |
988 void ProfileSyncService::UpdateAuthErrorState(const AuthError& error) { | 982 void ProfileSyncService::UpdateAuthErrorState(const AuthError& error) { |
989 is_auth_in_progress_ = false; | 983 is_auth_in_progress_ = false; |
990 last_auth_error_ = error; | 984 last_auth_error_ = error; |
991 | 985 |
992 // Fan the notification out to interested UI-thread components. Notify the | 986 // Fan the notification out to interested UI-thread components. Notify the |
993 // SigninGlobalError first so it reflects the latest auth state before we | 987 // SigninGlobalError first so it reflects the latest auth state before we |
994 // notify observers. | 988 // notify observers. |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 2014 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
2021 ProfileSyncService* old_this = this; | 2015 ProfileSyncService* old_this = this; |
2022 this->~ProfileSyncService(); | 2016 this->~ProfileSyncService(); |
2023 new(old_this) ProfileSyncService( | 2017 new(old_this) ProfileSyncService( |
2024 new ProfileSyncComponentsFactoryImpl(profile, | 2018 new ProfileSyncComponentsFactoryImpl(profile, |
2025 CommandLine::ForCurrentProcess()), | 2019 CommandLine::ForCurrentProcess()), |
2026 profile, | 2020 profile, |
2027 signin, | 2021 signin, |
2028 behavior); | 2022 behavior); |
2029 } | 2023 } |
OLD | NEW |