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

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

Issue 615383002: Credential Manager: Return the first valid item from the PasswordStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « components/password_manager/content/common/credential_manager_types.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/credential_manager_types.h" 5 #include "components/password_manager/content/common/credential_manager_types.h"
6 6
7 #include "base/logging.h"
8 #include "components/autofill/core/common/password_form.h"
9
7 namespace password_manager { 10 namespace password_manager {
8 11
9 CredentialInfo::CredentialInfo() : type(CREDENTIAL_TYPE_UNKNOWN) { 12 CredentialInfo::CredentialInfo() : type(CREDENTIAL_TYPE_UNKNOWN) {
10 } 13 }
11 14
12 CredentialInfo::CredentialInfo(const base::string16& id, 15 CredentialInfo::CredentialInfo(const base::string16& id,
13 const base::string16& name, 16 const base::string16& name,
14 const GURL& avatar) 17 const GURL& avatar)
15 : type(CREDENTIAL_TYPE_UNKNOWN), 18 : type(CREDENTIAL_TYPE_UNKNOWN),
16 id(id), 19 id(id),
17 name(name), 20 name(name),
18 avatar(avatar) { 21 avatar(avatar) {
19 } 22 }
20 23
24 CredentialInfo::CredentialInfo(const autofill::PasswordForm& form)
25 : id(form.username_value),
26 name(form.display_name),
27 avatar(form.avatar_url),
28 password(form.password_value),
29 federation(form.federation_url) {
30 DCHECK(!password.empty() || !federation.is_empty());
31 type = password.empty() ? CREDENTIAL_TYPE_FEDERATED : CREDENTIAL_TYPE_LOCAL;
32 }
33
21 CredentialInfo::~CredentialInfo() { 34 CredentialInfo::~CredentialInfo() {
22 } 35 }
23 36
24 } // namespace password_manager 37 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/password_manager/content/common/credential_manager_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698