| OLD | NEW |
| 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/autofill_manager.h" | 5 #include "chrome/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/tab_contents/web_contents.h" | 9 #include "chrome/browser/tab_contents/web_contents.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/common/pref_service.h" |
| 12 |
| 13 // static |
| 14 void AutofillManager::RegisterUserPrefs(PrefService* prefs) { |
| 15 prefs->RegisterBooleanPref(prefs::kFormAutofillEnabled, true); |
| 16 } |
| 11 | 17 |
| 12 AutofillManager::AutofillManager(WebContents* web_contents) : | 18 AutofillManager::AutofillManager(WebContents* web_contents) : |
| 13 web_contents_(web_contents), | 19 web_contents_(web_contents), |
| 14 pending_query_handle_(0), | 20 pending_query_handle_(0), |
| 15 node_id_(0), | 21 node_id_(0), |
| 16 request_id_(0) { | 22 request_id_(0) { |
| 17 form_autofill_enabled_.Init(prefs::kFormAutofillEnabled, | 23 form_autofill_enabled_.Init(prefs::kFormAutofillEnabled, |
| 18 profile()->GetPrefs(), NULL); | 24 profile()->GetPrefs(), NULL); |
| 19 } | 25 } |
| 20 | 26 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 const AutofillForm& form) { | 107 const AutofillForm& form) { |
| 102 if (!*form_autofill_enabled_) | 108 if (!*form_autofill_enabled_) |
| 103 return; | 109 return; |
| 104 | 110 |
| 105 if (profile()->IsOffTheRecord()) | 111 if (profile()->IsOffTheRecord()) |
| 106 return; | 112 return; |
| 107 | 113 |
| 108 profile()->GetWebDataService(Profile::EXPLICIT_ACCESS)-> | 114 profile()->GetWebDataService(Profile::EXPLICIT_ACCESS)-> |
| 109 AddAutofillFormElements(form.elements); | 115 AddAutofillFormElements(form.elements); |
| 110 } | 116 } |
| OLD | NEW |