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