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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 Difference(to_add, registered_types); | 730 Difference(to_add, registered_types); |
731 DVLOG(2) << "OnExperimentsChanged called with types: " | 731 DVLOG(2) << "OnExperimentsChanged called with types: " |
732 << syncable::ModelTypeSetToString(to_add); | 732 << syncable::ModelTypeSetToString(to_add); |
733 DVLOG(2) << "Enabling types: " << syncable::ModelTypeSetToString(to_register); | 733 DVLOG(2) << "Enabling types: " << syncable::ModelTypeSetToString(to_register); |
734 | 734 |
735 for (syncable::ModelTypeSet::Iterator it = to_register.First(); | 735 for (syncable::ModelTypeSet::Iterator it = to_register.First(); |
736 it.Good(); it.Inc()) { | 736 it.Good(); it.Inc()) { |
737 // Received notice to enable experimental type. Check if the type is | 737 // Received notice to enable experimental type. Check if the type is |
738 // registered, and if not register a new datatype controller. | 738 // registered, and if not register a new datatype controller. |
739 RegisterNewDataType(it.Get()); | 739 RegisterNewDataType(it.Get()); |
740 #if !defined(OS_ANDROID) | |
741 // Enable the about:flags switch for the experimental type so we don't have | 740 // Enable the about:flags switch for the experimental type so we don't have |
742 // to always perform this reconfiguration. Once we set this, the type will | 741 // to always perform this reconfiguration. Once we set this, the type will |
743 // remain registered on restart, so we will no longer go down this code | 742 // remain registered on restart, so we will no longer go down this code |
744 // path. | 743 // path. |
745 std::string experiment_name = GetExperimentNameForDataType(it.Get()); | 744 std::string experiment_name = GetExperimentNameForDataType(it.Get()); |
746 if (experiment_name.empty()) | 745 if (experiment_name.empty()) |
747 continue; | 746 continue; |
748 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | 747 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
749 experiment_name, | 748 experiment_name, |
750 true); | 749 true); |
751 #endif // !defined(OS_ANDROID) | |
752 } | 750 } |
753 | 751 |
754 // Check if the user has "Keep Everything Synced" enabled. If so, we want | 752 // Check if the user has "Keep Everything Synced" enabled. If so, we want |
755 // to turn on all experimental types if they're not already on. Otherwise we | 753 // to turn on all experimental types if they're not already on. Otherwise we |
756 // leave them off. | 754 // leave them off. |
757 // Note: if any types are already registered, we don't turn them on. This | 755 // Note: if any types are already registered, we don't turn them on. This |
758 // covers the case where we're already in the process of reconfiguring | 756 // covers the case where we're already in the process of reconfiguring |
759 // to turn an experimental type on. | 757 // to turn an experimental type on. |
760 if (sync_prefs_.HasKeepEverythingSynced()) { | 758 if (sync_prefs_.HasKeepEverythingSynced()) { |
761 // Mark all data types as preferred. | 759 // Mark all data types as preferred. |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1721 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
1724 ProfileSyncService* old_this = this; | 1722 ProfileSyncService* old_this = this; |
1725 this->~ProfileSyncService(); | 1723 this->~ProfileSyncService(); |
1726 new(old_this) ProfileSyncService( | 1724 new(old_this) ProfileSyncService( |
1727 new ProfileSyncComponentsFactoryImpl(profile, | 1725 new ProfileSyncComponentsFactoryImpl(profile, |
1728 CommandLine::ForCurrentProcess()), | 1726 CommandLine::ForCurrentProcess()), |
1729 profile, | 1727 profile, |
1730 signin, | 1728 signin, |
1731 behavior); | 1729 behavior); |
1732 } | 1730 } |
OLD | NEW |