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

Side by Side Diff: Source/modules/credentialmanager/LocalCredential.cpp

Issue 1162443006: Credential Management: Rename 'LocalCredential' to 'PasswordCredential' (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-type
Patch Set: Test. Created 5 years, 6 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 2014 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 "config.h"
6 #include "modules/credentialmanager/LocalCredential.h"
7
8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/html/DOMFormData.h"
10 #include "platform/credentialmanager/PlatformLocalCredential.h"
11 #include "public/platform/WebCredential.h"
12 #include "public/platform/WebLocalCredential.h"
13
14 namespace blink {
15
16 LocalCredential* LocalCredential::create(WebLocalCredential* webLocalCredential)
17 {
18 return new LocalCredential(webLocalCredential);
19 }
20
21 LocalCredential* LocalCredential::create(const String& id, const String& passwor d, const String& name, const String& avatar, ExceptionState& exceptionState)
22 {
23 KURL avatarURL = parseStringAsURL(avatar, exceptionState);
24 if (exceptionState.hadException())
25 return nullptr;
26 return new LocalCredential(id, password, name, avatarURL);
27 }
28
29 LocalCredential::LocalCredential(WebLocalCredential* webLocalCredential)
30 : Credential(webLocalCredential->platformCredential())
31 {
32 }
33
34 LocalCredential::LocalCredential(const String& id, const String& password, const String& name, const KURL& avatar)
35 : Credential(PlatformLocalCredential::create(id, password, name, avatar))
36 , m_formData(DOMFormData::create())
37 {
38 m_formData->append("username", id);
39 m_formData->append("password", password);
40 }
41
42 const String& LocalCredential::password() const
43 {
44 return static_cast<PlatformLocalCredential*>(m_platformCredential.get())->pa ssword();
45 }
46
47 DEFINE_TRACE(LocalCredential)
48 {
49 visitor->trace(m_formData);
50 Credential::trace(visitor);
51 }
52
53 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/credentialmanager/LocalCredential.h ('k') | Source/modules/credentialmanager/LocalCredential.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698