| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 CancelPendingQuery(); | 68 CancelPendingQuery(); |
| 69 | 69 |
| 70 node_id_ = node_id; | 70 node_id_ = node_id; |
| 71 request_id_ = request_id; | 71 request_id_ = request_id; |
| 72 | 72 |
| 73 pending_query_handle_ = web_data_service-> | 73 pending_query_handle_ = web_data_service-> |
| 74 GetFormValuesForElementName(name, prefix, limit, this); | 74 GetFormValuesForElementName(name, prefix, limit, this); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void AutofillManager::RemoveValueForName(const std::wstring& name, |
| 78 const std::wstring& value) { |
| 79 WebDataService* web_data_service = |
| 80 profile()->GetWebDataService(Profile::EXPLICIT_ACCESS); |
| 81 if (!web_data_service) { |
| 82 NOTREACHED(); |
| 83 return; |
| 84 } |
| 85 |
| 86 web_data_service->RemoveFormValueForElementName(name, value); |
| 87 } |
| 88 |
| 77 void AutofillManager::OnWebDataServiceRequestDone(WebDataService::Handle h, | 89 void AutofillManager::OnWebDataServiceRequestDone(WebDataService::Handle h, |
| 78 const WDTypedResult* result) { | 90 const WDTypedResult* result) { |
| 79 DCHECK(pending_query_handle_); | 91 DCHECK(pending_query_handle_); |
| 80 pending_query_handle_ = 0; | 92 pending_query_handle_ = 0; |
| 81 | 93 |
| 82 if (!*form_autofill_enabled_) | 94 if (!*form_autofill_enabled_) |
| 83 return; | 95 return; |
| 84 | 96 |
| 85 DCHECK(result); | 97 DCHECK(result); |
| 86 if (!result) | 98 if (!result) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 108 const AutofillForm& form) { | 120 const AutofillForm& form) { |
| 109 if (!*form_autofill_enabled_) | 121 if (!*form_autofill_enabled_) |
| 110 return; | 122 return; |
| 111 | 123 |
| 112 if (profile()->IsOffTheRecord()) | 124 if (profile()->IsOffTheRecord()) |
| 113 return; | 125 return; |
| 114 | 126 |
| 115 profile()->GetWebDataService(Profile::EXPLICIT_ACCESS)-> | 127 profile()->GetWebDataService(Profile::EXPLICIT_ACCESS)-> |
| 116 AddAutofillFormElements(form.elements); | 128 AddAutofillFormElements(form.elements); |
| 117 } | 129 } |
| OLD | NEW |