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

Side by Side Diff: chrome/browser/sync/glue/password_change_processor.cc

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + small fix Created 9 years, 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/glue/password_change_processor.h" 5 #include "chrome/browser/sync/glue/password_change_processor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 PasswordModelAssociator::PasswordVector updated_passwords; 143 PasswordModelAssociator::PasswordVector updated_passwords;
144 PasswordModelAssociator::PasswordVector deleted_passwords; 144 PasswordModelAssociator::PasswordVector deleted_passwords;
145 145
146 for (int i = 0; i < change_count; ++i) { 146 for (int i = 0; i < change_count; ++i) {
147 if (sync_api::SyncManager::ChangeRecord::ACTION_DELETE == 147 if (sync_api::SyncManager::ChangeRecord::ACTION_DELETE ==
148 changes[i].action) { 148 changes[i].action) {
149 DCHECK(changes[i].specifics.HasExtension(sync_pb::password)) 149 DCHECK(changes[i].specifics.HasExtension(sync_pb::password))
150 << "Password specifics data not present on delete!"; 150 << "Password specifics data not present on delete!";
151 DCHECK(changes[i].extra.get()); 151 DCHECK(changes[i].extra.get());
152 sync_api::SyncManager::ExtraPasswordChangeRecordData* extra = 152 sync_api::SyncManager::ExtraPasswordChangeRecordData* extra =
153 static_cast<sync_api::SyncManager::ExtraPasswordChangeRecordData*>( 153 changes[i].extra.get();
154 changes[i].extra.get());
155 const sync_pb::PasswordSpecificsData& password = extra->unencrypted(); 154 const sync_pb::PasswordSpecificsData& password = extra->unencrypted();
156 webkit_glue::PasswordForm form; 155 webkit_glue::PasswordForm form;
157 PasswordModelAssociator::CopyPassword(password, &form); 156 PasswordModelAssociator::CopyPassword(password, &form);
158 deleted_passwords.push_back(form); 157 deleted_passwords.push_back(form);
159 model_associator_->Disassociate(changes[i].id); 158 model_associator_->Disassociate(changes[i].id);
160 continue; 159 continue;
161 } 160 }
162 161
163 sync_api::ReadNode sync_node(trans); 162 sync_api::ReadNode sync_node(trans);
164 if (!sync_node.InitByIdLookup(changes[i].id)) { 163 if (!sync_node.InitByIdLookup(changes[i].id)) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 215 }
217 216
218 void PasswordChangeProcessor::StopObserving() { 217 void PasswordChangeProcessor::StopObserving() {
219 DCHECK(expected_loop_ == MessageLoop::current()); 218 DCHECK(expected_loop_ == MessageLoop::current());
220 notification_registrar_.Remove(this, 219 notification_registrar_.Remove(this,
221 NotificationType::LOGINS_CHANGED, 220 NotificationType::LOGINS_CHANGED,
222 Source<PasswordStore>(password_store_)); 221 Source<PasswordStore>(password_store_));
223 } 222 }
224 223
225 } // namespace browser_sync 224 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_util.cc ('k') | chrome/browser/sync/glue/session_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698