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

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

Issue 22040002: [Autofill] Add a separate enumeration for HTML field type hints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add docs Created 7 years, 4 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 | Annotate | Revision Log
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/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 void AutofillManager::GetProfileSuggestions( 1068 void AutofillManager::GetProfileSuggestions(
1069 FormStructure* form, 1069 FormStructure* form,
1070 const FormFieldData& field, 1070 const FormFieldData& field,
1071 const AutofillType& type, 1071 const AutofillType& type,
1072 std::vector<base::string16>* values, 1072 std::vector<base::string16>* values,
1073 std::vector<base::string16>* labels, 1073 std::vector<base::string16>* labels,
1074 std::vector<base::string16>* icons, 1074 std::vector<base::string16>* icons,
1075 std::vector<int>* unique_ids) const { 1075 std::vector<int>* unique_ids) const {
1076 std::vector<NativeFieldType> field_types(form->field_count()); 1076 std::vector<NativeFieldType> field_types(form->field_count());
1077 for (size_t i = 0; i < form->field_count(); ++i) { 1077 for (size_t i = 0; i < form->field_count(); ++i) {
1078 field_types.push_back(form->field(i)->Type().native_type()); 1078 field_types.push_back(
1079 form->field(i)->Type().GetApproximateNativeFieldType());
1079 } 1080 }
1080 std::vector<GUIDPair> guid_pairs; 1081 std::vector<GUIDPair> guid_pairs;
1081 1082
1082 personal_data_->GetProfileSuggestions( 1083 personal_data_->GetProfileSuggestions(
1083 type, field.value, field.is_autofilled, field_types, 1084 type, field.value, field.is_autofilled, field_types,
1084 values, labels, icons, &guid_pairs); 1085 values, labels, icons, &guid_pairs);
1085 1086
1086 for (size_t i = 0; i < guid_pairs.size(); ++i) { 1087 for (size_t i = 0; i < guid_pairs.size(); ++i) {
1087 unique_ids->push_back(PackGUIDs(GUIDPair(std::string(), 0), 1088 unique_ids->push_back(PackGUIDs(GUIDPair(std::string(), 0),
1088 guid_pairs[i])); 1089 guid_pairs[i]));
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 1211
1211 void AutofillManager::UpdateInitialInteractionTimestamp( 1212 void AutofillManager::UpdateInitialInteractionTimestamp(
1212 const TimeTicks& interaction_timestamp) { 1213 const TimeTicks& interaction_timestamp) {
1213 if (initial_interaction_timestamp_.is_null() || 1214 if (initial_interaction_timestamp_.is_null() ||
1214 interaction_timestamp < initial_interaction_timestamp_) { 1215 interaction_timestamp < initial_interaction_timestamp_) {
1215 initial_interaction_timestamp_ = interaction_timestamp; 1216 initial_interaction_timestamp_ = interaction_timestamp;
1216 } 1217 }
1217 } 1218 }
1218 1219
1219 } // namespace autofill 1220 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698