| OLD | NEW |
| 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/string16.h" | 10 #include "base/string16.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_) | 127 if (!*autofill_enabled_) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 if (browser_context_->IsOffTheRecord()) | 130 if (external_delegate_ && external_delegate_->ShouldIgnoreFormData()) |
| 131 return; | 131 return; |
| 132 | 132 |
| 133 // Don't save data that was submitted through JavaScript. | 133 // Don't save data that was submitted through JavaScript. |
| 134 if (!form.user_submitted) | 134 if (!form.user_submitted) |
| 135 return; | 135 return; |
| 136 | 136 |
| 137 // We put the following restriction on stored FormFields: | 137 // We put the following restriction on stored FormFields: |
| 138 // - non-empty name | 138 // - non-empty name |
| 139 // - non-empty value | 139 // - non-empty value |
| 140 // - text field | 140 // - text field |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 query_id_ = 0; | 218 query_id_ = 0; |
| 219 autofill_values_.clear(); | 219 autofill_values_.clear(); |
| 220 autofill_labels_.clear(); | 220 autofill_labels_.clear(); |
| 221 autofill_icons_.clear(); | 221 autofill_icons_.clear(); |
| 222 autofill_unique_ids_.clear(); | 222 autofill_unique_ids_.clear(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace autofill | 225 } // namespace autofill |
| OLD | NEW |