OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h" | 5 #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 - (const std::vector<GURL>&)fetchedAvatars { | 38 - (const std::vector<GURL>&)fetchedAvatars { |
39 return fetchedAvatars_; | 39 return fetchedAvatars_; |
40 } | 40 } |
41 | 41 |
42 @end | 42 @end |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 const char kDialogTitle[] = "Choose an account"; | 46 constexpr char kDialogTitle[] = "Choose an account"; |
47 | 47 |
48 // Returns a PasswordForm with only a username. | 48 // Returns a PasswordForm with only a username. |
49 std::unique_ptr<autofill::PasswordForm> Credential(const char* username) { | 49 std::unique_ptr<autofill::PasswordForm> Credential(const char* username) { |
50 std::unique_ptr<autofill::PasswordForm> credential( | 50 std::unique_ptr<autofill::PasswordForm> credential( |
51 new autofill::PasswordForm); | 51 new autofill::PasswordForm); |
52 credential->username_value = base::ASCIIToUTF16(username); | 52 credential->username_value = base::ASCIIToUTF16(username); |
53 return credential; | 53 return credential; |
54 } | 54 } |
55 | 55 |
56 class PasswordDialogControllerMock : public PasswordDialogController { | 56 class PasswordDialogControllerMock : public PasswordDialogController { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 local_forms.push_back(Credential("pizza")); | 225 local_forms.push_back(Credential("pizza")); |
226 SetUpAccountChooser(&local_forms); | 226 SetUpAccountChooser(&local_forms); |
227 [view_controller() setBridge:nil]; | 227 [view_controller() setBridge:nil]; |
228 [view_controller().titleView clickedOnLink:@"" atIndex:0]; | 228 [view_controller().titleView clickedOnLink:@"" atIndex:0]; |
229 [base::mac::ObjCCastStrict<CredentialItemButton>( | 229 [base::mac::ObjCCastStrict<CredentialItemButton>( |
230 [view_controller().credentialButtons objectAtIndex:0]) performClick:nil]; | 230 [view_controller().credentialButtons objectAtIndex:0]) performClick:nil]; |
231 [view_controller().cancelButton performClick:nil]; | 231 [view_controller().cancelButton performClick:nil]; |
232 } | 232 } |
233 | 233 |
234 } // namespace | 234 } // namespace |
OLD | NEW |