| 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/test/integration/passwords_helper.h" | 5 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 class PasswordStoreConsumerHelper | 43 class PasswordStoreConsumerHelper |
| 44 : public password_manager::PasswordStoreConsumer { | 44 : public password_manager::PasswordStoreConsumer { |
| 45 public: | 45 public: |
| 46 PasswordStoreConsumerHelper() {} | 46 PasswordStoreConsumerHelper() {} |
| 47 | 47 |
| 48 void OnGetPasswordStoreResults(ScopedVector<PasswordForm> results) override { | 48 void OnGetPasswordStoreResults(ScopedVector<PasswordForm> results) override { |
| 49 result_.swap(results); | 49 result_.swap(results); |
| 50 // Quit the message loop to wake up passwords_helper::GetLogins. | 50 // Quit the message loop to wake up passwords_helper::GetLogins. |
| 51 base::MessageLoopForUI::current()->Quit(); | 51 base::MessageLoopForUI::current()->QuitWhenIdle(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 ScopedVector<PasswordForm> result() { return result_.Pass(); } | 54 ScopedVector<PasswordForm> result() { return result_.Pass(); } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 ScopedVector<PasswordForm> result_; | 57 ScopedVector<PasswordForm> result_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper); | 59 DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper); |
| 60 }; | 60 }; |
| 61 | 61 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); | 342 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); |
| 343 form.username_value = | 343 form.username_value = |
| 344 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); | 344 base::ASCIIToUTF16(base::StringPrintf("username%d", index)); |
| 345 form.password_value = | 345 form.password_value = |
| 346 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); | 346 base::ASCIIToUTF16(base::StringPrintf("password%d", index)); |
| 347 form.date_created = base::Time::Now(); | 347 form.date_created = base::Time::Now(); |
| 348 return form; | 348 return form; |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace passwords_helper | 351 } // namespace passwords_helper |
| OLD | NEW |