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 #ifndef Credential_h | 5 #ifndef Credential_h |
6 #define Credential_h | 6 #define Credential_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/core/v8/SerializedScriptValue.h" | 9 #include "bindings/core/v8/SerializedScriptValue.h" |
| 10 #include "platform/credentialmanager/PlatformCredential.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 class Credential : public GarbageCollectedFinalized<Credential>, public ScriptWr
appable { | 15 class WebCredential; |
| 16 |
| 17 class Credential : public GarbageCollected<Credential>, public ScriptWrappable { |
15 public: | 18 public: |
16 static Credential* create(const String& id, const String& name, const String
& avatarURL); | 19 static Credential* create(const String& id, const String& name, const String
& avatarURL); |
17 virtual ~Credential(); | |
18 | 20 |
19 // Credential.idl | 21 // Credential.idl |
20 const String& id() const { return m_id; } | 22 const String& id() const { return m_platformCredential->id(); } |
21 const String& name() const { return m_name; } | 23 const String& name() const { return m_platformCredential->name(); } |
22 const String& avatarURL() const { return m_avatarURL; } | 24 const String& avatarURL() const { return m_platformCredential->avatarURL();
} |
23 | 25 |
24 virtual void trace(Visitor*) { }; | 26 virtual void trace(Visitor*); |
25 | 27 |
26 protected: | 28 protected: |
| 29 explicit Credential(PlatformCredential*); |
27 Credential(const String& id, const String& name, const String& avatarURL); | 30 Credential(const String& id, const String& name, const String& avatarURL); |
28 | 31 |
29 private: | 32 Member<PlatformCredential> m_platformCredential; |
30 String m_id; | |
31 String m_name; | |
32 String m_avatarURL; | |
33 }; | 33 }; |
34 | 34 |
35 } // namespace blink | 35 } // namespace blink |
36 | 36 |
37 #endif // Credential_h | 37 #endif // Credential_h |
OLD | NEW |