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

Side by Side Diff: content/renderer/password_form_conversion_utils.cc

Issue 12665003: Convert invalid WebPasswordFormData to null (rather than empty) PasswordForm. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added test Created 7 years, 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/renderer/password_form_conversion_utils.h" 5 #include "content/public/renderer/password_form_conversion_utils.h"
6 6
7 #include "content/public/common/password_form.h" 7 #include "content/public/common/password_form.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h " 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h "
9 9
10 using WebKit::WebFormElement; 10 using WebKit::WebFormElement;
(...skipping 24 matching lines...) Expand all
35 password_form->type = PasswordForm::TYPE_MANUAL; 35 password_form->type = PasswordForm::TYPE_MANUAL;
36 return scoped_ptr<PasswordForm>(password_form); 36 return scoped_ptr<PasswordForm>(password_form);
37 } 37 }
38 38
39 } // namespace 39 } // namespace
40 40
41 scoped_ptr<PasswordForm> CreatePasswordForm(const WebFormElement& webform) { 41 scoped_ptr<PasswordForm> CreatePasswordForm(const WebFormElement& webform) {
42 WebPasswordFormData web_password_form(webform); 42 WebPasswordFormData web_password_form(webform);
43 if (web_password_form.isValid()) 43 if (web_password_form.isValid())
44 return InitPasswordFormFromWebPasswordForm(web_password_form); 44 return InitPasswordFormFromWebPasswordForm(web_password_form);
45 return scoped_ptr<PasswordForm>(new PasswordForm()); 45 return scoped_ptr<PasswordForm>();
46 } 46 }
47 47
48 } // namespace content 48 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698