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

Side by Side Diff: chrome/browser/sync/profile_sync_service.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 | « no previous file | chrome/browser/sync/sync_prefs.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 <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 void ProfileSyncService::OnEncryptedTypesChanged( 1110 void ProfileSyncService::OnEncryptedTypesChanged(
1111 syncer::ModelTypeSet encrypted_types, 1111 syncer::ModelTypeSet encrypted_types,
1112 bool encrypt_everything) { 1112 bool encrypt_everything) {
1113 encrypted_types_ = encrypted_types; 1113 encrypted_types_ = encrypted_types;
1114 encrypt_everything_ = encrypt_everything; 1114 encrypt_everything_ = encrypt_everything;
1115 DVLOG(1) << "Encrypted types changed to " 1115 DVLOG(1) << "Encrypted types changed to "
1116 << syncer::ModelTypeSetToString(encrypted_types_) 1116 << syncer::ModelTypeSetToString(encrypted_types_)
1117 << " (encrypt everything is set to " 1117 << " (encrypt everything is set to "
1118 << (encrypt_everything_ ? "true" : "false") << ")"; 1118 << (encrypt_everything_ ? "true" : "false") << ")";
1119 DCHECK(encrypted_types_.Has(syncer::PASSWORDS)); 1119 DCHECK(encrypted_types_.Has(syncer::PASSWORDS));
1120
1121 // If sessions are encrypted, full history sync is not possible, and
1122 // delete directives are unnecessary.
1123 if (GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES) &&
1124 encrypted_types_.Has(syncer::SESSIONS)) {
1125 DisableBrokenDatatype(syncer::HISTORY_DELETE_DIRECTIVES,
1126 FROM_HERE,
1127 "Delete directives not supported with encryption.");
1128 }
1120 } 1129 }
1121 1130
1122 void ProfileSyncService::OnEncryptionComplete() { 1131 void ProfileSyncService::OnEncryptionComplete() {
1123 DVLOG(1) << "Encryption complete"; 1132 DVLOG(1) << "Encryption complete";
1124 if (encryption_pending_ && encrypt_everything_) { 1133 if (encryption_pending_ && encrypt_everything_) {
1125 encryption_pending_ = false; 1134 encryption_pending_ = false;
1126 // This is to nudge the integration tests when encryption is 1135 // This is to nudge the integration tests when encryption is
1127 // finished. 1136 // finished.
1128 NotifyObservers(); 1137 NotifyObservers();
1129 } 1138 }
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 2064 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
2056 ProfileSyncService* old_this = this; 2065 ProfileSyncService* old_this = this;
2057 this->~ProfileSyncService(); 2066 this->~ProfileSyncService();
2058 new(old_this) ProfileSyncService( 2067 new(old_this) ProfileSyncService(
2059 new ProfileSyncComponentsFactoryImpl(profile, 2068 new ProfileSyncComponentsFactoryImpl(profile,
2060 CommandLine::ForCurrentProcess()), 2069 CommandLine::ForCurrentProcess()),
2061 profile, 2070 profile,
2062 signin, 2071 signin,
2063 behavior); 2072 behavior);
2064 } 2073 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/sync_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698