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

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

Issue 835523004: Credential Manager API: Enable forward declaration for CredentialType enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 "components/password_manager/content/common/credential_manager_messages .h" 7 #include "components/password_manager/content/common/credential_manager_messages .h"
8 #include "components/password_manager/content/common/credential_manager_types.h" 8 #include "components/password_manager/content/common/credential_manager_types.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "third_party/WebKit/public/platform/WebCredential.h" 10 #include "third_party/WebKit/public/platform/WebCredential.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void CredentialManagerClient::OnAcknowledgeSignedOut(int request_id) { 75 void CredentialManagerClient::OnAcknowledgeSignedOut(int request_id) {
76 RespondToNotificationCallback(request_id, &signed_out_callbacks_); 76 RespondToNotificationCallback(request_id, &signed_out_callbacks_);
77 } 77 }
78 78
79 void CredentialManagerClient::OnSendCredential(int request_id, 79 void CredentialManagerClient::OnSendCredential(int request_id,
80 const CredentialInfo& info) { 80 const CredentialInfo& info) {
81 RequestCallbacks* callbacks = request_callbacks_.Lookup(request_id); 81 RequestCallbacks* callbacks = request_callbacks_.Lookup(request_id);
82 DCHECK(callbacks); 82 DCHECK(callbacks);
83 scoped_ptr<blink::WebCredential> credential = nullptr; 83 scoped_ptr<blink::WebCredential> credential = nullptr;
84 switch (info.type) { 84 switch (info.type) {
85 case CREDENTIAL_TYPE_FEDERATED: 85 case CredentialType::CREDENTIAL_TYPE_FEDERATED:
86 credential.reset(new blink::WebFederatedCredential( 86 credential.reset(new blink::WebFederatedCredential(
87 info.id, info.name, info.avatar, info.federation)); 87 info.id, info.name, info.avatar, info.federation));
88 break; 88 break;
89 case CREDENTIAL_TYPE_LOCAL: 89 case CredentialType::CREDENTIAL_TYPE_LOCAL:
90 credential.reset(new blink::WebLocalCredential(info.id, info.name, 90 credential.reset(new blink::WebLocalCredential(info.id, info.name,
91 info.avatar, info.password)); 91 info.avatar, info.password));
92 break; 92 break;
93 case CREDENTIAL_TYPE_EMPTY: 93 case CredentialType::CREDENTIAL_TYPE_EMPTY:
94 // Intentionally empty; we'll send nullptr to the onSuccess call below. 94 // Intentionally empty; we'll send nullptr to the onSuccess call below.
95 break; 95 break;
96 } 96 }
97 callbacks->onSuccess(credential.get()); 97 callbacks->onSuccess(credential.get());
98 request_callbacks_.Remove(request_id); 98 request_callbacks_.Remove(request_id);
99 } 99 }
100 100
101 void CredentialManagerClient::OnRejectCredentialRequest( 101 void CredentialManagerClient::OnRejectCredentialRequest(
102 int request_id, 102 int request_id,
103 blink::WebCredentialManagerError::ErrorType error_type) { 103 blink::WebCredentialManagerError::ErrorType error_type) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 int request_id, 152 int request_id,
153 CredentialManagerClient::NotificationCallbacksMap* map) { 153 CredentialManagerClient::NotificationCallbacksMap* map) {
154 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks = 154 blink::WebCredentialManagerClient::NotificationCallbacks* callbacks =
155 map->Lookup(request_id); 155 map->Lookup(request_id);
156 DCHECK(callbacks); 156 DCHECK(callbacks);
157 callbacks->onSuccess(); 157 callbacks->onSuccess();
158 map->Remove(request_id); 158 map->Remove(request_id);
159 } 159 }
160 160
161 } // namespace password_manager 161 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698