OLD | NEW |
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/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/location.h" | 9 #include "base/location.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return; | 168 return; |
169 } | 169 } |
170 | 170 |
171 DCHECK(deleted_passwords_.empty() && new_passwords_.empty() && | 171 DCHECK(deleted_passwords_.empty() && new_passwords_.empty() && |
172 updated_passwords_.empty()); | 172 updated_passwords_.empty()); |
173 | 173 |
174 for (sync_api::ChangeRecordList::const_iterator it = | 174 for (sync_api::ChangeRecordList::const_iterator it = |
175 changes.Get().begin(); it != changes.Get().end(); ++it) { | 175 changes.Get().begin(); it != changes.Get().end(); ++it) { |
176 if (sync_api::ChangeRecord::ACTION_DELETE == | 176 if (sync_api::ChangeRecord::ACTION_DELETE == |
177 it->action) { | 177 it->action) { |
178 DCHECK(it->specifics.HasExtension(sync_pb::password)) | 178 DCHECK(it->specifics.has_password()) |
179 << "Password specifics data not present on delete!"; | 179 << "Password specifics data not present on delete!"; |
180 DCHECK(it->extra.get()); | 180 DCHECK(it->extra.get()); |
181 sync_api::ExtraPasswordChangeRecordData* extra = | 181 sync_api::ExtraPasswordChangeRecordData* extra = |
182 it->extra.get(); | 182 it->extra.get(); |
183 const sync_pb::PasswordSpecificsData& password = extra->unencrypted(); | 183 const sync_pb::PasswordSpecificsData& password = extra->unencrypted(); |
184 webkit::forms::PasswordForm form; | 184 webkit::forms::PasswordForm form; |
185 PasswordModelAssociator::CopyPassword(password, &form); | 185 PasswordModelAssociator::CopyPassword(password, &form); |
186 deleted_passwords_.push_back(form); | 186 deleted_passwords_.push_back(form); |
187 model_associator_->Disassociate(it->id); | 187 model_associator_->Disassociate(it->id); |
188 continue; | 188 continue; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 void PasswordChangeProcessor::StopObserving() { | 255 void PasswordChangeProcessor::StopObserving() { |
256 DCHECK(expected_loop_ == MessageLoop::current()); | 256 DCHECK(expected_loop_ == MessageLoop::current()); |
257 notification_registrar_.Remove( | 257 notification_registrar_.Remove( |
258 this, | 258 this, |
259 chrome::NOTIFICATION_LOGINS_CHANGED, | 259 chrome::NOTIFICATION_LOGINS_CHANGED, |
260 content::Source<PasswordStore>(password_store_)); | 260 content::Source<PasswordStore>(password_store_)); |
261 } | 261 } |
262 | 262 |
263 } // namespace browser_sync | 263 } // namespace browser_sync |
OLD | NEW |