| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "public/platform/WebCredential.h" | 6 #include "public/platform/WebCredential.h" |
| 7 | 7 |
| 8 #include "platform/credentialmanager/PlatformCredential.h" | 8 #include "platform/credentialmanager/PlatformCredential.h" |
| 9 #include "public/platform/WebFederatedCredential.h" | 9 #include "public/platform/WebFederatedCredential.h" |
| 10 #include "public/platform/WebLocalCredential.h" | 10 #include "public/platform/WebPasswordCredential.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 WebCredential WebCredential::create(PlatformCredential* credential) | 14 WebCredential WebCredential::create(PlatformCredential* credential) |
| 15 { | 15 { |
| 16 if (credential->isLocal()) { | 16 if (credential->isPassword()) { |
| 17 WebLocalCredential local(credential); | 17 WebPasswordCredential password(credential); |
| 18 return local; | 18 return password; |
| 19 } | 19 } |
| 20 | 20 |
| 21 if (credential->isFederated()) { | 21 if (credential->isFederated()) { |
| 22 WebFederatedCredential federated(credential); | 22 WebFederatedCredential federated(credential); |
| 23 return federated; | 23 return federated; |
| 24 } | 24 } |
| 25 | 25 |
| 26 ASSERT_NOT_REACHED(); | 26 ASSERT_NOT_REACHED(); |
| 27 return WebCredential(credential); | 27 return WebCredential(credential); |
| 28 } | 28 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 WebURL WebCredential::avatarURL() const | 71 WebURL WebCredential::avatarURL() const |
| 72 { | 72 { |
| 73 return m_platformCredential->avatarURL(); | 73 return m_platformCredential->avatarURL(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 WebString WebCredential::type() const | 76 WebString WebCredential::type() const |
| 77 { | 77 { |
| 78 return m_platformCredential->type(); | 78 return m_platformCredential->type(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool WebCredential::isLocalCredential() const | 81 bool WebCredential::isPasswordCredential() const |
| 82 { | 82 { |
| 83 return m_platformCredential->isLocal(); | 83 return m_platformCredential->isPassword(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool WebCredential::isFederatedCredential() const | 86 bool WebCredential::isFederatedCredential() const |
| 87 { | 87 { |
| 88 return m_platformCredential->isFederated(); | 88 return m_platformCredential->isFederated(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |