| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 field.form_control_type == "search" || | 102 field.form_control_type == "search" || |
| 103 field.form_control_type == "tel" || | 103 field.form_control_type == "tel" || |
| 104 field.form_control_type == "url" || | 104 field.form_control_type == "url" || |
| 105 field.form_control_type == "email" || | 105 field.form_control_type == "email" || |
| 106 field.form_control_type == "text"; | 106 field.form_control_type == "text"; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace | 109 } // namespace |
| 110 | 110 |
| 111 AutocompleteHistoryManager::AutocompleteHistoryManager( | 111 AutocompleteHistoryManager::AutocompleteHistoryManager( |
| 112 WebContents* web_contents) | 112 WebContents* web_contents, |
| 113 scoped_refptr<AutofillWebDataService> autofill_data) |
| 113 : content::WebContentsObserver(web_contents), | 114 : content::WebContentsObserver(web_contents), |
| 114 browser_context_(web_contents->GetBrowserContext()), | 115 browser_context_(web_contents->GetBrowserContext()), |
| 115 autofill_data_( | 116 autofill_data_(autofill_data), |
| 116 AutofillWebDataService::FromBrowserContext(browser_context_)), | |
| 117 pending_query_handle_(0), | 117 pending_query_handle_(0), |
| 118 query_id_(0), | 118 query_id_(0), |
| 119 external_delegate_(NULL) { | 119 external_delegate_(NULL) { |
| 120 autofill_enabled_.Init( | 120 autofill_enabled_.Init( |
| 121 prefs::kAutofillEnabled, | 121 prefs::kAutofillEnabled, |
| 122 components::UserPrefs::Get(browser_context_)); | 122 components::UserPrefs::Get(browser_context_)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 AutocompleteHistoryManager::~AutocompleteHistoryManager() { | 125 AutocompleteHistoryManager::~AutocompleteHistoryManager() { |
| 126 CancelPendingQuery(); | 126 CancelPendingQuery(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 283 } |
| 284 | 284 |
| 285 query_id_ = 0; | 285 query_id_ = 0; |
| 286 autofill_values_.clear(); | 286 autofill_values_.clear(); |
| 287 autofill_labels_.clear(); | 287 autofill_labels_.clear(); |
| 288 autofill_icons_.clear(); | 288 autofill_icons_.clear(); |
| 289 autofill_unique_ids_.clear(); | 289 autofill_unique_ids_.clear(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace autofill | 292 } // namespace autofill |
| OLD | NEW |