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

Side by Side Diff: components/autofill/core/common/password_form.cc

Issue 1018613002: Fix PasswordForm operator== and operator<< and update one reliant test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@throttling
Patch Set: Undo clang formatting, and changes to matcher. Created 5 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
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_form_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <ostream> 5 #include <ostream>
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/common/password_form.h" 10 #include "components/autofill/core/common/password_form.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 PasswordForm::~PasswordForm() { 27 PasswordForm::~PasswordForm() {
28 } 28 }
29 29
30 bool PasswordForm::IsPublicSuffixMatch() const { 30 bool PasswordForm::IsPublicSuffixMatch() const {
31 return !original_signon_realm.empty(); 31 return !original_signon_realm.empty();
32 } 32 }
33 33
34 bool PasswordForm::operator==(const PasswordForm& form) const { 34 bool PasswordForm::operator==(const PasswordForm& form) const {
35 return signon_realm == form.signon_realm && 35 return scheme == form.scheme &&
36 signon_realm == form.signon_realm &&
37 original_signon_realm == form.original_signon_realm &&
36 origin == form.origin && 38 origin == form.origin &&
37 action == form.action && 39 action == form.action &&
38 submit_element == form.submit_element && 40 submit_element == form.submit_element &&
39 username_element == form.username_element && 41 username_element == form.username_element &&
40 username_marked_by_site == form.username_marked_by_site && 42 username_marked_by_site == form.username_marked_by_site &&
41 username_value == form.username_value && 43 username_value == form.username_value &&
42 other_possible_usernames == form.other_possible_usernames && 44 other_possible_usernames == form.other_possible_usernames &&
43 password_element == form.password_element && 45 password_element == form.password_element &&
44 password_value == form.password_value && 46 password_value == form.password_value &&
45 password_autocomplete_set == form.password_autocomplete_set && 47 password_autocomplete_set == form.password_autocomplete_set &&
(...skipping 14 matching lines...) Expand all
60 skip_zero_click == form.skip_zero_click; 62 skip_zero_click == form.skip_zero_click;
61 } 63 }
62 64
63 bool PasswordForm::operator!=(const PasswordForm& form) const { 65 bool PasswordForm::operator!=(const PasswordForm& form) const {
64 return !operator==(form); 66 return !operator==(form);
65 } 67 }
66 68
67 std::ostream& operator<<(std::ostream& os, const PasswordForm& form) { 69 std::ostream& operator<<(std::ostream& os, const PasswordForm& form) {
68 return os << "scheme: " << form.scheme 70 return os << "scheme: " << form.scheme
69 << " signon_realm: " << form.signon_realm 71 << " signon_realm: " << form.signon_realm
72 << " original_signon_realm: " << form.original_signon_realm
70 << " origin: " << form.origin 73 << " origin: " << form.origin
71 << " action: " << form.action 74 << " action: " << form.action
72 << " submit_element: " << base::UTF16ToUTF8(form.submit_element) 75 << " submit_element: " << base::UTF16ToUTF8(form.submit_element)
73 << " username_elem: " << base::UTF16ToUTF8(form.username_element) 76 << " username_elem: " << base::UTF16ToUTF8(form.username_element)
74 << " username_marked_by_site: " << form.username_marked_by_site 77 << " username_marked_by_site: " << form.username_marked_by_site
75 << " username_value: " << base::UTF16ToUTF8(form.username_value) 78 << " username_value: " << base::UTF16ToUTF8(form.username_value)
76 << " password_elem: " << base::UTF16ToUTF8(form.password_element) 79 << " password_elem: " << base::UTF16ToUTF8(form.password_element)
77 << " password_value: " << base::UTF16ToUTF8(form.password_value) 80 << " password_value: " << base::UTF16ToUTF8(form.password_value)
78 << " new_password_element: " 81 << " new_password_element: "
79 << base::UTF16ToUTF8(form.new_password_element) 82 << base::UTF16ToUTF8(form.new_password_element)
(...skipping 11 matching lines...) Expand all
91 << " times_used: " << form.times_used 94 << " times_used: " << form.times_used
92 << " form_data: " << form.form_data 95 << " form_data: " << form.form_data
93 << " generation_upload_status: " << form.generation_upload_status 96 << " generation_upload_status: " << form.generation_upload_status
94 << " display_name: " << base::UTF16ToUTF8(form.display_name) 97 << " display_name: " << base::UTF16ToUTF8(form.display_name)
95 << " avatar_url: " << form.avatar_url 98 << " avatar_url: " << form.avatar_url
96 << " federation_url: " << form.federation_url 99 << " federation_url: " << form.federation_url
97 << " skip_next_zero_click: " << form.skip_zero_click; 100 << " skip_next_zero_click: " << form.skip_zero_click;
98 } 101 }
99 102
100 } // namespace autofill 103 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_form_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698