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

Side by Side Diff: chrome/browser/autocomplete_history_manager.cc

Issue 3286006: Revert 55661 - Merge 55626 - Not store autocomplete entries in DB for forms s... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/autocomplete_history_manager.h" 5 #include "chrome/browser/autocomplete_history_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 void AutocompleteHistoryManager::StoreFormEntriesInWebDatabase( 142 void AutocompleteHistoryManager::StoreFormEntriesInWebDatabase(
143 const FormData& form) { 143 const FormData& form) {
144 if (!*autofill_enabled_) 144 if (!*autofill_enabled_)
145 return; 145 return;
146 146
147 if (profile_->IsOffTheRecord()) 147 if (profile_->IsOffTheRecord())
148 return; 148 return;
149 149
150 // Don't save data that was submitted through JavaScript.
151 if (!form.user_submitted)
152 return;
153
154 // We put the following restriction on stored FormFields: 150 // We put the following restriction on stored FormFields:
155 // - non-empty name 151 // - non-empty name
156 // - non-empty value 152 // - non-empty value
157 // - text field 153 // - text field
158 // - value is not a credit card number 154 // - value is not a credit card number
159 // - value is not a SSN 155 // - value is not a SSN
160 std::vector<webkit_glue::FormField> values; 156 std::vector<webkit_glue::FormField> values;
161 for (std::vector<webkit_glue::FormField>::const_iterator iter = 157 for (std::vector<webkit_glue::FormField>::const_iterator iter =
162 form.fields.begin(); 158 form.fields.begin();
163 iter != form.fields.end(); ++iter) { 159 iter != form.fields.end(); ++iter) {
(...skipping 18 matching lines...) Expand all
182 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); 178 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT);
183 const WDResult<std::vector<string16> >* autofill_result = 179 const WDResult<std::vector<string16> >* autofill_result =
184 static_cast<const WDResult<std::vector<string16> >*>(result); 180 static_cast<const WDResult<std::vector<string16> >*>(result);
185 host->AutocompleteSuggestionsReturned( 181 host->AutocompleteSuggestionsReturned(
186 query_id_, autofill_result->GetValue()); 182 query_id_, autofill_result->GetValue());
187 } else { 183 } else {
188 host->AutocompleteSuggestionsReturned( 184 host->AutocompleteSuggestionsReturned(
189 query_id_, std::vector<string16>()); 185 query_id_, std::vector<string16>());
190 } 186 }
191 } 187 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698