OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "modules/credentialmanager/LocalCredential.h" | 6 #include "modules/credentialmanager/LocalCredential.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "platform/credentialmanager/PlatformLocalCredential.h" | 9 #include "platform/credentialmanager/PlatformLocalCredential.h" |
10 #include "public/platform/WebCredential.h" | 10 #include "public/platform/WebCredential.h" |
11 #include "public/platform/WebLocalCredential.h" | 11 #include "public/platform/WebLocalCredential.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 LocalCredential* LocalCredential::create(WebLocalCredential* webLocalCredential) | 15 LocalCredential* LocalCredential::create(WebLocalCredential* webLocalCredential) |
16 { | 16 { |
17 return new LocalCredential(webLocalCredential); | 17 return new LocalCredential(webLocalCredential); |
18 } | 18 } |
19 | 19 |
20 LocalCredential* LocalCredential::create(const String& id, const String& name, c
onst String& avatar, const String& password, ExceptionState& exceptionState) | 20 LocalCredential* LocalCredential::create(const String& id, const String& passwor
d, const String& name, const String& avatar, ExceptionState& exceptionState) |
21 { | 21 { |
22 KURL avatarURL = parseStringAsURL(avatar, exceptionState); | 22 KURL avatarURL = parseStringAsURL(avatar, exceptionState); |
23 if (exceptionState.hadException()) | 23 if (exceptionState.hadException()) |
24 return nullptr; | 24 return nullptr; |
25 return new LocalCredential(id, name, avatarURL, password); | 25 return new LocalCredential(id, password, name, avatarURL); |
26 } | 26 } |
27 | 27 |
28 LocalCredential::LocalCredential(WebLocalCredential* webLocalCredential) | 28 LocalCredential::LocalCredential(WebLocalCredential* webLocalCredential) |
29 : Credential(webLocalCredential->platformCredential()) | 29 : Credential(webLocalCredential->platformCredential()) |
30 { | 30 { |
31 } | 31 } |
32 | 32 |
33 LocalCredential::LocalCredential(const String& id, const String& name, const KUR
L& avatar, const String& password) | 33 LocalCredential::LocalCredential(const String& id, const String& password, const
String& name, const KURL& avatar) |
34 : Credential(PlatformLocalCredential::create(id, name, avatar, password)) | 34 : Credential(PlatformLocalCredential::create(id, password, name, avatar)) |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
38 const String& LocalCredential::password() const | 38 const String& LocalCredential::password() const |
39 { | 39 { |
40 return static_cast<PlatformLocalCredential*>(m_platformCredential.get())->pa
ssword(); | 40 return static_cast<PlatformLocalCredential*>(m_platformCredential.get())->pa
ssword(); |
41 } | 41 } |
42 | 42 |
43 } // namespace blink | 43 } // namespace blink |
OLD | NEW |