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

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

Issue 14139010: Disable history delete directives when sessions are encrypted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get it working. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | 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/sync_prefs.h" 5 #include "chrome/browser/sync/sync_prefs.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 pref_service_->GetBoolean(prefs::kSyncKeepEverythingSynced); 207 pref_service_->GetBoolean(prefs::kSyncKeepEverythingSynced);
208 } 208 }
209 209
210 void SyncPrefs::SetKeepEverythingSynced(bool keep_everything_synced) { 210 void SyncPrefs::SetKeepEverythingSynced(bool keep_everything_synced) {
211 DCHECK(CalledOnValidThread()); 211 DCHECK(CalledOnValidThread());
212 CHECK(pref_service_); 212 CHECK(pref_service_);
213 pref_service_->SetBoolean(prefs::kSyncKeepEverythingSynced, 213 pref_service_->SetBoolean(prefs::kSyncKeepEverythingSynced,
214 keep_everything_synced); 214 keep_everything_synced);
215 } 215 }
216 216
217 // TODO(akalin): If encryption is turned on for all data types,
218 // history delete directives are useless and so we shouldn't bother
219 // enabling them.
220
221 syncer::ModelTypeSet SyncPrefs::GetPreferredDataTypes( 217 syncer::ModelTypeSet SyncPrefs::GetPreferredDataTypes(
222 syncer::ModelTypeSet registered_types) const { 218 syncer::ModelTypeSet registered_types) const {
223 DCHECK(CalledOnValidThread()); 219 DCHECK(CalledOnValidThread());
224 if (!pref_service_) { 220 if (!pref_service_) {
225 return syncer::ModelTypeSet(); 221 return syncer::ModelTypeSet();
226 } 222 }
227 223
228 // First remove any datatypes that are inconsistent with the current policies 224 // First remove any datatypes that are inconsistent with the current policies
229 // on the client (so that "keep everything synced" doesn't include them). 225 // on the client (so that "keep everything synced" doesn't include them).
230 if (pref_service_->HasPrefPath(prefs::kSavingBrowserHistoryDisabled) && 226 if (pref_service_->HasPrefPath(prefs::kSavingBrowserHistoryDisabled) &&
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 for (PrefGroupsMap::const_iterator i = pref_groups_.begin(); 478 for (PrefGroupsMap::const_iterator i = pref_groups_.begin();
483 i != pref_groups_.end(); ++i) { 479 i != pref_groups_.end(); ++i) {
484 if (types.Has(i->first)) 480 if (types.Has(i->first))
485 types_with_groups.PutAll(i->second); 481 types_with_groups.PutAll(i->second);
486 } 482 }
487 types_with_groups.RetainAll(registered_types); 483 types_with_groups.RetainAll(registered_types);
488 return types_with_groups; 484 return types_with_groups;
489 } 485 }
490 486
491 } // namespace browser_sync 487 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698