Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebCredential.h
blob23c709128009dc7c1652fc9e0fd184eaedc79cac
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.
5 #ifndef WebCredential_h
6 #define WebCredential_h
8 #include "public/platform/WebCommon.h"
9 #include "public/platform/WebPrivatePtr.h"
10 #include "public/platform/WebString.h"
11 #include "public/platform/WebURL.h"
13 namespace blink {
15 class PlatformCredential;
17 class WebCredential {
18 public:
19 BLINK_PLATFORM_EXPORT WebCredential(const WebString& id, const WebString& name, const WebURL& iconURL);
20 BLINK_PLATFORM_EXPORT WebCredential(const WebCredential&);
21 virtual ~WebCredential() { reset(); }
23 BLINK_PLATFORM_EXPORT void assign(const WebCredential&);
24 BLINK_PLATFORM_EXPORT void reset();
26 BLINK_PLATFORM_EXPORT WebString id() const;
27 BLINK_PLATFORM_EXPORT WebString name() const;
28 BLINK_PLATFORM_EXPORT WebURL iconURL() const;
29 BLINK_PLATFORM_EXPORT WebString type() const;
31 BLINK_PLATFORM_EXPORT bool isPasswordCredential() const;
32 BLINK_PLATFORM_EXPORT bool isFederatedCredential() const;
34 // TODO(mkwst): Drop this once Chromium is updated. https://crbug.com/494880
35 BLINK_PLATFORM_EXPORT bool isLocalCredential() const { return isPasswordCredential(); }
37 #if INSIDE_BLINK
38 BLINK_PLATFORM_EXPORT static WebCredential create(PlatformCredential*);
39 BLINK_PLATFORM_EXPORT WebCredential& operator=(PlatformCredential*);
40 BLINK_PLATFORM_EXPORT PlatformCredential* platformCredential() const { return m_platformCredential.get(); }
41 #endif
43 protected:
44 #if INSIDE_BLINK
45 BLINK_PLATFORM_EXPORT WebCredential(PlatformCredential*);
46 #endif
48 WebPrivatePtr<PlatformCredential> m_platformCredential;
51 } // namespace blink
53 #endif // WebCredential_h