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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 additional_data.setURLSearchParams(params); | 113 additional_data.setURLSearchParams(params); |
114 } | 114 } |
115 | 115 |
116 credential->setAdditionalData(additional_data); | 116 credential->setAdditionalData(additional_data); |
117 return credential; | 117 return credential; |
118 } | 118 } |
119 | 119 |
120 PasswordCredential::PasswordCredential( | 120 PasswordCredential::PasswordCredential( |
121 WebPasswordCredential* web_password_credential) | 121 WebPasswordCredential* web_password_credential) |
122 : SiteBoundCredential(web_password_credential->GetPlatformCredential()), | 122 : CredentialUserData(web_password_credential->GetPlatformCredential()), |
123 id_name_("username"), | 123 id_name_("username"), |
124 password_name_("password") {} | 124 password_name_("password") {} |
125 | 125 |
126 PasswordCredential::PasswordCredential(const String& id, | 126 PasswordCredential::PasswordCredential(const String& id, |
127 const String& password, | 127 const String& password, |
128 const String& name, | 128 const String& name, |
129 const KURL& icon) | 129 const KURL& icon) |
130 : SiteBoundCredential( | 130 : CredentialUserData( |
131 PlatformPasswordCredential::Create(id, password, name, icon)), | 131 PlatformPasswordCredential::Create(id, password, name, icon)), |
132 id_name_("username"), | 132 id_name_("username"), |
133 password_name_("password") {} | 133 password_name_("password") {} |
134 | 134 |
135 PassRefPtr<EncodedFormData> PasswordCredential::EncodeFormData( | 135 PassRefPtr<EncodedFormData> PasswordCredential::EncodeFormData( |
136 String& content_type) const { | 136 String& content_type) const { |
137 if (additional_data_.isURLSearchParams()) { | 137 if (additional_data_.isURLSearchParams()) { |
138 // If |additionalData| is a 'URLSearchParams' object, build a urlencoded | 138 // If |additionalData| is a 'URLSearchParams' object, build a urlencoded |
139 // response. | 139 // response. |
140 URLSearchParams* params = URLSearchParams::Create(String()); | 140 URLSearchParams* params = URLSearchParams::Create(String()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 encoded_data->Boundary().data(); | 176 encoded_data->Boundary().data(); |
177 return encoded_data.Release(); | 177 return encoded_data.Release(); |
178 } | 178 } |
179 | 179 |
180 const String& PasswordCredential::Password() const { | 180 const String& PasswordCredential::Password() const { |
181 return static_cast<PlatformPasswordCredential*>(platform_credential_.Get()) | 181 return static_cast<PlatformPasswordCredential*>(platform_credential_.Get()) |
182 ->Password(); | 182 ->Password(); |
183 } | 183 } |
184 | 184 |
185 DEFINE_TRACE(PasswordCredential) { | 185 DEFINE_TRACE(PasswordCredential) { |
186 SiteBoundCredential::Trace(visitor); | 186 CredentialUserData::Trace(visitor); |
187 visitor->Trace(additional_data_); | 187 visitor->Trace(additional_data_); |
188 } | 188 } |
189 | 189 |
190 } // namespace blink | 190 } // namespace blink |
OLD | NEW |