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

Side by Side Diff: components/autofill/browser/autocomplete_history_manager.cc

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: added a unit test Created 7 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/autocomplete_history_manager.h" 5 #include "components/autofill/browser/autocomplete_history_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return; 117 return;
118 } 118 }
119 119
120 if (autofill_data_.get()) { 120 if (autofill_data_.get()) {
121 pending_query_handle_ = autofill_data_->GetFormValuesForElementName( 121 pending_query_handle_ = autofill_data_->GetFormValuesForElementName(
122 name, prefix, kMaxAutocompleteMenuItems, this); 122 name, prefix, kMaxAutocompleteMenuItems, this);
123 } 123 }
124 } 124 }
125 125
126 void AutocompleteHistoryManager::OnFormSubmitted(const FormData& form) { 126 void AutocompleteHistoryManager::OnFormSubmitted(const FormData& form) {
127 if (!*autofill_enabled_)
128 return;
129
130 if (browser_context_->IsOffTheRecord())
131 return;
Ilya Sherman 2013/06/15 00:28:09 Please either keep these if-stmts, or replace them
Ilya Sherman 2013/06/15 00:28:09 I don't follow why this check was removed -- there
sgurun-gerrit only 2013/06/17 21:20:32 Done.
sgurun-gerrit only 2013/06/17 21:20:32 Done.
132
133 // Don't save data that was submitted through JavaScript. 127 // Don't save data that was submitted through JavaScript.
134 if (!form.user_submitted) 128 if (!form.user_submitted)
135 return; 129 return;
136 130
137 // We put the following restriction on stored FormFields: 131 // We put the following restriction on stored FormFields:
138 // - non-empty name 132 // - non-empty name
139 // - non-empty value 133 // - non-empty value
140 // - text field 134 // - text field
141 // - value is not a credit card number 135 // - value is not a credit card number
142 // - value is not a SSN 136 // - value is not a SSN
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 210 }
217 211
218 query_id_ = 0; 212 query_id_ = 0;
219 autofill_values_.clear(); 213 autofill_values_.clear();
220 autofill_labels_.clear(); 214 autofill_labels_.clear();
221 autofill_icons_.clear(); 215 autofill_icons_.clear();
222 autofill_unique_ids_.clear(); 216 autofill_unique_ids_.clear();
223 } 217 }
224 218
225 } // namespace autofill 219 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698