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

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

Issue 1222203008: [Sync] Add priority preferences datatype for mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 5 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
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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 if (directory_data_type_manager_.get()) 1776 if (directory_data_type_manager_.get())
1777 directory_data_type_manager_->ResetDataTypeErrors(); 1777 directory_data_type_manager_->ResetDataTypeErrors();
1778 ChangePreferredDataTypes(chosen_types); 1778 ChangePreferredDataTypes(chosen_types);
1779 } 1779 }
1780 1780
1781 void ProfileSyncService::ChangePreferredDataTypes( 1781 void ProfileSyncService::ChangePreferredDataTypes(
1782 syncer::ModelTypeSet preferred_types) { 1782 syncer::ModelTypeSet preferred_types) {
1783 1783
1784 DVLOG(1) << "ChangePreferredDataTypes invoked"; 1784 DVLOG(1) << "ChangePreferredDataTypes invoked";
1785 const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); 1785 const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
1786 const syncer::ModelTypeSet registered_preferred_types = 1786 // Will only enable those types that are registered and preferred.
1787 Intersection(registered_types, preferred_types); 1787 sync_prefs_.SetPreferredDataTypes(registered_types, preferred_types);
1788 sync_prefs_.SetPreferredDataTypes(registered_types,
1789 registered_preferred_types);
1790 1788
1791 // Now reconfigure the DTM. 1789 // Now reconfigure the DTM.
1792 ReconfigureDatatypeManager(); 1790 ReconfigureDatatypeManager();
1793 1791
1794 // TODO(rlarocque): Reconfigure the NonBlockingDataTypeManager, too. Blocked 1792 // TODO(rlarocque): Reconfigure the NonBlockingDataTypeManager, too. Blocked
1795 // on crbug.com/368834. Until that bug is fixed, it's difficult to tell 1793 // on crbug.com/368834. Until that bug is fixed, it's difficult to tell
1796 // which types should be enabled and when. 1794 // which types should be enabled and when.
1797 } 1795 }
1798 1796
1799 syncer::ModelTypeSet ProfileSyncService::GetActiveDataTypes() const { 1797 syncer::ModelTypeSet ProfileSyncService::GetActiveDataTypes() const {
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 } else { 2755 } else {
2758 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown", 2756 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown",
2759 warning_received); 2757 warning_received);
2760 } 2758 }
2761 } 2759 }
2762 sync_prefs_.SetMemoryPressureWarningCount(0); 2760 sync_prefs_.SetMemoryPressureWarningCount(0);
2763 // Will set to true during a clean shutdown, so crash or something else will 2761 // Will set to true during a clean shutdown, so crash or something else will
2764 // remain this as false. 2762 // remain this as false.
2765 sync_prefs_.SetCleanShutdown(false); 2763 sync_prefs_.SetCleanShutdown(false);
2766 } 2764 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698