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 "chrome/browser/autofill/autocomplete_history_manager.h" | 5 #include "chrome/browser/autofill/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" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/autofill/autofill_external_delegate.h" | 13 #include "chrome/browser/autofill/autofill_external_delegate.h" |
14 #include "chrome/browser/autofill/validation.h" | 14 #include "chrome/browser/autofill/validation.h" |
15 #include "chrome/common/autofill_messages.h" | 15 #include "chrome/common/autofill_messages.h" |
16 #include "chrome/common/form_data.h" | 16 #include "chrome/common/form_data.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "components/user_prefs/user_prefs.h" |
18 #include "content/public/browser/browser_context.h" | 19 #include "content/public/browser/browser_context.h" |
19 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
21 | 22 |
22 using base::StringPiece16; | 23 using base::StringPiece16; |
23 using content::BrowserContext; | 24 using content::BrowserContext; |
24 using content::WebContents; | 25 using content::WebContents; |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 109 |
109 AutocompleteHistoryManager::AutocompleteHistoryManager( | 110 AutocompleteHistoryManager::AutocompleteHistoryManager( |
110 WebContents* web_contents) | 111 WebContents* web_contents) |
111 : content::WebContentsObserver(web_contents), | 112 : content::WebContentsObserver(web_contents), |
112 browser_context_(web_contents->GetBrowserContext()), | 113 browser_context_(web_contents->GetBrowserContext()), |
113 autofill_data_( | 114 autofill_data_( |
114 AutofillWebDataService::FromBrowserContext(browser_context_)), | 115 AutofillWebDataService::FromBrowserContext(browser_context_)), |
115 pending_query_handle_(0), | 116 pending_query_handle_(0), |
116 query_id_(0), | 117 query_id_(0), |
117 external_delegate_(NULL) { | 118 external_delegate_(NULL) { |
118 autofill_enabled_.Init(prefs::kAutofillEnabled, | 119 autofill_enabled_.Init( |
119 PrefServiceFromBrowserContext(browser_context_)); | 120 prefs::kAutofillEnabled, |
| 121 components::UserPrefs::Get(browser_context_)); |
120 } | 122 } |
121 | 123 |
122 AutocompleteHistoryManager::~AutocompleteHistoryManager() { | 124 AutocompleteHistoryManager::~AutocompleteHistoryManager() { |
123 CancelPendingQuery(); | 125 CancelPendingQuery(); |
124 } | 126 } |
125 | 127 |
126 bool AutocompleteHistoryManager::OnMessageReceived( | 128 bool AutocompleteHistoryManager::OnMessageReceived( |
127 const IPC::Message& message) { | 129 const IPC::Message& message) { |
128 bool handled = true; | 130 bool handled = true; |
129 IPC_BEGIN_MESSAGE_MAP(AutocompleteHistoryManager, message) | 131 IPC_BEGIN_MESSAGE_MAP(AutocompleteHistoryManager, message) |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 autofill_icons_, | 280 autofill_icons_, |
279 autofill_unique_ids_)); | 281 autofill_unique_ids_)); |
280 } | 282 } |
281 | 283 |
282 query_id_ = 0; | 284 query_id_ = 0; |
283 autofill_values_.clear(); | 285 autofill_values_.clear(); |
284 autofill_labels_.clear(); | 286 autofill_labels_.clear(); |
285 autofill_icons_.clear(); | 287 autofill_icons_.clear(); |
286 autofill_unique_ids_.clear(); | 288 autofill_unique_ids_.clear(); |
287 } | 289 } |
OLD | NEW |