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

Side by Side Diff: components/autofill/core/browser/form_structure.cc

Issue 1686063004: Sending generated vote on password generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed reviewers comments Created 4 years, 10 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 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 "components/autofill/core/browser/form_structure.h" 5 #include "components/autofill/core/browser/form_structure.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 continue; 1099 continue;
1100 1100
1101 const ServerFieldTypeSet& types = field->possible_types(); 1101 const ServerFieldTypeSet& types = field->possible_types();
1102 for (const auto& field_type : types) { 1102 for (const auto& field_type : types) {
1103 // Add the same field elements as the query and a few more below. 1103 // Add the same field elements as the query and a few more below.
1104 if (ShouldSkipField(*field)) 1104 if (ShouldSkipField(*field))
1105 continue; 1105 continue;
1106 1106
1107 AutofillUploadContents::Field* added_field = upload->add_field(); 1107 AutofillUploadContents::Field* added_field = upload->add_field();
1108 added_field->set_autofill_type(field_type); 1108 added_field->set_autofill_type(field_type);
1109 if (field->generation_type())
1110 added_field->set_generation_type(
1111 static_cast<
1112 ::autofill::
1113 AutofillUploadContents_Field_PasswordGenerationType>(
1114 field->generation_type()));
dvadym 2016/02/19 16:25:06 Mathieu@: is it correct way to use proto enums?
Mathieu 2016/02/22 13:25:20 if |generation_type| is of type AutofillUploadCont
dvadym 2016/02/22 14:52:32 Done.
1109 1115
1110 unsigned sig = 0; 1116 unsigned sig = 0;
1111 // The signature is a required field. If it can't be parsed, the proto 1117 // The signature is a required field. If it can't be parsed, the proto
1112 // would not serialize. 1118 // would not serialize.
1113 if (!base::StringToUint(field->FieldSignature(), &sig)) 1119 if (!base::StringToUint(field->FieldSignature(), &sig))
1114 continue; 1120 continue;
1115 added_field->set_signature(sig); 1121 added_field->set_signature(sig);
1116 1122
1117 if (IsAutofillFieldMetadataEnabled()) { 1123 if (IsAutofillFieldMetadataEnabled()) {
1118 added_field->set_type(field->form_control_type); 1124 added_field->set_type(field->form_control_type);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 strings[i].at(prefix_len) != strings[0].at(prefix_len)) { 1304 strings[i].at(prefix_len) != strings[0].at(prefix_len)) {
1299 // Mismatch found. 1305 // Mismatch found.
1300 return base::StringPiece16(strings[i].data(), prefix_len); 1306 return base::StringPiece16(strings[i].data(), prefix_len);
1301 } 1307 }
1302 } 1308 }
1303 } 1309 }
1304 return strings[0]; 1310 return strings[0];
1305 } 1311 }
1306 1312
1307 } // namespace autofill 1313 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698