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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const std::vector<PasswordForm*>& result) OVERRIDE { | 52 const std::vector<PasswordForm*>& result) OVERRIDE { |
53 result_->clear(); | 53 result_->clear(); |
54 for (std::vector<PasswordForm*>::const_iterator it = result.begin(); | 54 for (std::vector<PasswordForm*>::const_iterator it = result.begin(); |
55 it != result.end(); | 55 it != result.end(); |
56 ++it) { | 56 ++it) { |
57 result_->push_back(**it); | 57 result_->push_back(**it); |
58 delete *it; | 58 delete *it; |
59 } | 59 } |
60 | 60 |
61 // Quit the message loop to wake up passwords_helper::GetLogins. | 61 // Quit the message loop to wake up passwords_helper::GetLogins. |
62 MessageLoopForUI::current()->Quit(); | 62 base::MessageLoopForUI::current()->Quit(); |
63 } | 63 } |
64 | 64 |
65 private: | 65 private: |
66 std::vector<PasswordForm>* result_; | 66 std::vector<PasswordForm>* result_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper); | 68 DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 | 72 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 PasswordForm form; | 216 PasswordForm form; |
217 form.signon_realm = kFakeSignonRealm; | 217 form.signon_realm = kFakeSignonRealm; |
218 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); | 218 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); |
219 form.username_value = ASCIIToUTF16(base::StringPrintf("username%d", index)); | 219 form.username_value = ASCIIToUTF16(base::StringPrintf("username%d", index)); |
220 form.password_value = ASCIIToUTF16(base::StringPrintf("password%d", index)); | 220 form.password_value = ASCIIToUTF16(base::StringPrintf("password%d", index)); |
221 form.date_created = base::Time::Now(); | 221 form.date_created = base::Time::Now(); |
222 return form; | 222 return form; |
223 } | 223 } |
224 | 224 |
225 } // namespace passwords_helper | 225 } // namespace passwords_helper |
OLD | NEW |