OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/live_sync/passwords_helper.h" | 5 #include "chrome/test/live_sync/passwords_helper.h" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/password_manager/password_form_data.h" | 10 #include "chrome/browser/password_manager/password_form_data.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 void RemoveLogins(PasswordStore* store) { | 98 void RemoveLogins(PasswordStore* store) { |
99 std::vector<PasswordForm> forms; | 99 std::vector<PasswordForm> forms; |
100 GetLogins(store, forms); | 100 GetLogins(store, forms); |
101 for (std::vector<PasswordForm>::iterator it = forms.begin(); | 101 for (std::vector<PasswordForm>::iterator it = forms.begin(); |
102 it != forms.end(); ++it) { | 102 it != forms.end(); ++it) { |
103 RemoveLogin(store, *it); | 103 RemoveLogin(store, *it); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 void SetPassphrase(int index, const std::string& passphrase, bool is_creation) { | 107 void SetPassphrase(int index, const std::string& passphrase) { |
108 test()->GetProfile(index)->GetProfileSyncService("")->SetPassphrase( | 108 test()->GetProfile(index)->GetProfileSyncService("")->SetPassphrase( |
109 passphrase, true, is_creation); | 109 passphrase, true); |
110 } | 110 } |
111 | 111 |
112 PasswordStore* GetPasswordStore(int index) { | 112 PasswordStore* GetPasswordStore(int index) { |
113 return test()->GetProfile(index)->GetPasswordStore(Profile::IMPLICIT_ACCESS); | 113 return test()->GetProfile(index)->GetPasswordStore(Profile::IMPLICIT_ACCESS); |
114 } | 114 } |
115 | 115 |
116 PasswordStore* GetVerifierPasswordStore() { | 116 PasswordStore* GetVerifierPasswordStore() { |
117 return test()->verifier()->GetPasswordStore(Profile::IMPLICIT_ACCESS); | 117 return test()->verifier()->GetPasswordStore(Profile::IMPLICIT_ACCESS); |
118 } | 118 } |
119 | 119 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 PasswordForm CreateTestPasswordForm(int index) { | 196 PasswordForm CreateTestPasswordForm(int index) { |
197 PasswordForm form; | 197 PasswordForm form; |
198 form.signon_realm = kFakeSignonRealm; | 198 form.signon_realm = kFakeSignonRealm; |
199 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); | 199 form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); |
200 form.username_value = ASCIIToUTF16(base::StringPrintf("username%d", index)); | 200 form.username_value = ASCIIToUTF16(base::StringPrintf("username%d", index)); |
201 form.password_value = ASCIIToUTF16(base::StringPrintf("password%d", index)); | 201 form.password_value = ASCIIToUTF16(base::StringPrintf("password%d", index)); |
202 return form; | 202 return form; |
203 } | 203 } |
204 | 204 |
205 } // namespace passwords_helper | 205 } // namespace passwords_helper |
OLD | NEW |