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.
6 #include "modules/credentialmanager/LocalCredential.h"
8 #include "bindings/core/v8/ExceptionState.h"
9 #include "platform/credentialmanager/PlatformLocalCredential.h"
13 LocalCredential* LocalCredential::create(const String& id, const String& name, const String& avatar, const String& password, ExceptionState& exceptionState)
15 KURL avatarURL = parseStringAsURL(avatar, exceptionState);
16 if (exceptionState.hadException())
18 return new LocalCredential(id, name, avatarURL, password);
21 LocalCredential::LocalCredential(const String& id, const String& name, const KURL& avatar, const String& password)
22 : Credential(PlatformLocalCredential::create(id, name, avatar, password))
24 ScriptWrappable::init(this);
27 const String& LocalCredential::password() const
29 return static_cast<PlatformLocalCredential*>(m_platformCredential.get())->password();