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

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

Issue 3145007: Merge 55626 - Not store autocomplete entries in DB for forms submitted using ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 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
« 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
150 // We put the following restriction on stored FormFields: 154 // We put the following restriction on stored FormFields:
151 // - non-empty name 155 // - non-empty name
152 // - non-empty value 156 // - non-empty value
153 // - text field 157 // - text field
154 // - value is not a credit card number 158 // - value is not a credit card number
155 // - value is not a SSN 159 // - value is not a SSN
156 std::vector<webkit_glue::FormField> values; 160 std::vector<webkit_glue::FormField> values;
157 for (std::vector<webkit_glue::FormField>::const_iterator iter = 161 for (std::vector<webkit_glue::FormField>::const_iterator iter =
158 form.fields.begin(); 162 form.fields.begin();
159 iter != form.fields.end(); ++iter) { 163 iter != form.fields.end(); ++iter) {
(...skipping 18 matching lines...) Expand all
178 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); 182 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT);
179 const WDResult<std::vector<string16> >* autofill_result = 183 const WDResult<std::vector<string16> >* autofill_result =
180 static_cast<const WDResult<std::vector<string16> >*>(result); 184 static_cast<const WDResult<std::vector<string16> >*>(result);
181 host->AutocompleteSuggestionsReturned( 185 host->AutocompleteSuggestionsReturned(
182 query_id_, autofill_result->GetValue()); 186 query_id_, autofill_result->GetValue());
183 } else { 187 } else {
184 host->AutocompleteSuggestionsReturned( 188 host->AutocompleteSuggestionsReturned(
185 query_id_, std::vector<string16>()); 189 query_id_, std::vector<string16>());
186 } 190 }
187 } 191 }
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