OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/password_manager/content/renderer/credential_manager_client
.h" | 5 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 callback.Run(); | 49 callback.Run(); |
50 } | 50 } |
51 | 51 |
52 void RequireUserMediation( | 52 void RequireUserMediation( |
53 const RequireUserMediationCallback& callback) override { | 53 const RequireUserMediationCallback& callback) override { |
54 callback.Run(); | 54 callback.Run(); |
55 } | 55 } |
56 | 56 |
57 void Get(bool zero_click_only, | 57 void Get(bool zero_click_only, |
58 bool include_passwords, | 58 bool include_passwords, |
59 mojo::Array<mojo::String> federations, | 59 mojo::Array<GURL> federations, |
60 const GetCallback& callback) override { | 60 const GetCallback& callback) override { |
61 mojo::String& url = federations[0]; | 61 const std::string& url = federations[0].spec(); |
62 | 62 |
63 if (url == kTestCredentialPassword) { | 63 if (url == kTestCredentialPassword) { |
64 mojom::CredentialInfoPtr info = mojom::CredentialInfo::New(); | 64 mojom::CredentialInfoPtr info = mojom::CredentialInfo::New(); |
65 info->type = mojom::CredentialType::PASSWORD; | 65 info->type = mojom::CredentialType::PASSWORD; |
66 callback.Run(mojom::CredentialManagerError::SUCCESS, std::move(info)); | 66 callback.Run(mojom::CredentialManagerError::SUCCESS, std::move(info)); |
67 } else if (url == kTestCredentialEmpty) { | 67 } else if (url == kTestCredentialEmpty) { |
68 callback.Run(mojom::CredentialManagerError::SUCCESS, | 68 callback.Run(mojom::CredentialManagerError::SUCCESS, |
69 mojom::CredentialInfo::New()); | 69 mojom::CredentialInfo::New()); |
70 } else if (url == kTestCredentialReject) { | 70 } else if (url == kTestCredentialReject) { |
71 callback.Run(mojom::CredentialManagerError::PASSWORDSTOREUNAVAILABLE, | 71 callback.Run(mojom::CredentialManagerError::PASSWORDSTOREUNAVAILABLE, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 EXPECT_FALSE(callback_succeeded()); | 243 EXPECT_FALSE(callback_succeeded()); |
244 EXPECT_TRUE(callback_errored()); | 244 EXPECT_TRUE(callback_errored()); |
245 EXPECT_FALSE(credential_); | 245 EXPECT_FALSE(credential_); |
246 EXPECT_EQ(blink::WebCredentialManagerError:: | 246 EXPECT_EQ(blink::WebCredentialManagerError:: |
247 WebCredentialManagerPasswordStoreUnavailableError, | 247 WebCredentialManagerPasswordStoreUnavailableError, |
248 error_); | 248 error_); |
249 } | 249 } |
250 | 250 |
251 } // namespace password_manager | 251 } // namespace password_manager |
OLD | NEW |