| 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/password_manager/password_store.h" | 5 #include "chrome/browser/password_manager/password_store.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "chrome/browser/password_manager/password_store_consumer.h" | 12 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 13 #include "components/autofill/core/common/password_form.h" |
| 13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/common/password_form.h" | |
| 15 | 15 |
| 16 using autofill::PasswordForm; |
| 16 using content::BrowserThread; | 17 using content::BrowserThread; |
| 17 using std::vector; | 18 using std::vector; |
| 18 using content::PasswordForm; | |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // PasswordStoreConsumer callback requires vector const reference. | 22 // PasswordStoreConsumer callback requires vector const reference. |
| 23 void RunConsumerCallbackIfNotCanceled( | 23 void RunConsumerCallbackIfNotCanceled( |
| 24 const CancelableTaskTracker::IsCanceledCallback& is_canceled_cb, | 24 const CancelableTaskTracker::IsCanceledCallback& is_canceled_cb, |
| 25 PasswordStoreConsumer* consumer, | 25 PasswordStoreConsumer* consumer, |
| 26 const vector<PasswordForm*>* matched_forms) { | 26 const vector<PasswordForm*>* matched_forms) { |
| 27 if (is_canceled_cb.Run()) { | 27 if (is_canceled_cb.Run()) { |
| 28 STLDeleteContainerPointers(matched_forms->begin(), matched_forms->end()); | 28 STLDeleteContainerPointers(matched_forms->begin(), matched_forms->end()); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 #endif // !defined(OS_MACOSX) | 234 #endif // !defined(OS_MACOSX) |
| 235 BrowserThread::PostTask( | 235 BrowserThread::PostTask( |
| 236 BrowserThread::UI, FROM_HERE, | 236 BrowserThread::UI, FROM_HERE, |
| 237 base::Bind(&PasswordStore::NotifyLoginsChanged, this)); | 237 base::Bind(&PasswordStore::NotifyLoginsChanged, this)); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void PasswordStore::NotifyLoginsChanged() { | 240 void PasswordStore::NotifyLoginsChanged() { |
| 241 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 241 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 242 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged()); | 242 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged()); |
| 243 } | 243 } |
| OLD | NEW |