Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 1304933010: [Sync] Move data type logic from PSSA to PSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 9 #include <vector>
10 10
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 #endif 1805 #endif
1806 1806
1807 void ProfileSyncService::OnUserChoseDatatypes( 1807 void ProfileSyncService::OnUserChoseDatatypes(
1808 bool sync_everything, 1808 bool sync_everything,
1809 syncer::ModelTypeSet chosen_types) { 1809 syncer::ModelTypeSet chosen_types) {
1810 if (!backend_.get() && !HasUnrecoverableError()) { 1810 if (!backend_.get() && !HasUnrecoverableError()) {
1811 NOTREACHED(); 1811 NOTREACHED();
1812 return; 1812 return;
1813 } 1813 }
1814 1814
1815 chosen_types.RetainAll(syncer::UserSelectableTypes());
Nicolas Zea 2015/09/16 21:30:25 Should this be a DCHECK I wonder? If not, it would
maxbogue 2015/09/18 23:47:52 I tried converting to a DCHECK and there were lots
1816
1815 UpdateSelectedTypesHistogram(sync_everything, chosen_types); 1817 UpdateSelectedTypesHistogram(sync_everything, chosen_types);
1816 sync_prefs_.SetKeepEverythingSynced(sync_everything); 1818 sync_prefs_.SetKeepEverythingSynced(sync_everything);
1817 1819
1818 if (data_type_manager_) 1820 if (data_type_manager_)
1819 data_type_manager_->ResetDataTypeErrors(); 1821 data_type_manager_->ResetDataTypeErrors();
1820 ChangePreferredDataTypes(chosen_types); 1822 ChangePreferredDataTypes(chosen_types);
1821 } 1823 }
1822 1824
1823 void ProfileSyncService::ChangePreferredDataTypes( 1825 void ProfileSyncService::ChangePreferredDataTypes(
1824 syncer::ModelTypeSet preferred_types) { 1826 syncer::ModelTypeSet preferred_types) {
(...skipping 12 matching lines...) Expand all
1837 return syncer::ModelTypeSet(); 1839 return syncer::ModelTypeSet();
1838 const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes(); 1840 const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes();
1839 const syncer::ModelTypeSet failed_types = 1841 const syncer::ModelTypeSet failed_types =
1840 data_type_status_table_.GetFailedTypes(); 1842 data_type_status_table_.GetFailedTypes();
1841 return Difference(preferred_types, failed_types); 1843 return Difference(preferred_types, failed_types);
1842 } 1844 }
1843 1845
1844 syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const { 1846 syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const {
1845 const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); 1847 const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
1846 const syncer::ModelTypeSet preferred_types = 1848 const syncer::ModelTypeSet preferred_types =
1847 sync_prefs_.GetPreferredDataTypes(registered_types); 1849 Union(sync_prefs_.GetPreferredDataTypes(registered_types),
1850 syncer::ControlTypes());
1848 const syncer::ModelTypeSet enforced_types = 1851 const syncer::ModelTypeSet enforced_types =
1849 Intersection(GetDataTypesFromPreferenceProviders(), registered_types); 1852 Intersection(GetDataTypesFromPreferenceProviders(), registered_types);
1850 return Union(preferred_types, enforced_types); 1853 return Union(preferred_types, enforced_types);
1851 } 1854 }
1852 1855
1853 syncer::ModelTypeSet ProfileSyncService::GetForcedDataTypes() const { 1856 syncer::ModelTypeSet ProfileSyncService::GetForcedDataTypes() const {
1854 // TODO(treib,zea): When SyncPrefs also implements SyncTypePreferenceProvider, 1857 // TODO(treib,zea): When SyncPrefs also implements SyncTypePreferenceProvider,
1855 // we'll need another way to distinguish user-choosable types from 1858 // we'll need another way to distinguish user-choosable types from
1856 // programmatically-enabled types. 1859 // programmatically-enabled types.
1857 return GetDataTypesFromPreferenceProviders(); 1860 return GetDataTypesFromPreferenceProviders();
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
2724 } 2727 }
2725 2728
2726 std::string ProfileSyncService::unrecoverable_error_message() const { 2729 std::string ProfileSyncService::unrecoverable_error_message() const {
2727 return unrecoverable_error_message_; 2730 return unrecoverable_error_message_;
2728 } 2731 }
2729 2732
2730 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2733 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2731 const { 2734 const {
2732 return unrecoverable_error_location_; 2735 return unrecoverable_error_location_;
2733 } 2736 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698