Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: components/password_manager/content/renderer/credential_manager_client.cc

Issue 1852093002: components/password_manager: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and revert an accidental .proto change Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "components/password_manager/content/common/credential_manager_content_ utils.h" 9 #include "components/password_manager/content/common/credential_manager_content_ utils.h"
10 #include "components/password_manager/content/common/credential_manager_messages .h" 10 #include "components/password_manager/content/common/credential_manager_messages .h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void CredentialManagerClient::OnAcknowledgeRequireUserMediation( 70 void CredentialManagerClient::OnAcknowledgeRequireUserMediation(
71 int request_id) { 71 int request_id) {
72 RespondToNotificationCallback(request_id, &require_user_mediation_callbacks_); 72 RespondToNotificationCallback(request_id, &require_user_mediation_callbacks_);
73 } 73 }
74 74
75 void CredentialManagerClient::OnSendCredential(int request_id, 75 void CredentialManagerClient::OnSendCredential(int request_id,
76 const CredentialInfo& info) { 76 const CredentialInfo& info) {
77 RequestCallbacks* callbacks = get_callbacks_.Lookup(request_id); 77 RequestCallbacks* callbacks = get_callbacks_.Lookup(request_id);
78 DCHECK(callbacks); 78 DCHECK(callbacks);
79 scoped_ptr<blink::WebCredential> credential = nullptr; 79 std::unique_ptr<blink::WebCredential> credential = nullptr;
80 switch (info.type) { 80 switch (info.type) {
81 case CredentialType::CREDENTIAL_TYPE_FEDERATED: 81 case CredentialType::CREDENTIAL_TYPE_FEDERATED:
82 credential.reset(new blink::WebFederatedCredential( 82 credential.reset(new blink::WebFederatedCredential(
83 info.id, info.federation, info.name, info.icon)); 83 info.id, info.federation, info.name, info.icon));
84 break; 84 break;
85 case CredentialType::CREDENTIAL_TYPE_PASSWORD: 85 case CredentialType::CREDENTIAL_TYPE_PASSWORD:
86 credential.reset(new blink::WebPasswordCredential( 86 credential.reset(new blink::WebPasswordCredential(
87 info.id, info.password, info.name, info.icon)); 87 info.id, info.password, info.name, info.icon));
88 break; 88 break;
89 case CredentialType::CREDENTIAL_TYPE_EMPTY: 89 case CredentialType::CREDENTIAL_TYPE_EMPTY:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 int request_id, 139 int request_id,
140 CredentialManagerClient::NotificationCallbacksMap* map) { 140 CredentialManagerClient::NotificationCallbacksMap* map) {
141 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks = 141 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks =
142 map->Lookup(request_id); 142 map->Lookup(request_id);
143 DCHECK(callbacks); 143 DCHECK(callbacks);
144 callbacks->onSuccess(); 144 callbacks->onSuccess();
145 map->Remove(request_id); 145 map->Remove(request_id);
146 } 146 }
147 147
148 } // namespace password_manager 148 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698