| 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 "modules/credentialmanager/PasswordCredential.h" | 5 #include "modules/credentialmanager/PasswordCredential.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "core/HTMLNames.h" | 9 #include "core/HTMLNames.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 params->append(entry->name().data(), entry->value().data()); | 98 params->append(entry->name().data(), entry->value().data()); |
| 99 } | 99 } |
| 100 additionalData.setURLSearchParams(params); | 100 additionalData.setURLSearchParams(params); |
| 101 } | 101 } |
| 102 | 102 |
| 103 credential->setAdditionalData(additionalData); | 103 credential->setAdditionalData(additionalData); |
| 104 return credential; | 104 return credential; |
| 105 } | 105 } |
| 106 | 106 |
| 107 PasswordCredential::PasswordCredential(WebPasswordCredential* webPasswordCredent
ial) | 107 PasswordCredential::PasswordCredential(WebPasswordCredential* webPasswordCredent
ial) |
| 108 : Credential(webPasswordCredential->getPlatformCredential()) | 108 : SiteBoundCredential(webPasswordCredential->getPlatformCredential()) |
| 109 , m_idName("username") | 109 , m_idName("username") |
| 110 , m_passwordName("password") | 110 , m_passwordName("password") |
| 111 { | 111 { |
| 112 } | 112 } |
| 113 | 113 |
| 114 PasswordCredential::PasswordCredential(const String& id, const String& password,
const String& name, const KURL& icon) | 114 PasswordCredential::PasswordCredential(const String& id, const String& password,
const String& name, const KURL& icon) |
| 115 : Credential(PlatformPasswordCredential::create(id, password, name, icon)) | 115 : SiteBoundCredential(PlatformPasswordCredential::create(id, password, name,
icon)) |
| 116 , m_idName("username") | 116 , m_idName("username") |
| 117 , m_passwordName("password") | 117 , m_passwordName("password") |
| 118 { | 118 { |
| 119 } | 119 } |
| 120 | 120 |
| 121 PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData(String& contentTy
pe) const | 121 PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData(String& contentTy
pe) const |
| 122 { | 122 { |
| 123 if (m_additionalData.isURLSearchParams()) { | 123 if (m_additionalData.isURLSearchParams()) { |
| 124 // If |additionalData| is a 'URLSearchParams' object, build a urlencoded
response. | 124 // If |additionalData| is a 'URLSearchParams' object, build a urlencoded
response. |
| 125 URLSearchParams* params = URLSearchParams::create(URLSearchParamsInit())
; | 125 URLSearchParams* params = URLSearchParams::create(URLSearchParamsInit())
; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return encodedData.release(); | 160 return encodedData.release(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 const String& PasswordCredential::password() const | 163 const String& PasswordCredential::password() const |
| 164 { | 164 { |
| 165 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())-
>password(); | 165 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())-
>password(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 DEFINE_TRACE(PasswordCredential) | 168 DEFINE_TRACE(PasswordCredential) |
| 169 { | 169 { |
| 170 Credential::trace(visitor); | 170 SiteBoundCredential::trace(visitor); |
| 171 visitor->trace(m_additionalData); | 171 visitor->trace(m_additionalData); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |