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.
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/credentialmanager/PlatformCredential.h"
10 #include "platform/heap/Handle.h"
11 #include "platform/weborigin/KURL.h"
17 class Credential : public GarbageCollectedFinalized<Credential>, public ScriptWrappable {
18 DEFINE_WRAPPERTYPEINFO();
20 static Credential* create(const String& id, const String& name, const KURL& avatar);
21 static Credential* create(const String& id, const String& name, const String& avatar, ExceptionState&);
24 const String& id() const { return m_platformCredential->id(); }
25 const String& name() const { return m_platformCredential->name(); }
26 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); }
28 virtual void trace(Visitor*);
30 PlatformCredential* platformCredential() const { return m_platformCredential; }
33 Credential(PlatformCredential*);
34 Credential(const String& id, const String& name, const KURL& avatar);
36 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced.
37 static KURL parseStringAsURL(const String&, ExceptionState&);
39 Member<PlatformCredential> m_platformCredential;
44 #endif // Credential_h