Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / exported / WebCredential.cpp
blob192e8af9f9fdd3908eb68bc0a688461fb21f98e7
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 #include "config.h"
6 #include "public/platform/WebCredential.h"
8 #include "platform/credentialmanager/PlatformCredential.h"
9 #include "public/platform/WebFederatedCredential.h"
10 #include "public/platform/WebPasswordCredential.h"
12 namespace blink {
14 WebCredential WebCredential::create(PlatformCredential* credential)
16 if (credential->isPassword()) {
17 WebPasswordCredential password(credential);
18 return password;
21 if (credential->isFederated()) {
22 WebFederatedCredential federated(credential);
23 return federated;
26 ASSERT_NOT_REACHED();
27 return WebCredential(credential);
30 WebCredential::WebCredential(const WebString& id, const WebString& name, const WebURL& iconURL)
31 : m_platformCredential(PlatformCredential::create(id, name, iconURL))
35 WebCredential::WebCredential(const WebCredential& other)
37 assign(other);
40 void WebCredential::assign(const WebCredential& other)
42 m_platformCredential = other.m_platformCredential;
45 WebCredential::WebCredential(PlatformCredential* credential)
46 : m_platformCredential(credential)
50 WebCredential& WebCredential::operator=(PlatformCredential* credential)
52 m_platformCredential = credential;
53 return *this;
56 void WebCredential::reset()
58 m_platformCredential.reset();
61 WebString WebCredential::id() const
63 return m_platformCredential->id();
66 WebString WebCredential::name() const
68 return m_platformCredential->name();
71 WebURL WebCredential::iconURL() const
73 return m_platformCredential->iconURL();
76 WebString WebCredential::type() const
78 return m_platformCredential->type();
81 bool WebCredential::isPasswordCredential() const
83 return m_platformCredential->isPassword();
86 bool WebCredential::isFederatedCredential() const
88 return m_platformCredential->isFederated();
91 } // namespace blink