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

Side by Side Diff: components/password_manager/content/common/credential_manager_content_utils.cc

Issue 1872133002: Revert of Reland: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/password_manager/content/common/credential_manager_content_ utils.h"
6
7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebCredential.h"
9 #include "third_party/WebKit/public/platform/WebFederatedCredential.h"
10 #include "third_party/WebKit/public/platform/WebPasswordCredential.h"
11
12 namespace password_manager {
13
14 CredentialInfo WebCredentialToCredentialInfo(
15 const blink::WebCredential& credential) {
16 CredentialInfo credential_info;
17 credential_info.id = credential.id();
18 credential_info.name = credential.name();
19 credential_info.icon = credential.iconURL();
20 credential_info.type = credential.isPasswordCredential()
21 ? CredentialType::CREDENTIAL_TYPE_PASSWORD
22 : CredentialType::CREDENTIAL_TYPE_FEDERATED;
23 if (credential_info.type == CredentialType::CREDENTIAL_TYPE_PASSWORD) {
24 DCHECK(credential.isPasswordCredential());
25 credential_info.password =
26 static_cast<const blink::WebPasswordCredential&>(credential).password();
27 } else {
28 DCHECK(credential.isFederatedCredential());
29 credential_info.federation =
30 static_cast<const blink::WebFederatedCredential&>(credential)
31 .provider();
32 }
33 return credential_info;
34 }
35
36 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698