| 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 "components/password_manager/content/common/credential_manager_content_
utils.h" | 7 #include "components/password_manager/content/common/credential_manager_content_
utils.h" |
| 8 #include "components/password_manager/content/common/credential_manager_messages
.h" | 8 #include "components/password_manager/content/common/credential_manager_messages
.h" |
| 9 #include "components/password_manager/core/common/credential_manager_types.h" | 9 #include "components/password_manager/core/common/credential_manager_types.h" |
| 10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 void CredentialManagerClient::OnSendCredential(int request_id, | 80 void CredentialManagerClient::OnSendCredential(int request_id, |
| 81 const CredentialInfo& info) { | 81 const CredentialInfo& info) { |
| 82 RequestCallbacks* callbacks = request_callbacks_.Lookup(request_id); | 82 RequestCallbacks* callbacks = request_callbacks_.Lookup(request_id); |
| 83 DCHECK(callbacks); | 83 DCHECK(callbacks); |
| 84 scoped_ptr<blink::WebCredential> credential = nullptr; | 84 scoped_ptr<blink::WebCredential> credential = nullptr; |
| 85 switch (info.type) { | 85 switch (info.type) { |
| 86 case CredentialType::CREDENTIAL_TYPE_FEDERATED: | 86 case CredentialType::CREDENTIAL_TYPE_FEDERATED: |
| 87 credential.reset(new blink::WebFederatedCredential( | 87 credential.reset(new blink::WebFederatedCredential( |
| 88 info.id, info.federation, info.name, info.avatar)); | 88 info.id, info.federation, info.name, info.icon)); |
| 89 break; | 89 break; |
| 90 case CredentialType::CREDENTIAL_TYPE_PASSWORD: | 90 case CredentialType::CREDENTIAL_TYPE_PASSWORD: |
| 91 credential.reset(new blink::WebPasswordCredential( | 91 credential.reset(new blink::WebPasswordCredential( |
| 92 info.id, info.password, info.name, info.avatar)); | 92 info.id, info.password, info.name, info.icon)); |
| 93 break; | 93 break; |
| 94 case CredentialType::CREDENTIAL_TYPE_EMPTY: | 94 case CredentialType::CREDENTIAL_TYPE_EMPTY: |
| 95 // Intentionally empty; we'll send nullptr to the onSuccess call below. | 95 // Intentionally empty; we'll send nullptr to the onSuccess call below. |
| 96 break; | 96 break; |
| 97 } | 97 } |
| 98 callbacks->onSuccess(credential.get()); | 98 callbacks->onSuccess(credential.get()); |
| 99 request_callbacks_.Remove(request_id); | 99 request_callbacks_.Remove(request_id); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CredentialManagerClient::OnRejectCredentialRequest( | 102 void CredentialManagerClient::OnRejectCredentialRequest( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 int request_id, | 153 int request_id, |
| 154 CredentialManagerClient::NotificationCallbacksMap* map) { | 154 CredentialManagerClient::NotificationCallbacksMap* map) { |
| 155 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks = | 155 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks = |
| 156 map->Lookup(request_id); | 156 map->Lookup(request_id); |
| 157 DCHECK(callbacks); | 157 DCHECK(callbacks); |
| 158 callbacks->onSuccess(); | 158 callbacks->onSuccess(); |
| 159 map->Remove(request_id); | 159 map->Remove(request_id); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace password_manager | 162 } // namespace password_manager |
| OLD | NEW |