Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp

Issue 2832813002: Drop SiteBoundCredential in favor of CredentialUserData (Closed)
Patch Set: HTTPS Rename Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698