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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 225 } |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 void PasswordChangeProcessor::CommitChangesFromSyncModel() { | 229 void PasswordChangeProcessor::CommitChangesFromSyncModel() { |
230 DCHECK(expected_loop_ == MessageLoop::current()); | 230 DCHECK(expected_loop_ == MessageLoop::current()); |
231 if (!running()) | 231 if (!running()) |
232 return; | 232 return; |
233 ScopedStopObserving<PasswordChangeProcessor> stop_observing(this); | 233 ScopedStopObserving<PasswordChangeProcessor> stop_observing(this); |
234 | 234 |
235 SyncError error = model_associator_->WriteToPasswordStore( | 235 csync::SyncError error = model_associator_->WriteToPasswordStore( |
236 &new_passwords_, | 236 &new_passwords_, |
237 &updated_passwords_, | 237 &updated_passwords_, |
238 &deleted_passwords_); | 238 &deleted_passwords_); |
239 if (error.IsSet()) { | 239 if (error.IsSet()) { |
240 error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, | 240 error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, |
241 "Error writing passwords"); | 241 "Error writing passwords"); |
242 return; | 242 return; |
243 } | 243 } |
244 | 244 |
245 deleted_passwords_.clear(); | 245 deleted_passwords_.clear(); |
(...skipping 21 matching lines...) Expand all Loading... |
267 | 267 |
268 void PasswordChangeProcessor::StopObserving() { | 268 void PasswordChangeProcessor::StopObserving() { |
269 DCHECK(expected_loop_ == MessageLoop::current()); | 269 DCHECK(expected_loop_ == MessageLoop::current()); |
270 notification_registrar_.Remove( | 270 notification_registrar_.Remove( |
271 this, | 271 this, |
272 chrome::NOTIFICATION_LOGINS_CHANGED, | 272 chrome::NOTIFICATION_LOGINS_CHANGED, |
273 content::Source<PasswordStore>(password_store_)); | 273 content::Source<PasswordStore>(password_store_)); |
274 } | 274 } |
275 | 275 |
276 } // namespace browser_sync | 276 } // namespace browser_sync |
OLD | NEW |