summaryrefslogtreecommitdiffstats
path: root/components/autofill/content
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 01:14:43 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 01:14:43 +0000
commit51fc5d1026240e1a9b9ef13360c3b38e420a68bf (patch)
tree81bd586977906647ed4a2f5814167aa95ca1d5aa /components/autofill/content
parentc0e32201516296da5b4f3e1e39867330f44fbc0d (diff)
downloadchromium_src-51fc5d1026240e1a9b9ef13360c3b38e420a68bf.zip
chromium_src-51fc5d1026240e1a9b9ef13360c3b38e420a68bf.tar.gz
chromium_src-51fc5d1026240e1a9b9ef13360c3b38e420a68bf.tar.bz2
rAc: change how enabling/disabling Autofill affects requestAutocomplete().
Before, disabling Autofill would cause form.requestAutocomplete() to simply dispatch an AutocompleteErrorEvent with a reason of "disabled". Now, disabling Autofill and invoking rAc still shows the dialog with no ability to save or display Autofill data. This is a step forward for web authors as they can use our dialog with higher confidence of it always being there while privacy-centric users can also be happy. I should note that requestAutocomplete() still requires a user action to be invoked, so a page will still need to do something like: button.onclick = function() { form.requestAutocomplete(); }; to invoke the dialog, which I believe will be mitigation for a majority of bad actors attempting to misuse rAc. BUG=342942 R=estade@chromium.org TEST=unit_tests, chrome://settings/search#autofill, [ /x] Enable Autofill... while requestAutocomplete() dialog is showing Review URL: https://codereview.chromium.org/145183004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252442 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill/content')
-rw-r--r--components/autofill/content/browser/request_autocomplete_manager.cc7
-rw-r--r--components/autofill/content/browser/request_autocomplete_manager_unittest.cc4
2 files changed, 2 insertions, 9 deletions
diff --git a/components/autofill/content/browser/request_autocomplete_manager.cc b/components/autofill/content/browser/request_autocomplete_manager.cc
index 79b0121..9f70b93 100644
--- a/components/autofill/content/browser/request_autocomplete_manager.cc
+++ b/components/autofill/content/browser/request_autocomplete_manager.cc
@@ -30,13 +30,6 @@ void RequestAutocompleteManager::OnRequestAutocomplete(
if (!IsValidFormData(form))
return;
- if (!autofill_driver_->autofill_manager()->IsAutofillEnabled()) {
- ReturnAutocompleteResult(
- blink::WebFormElement::AutocompleteResultErrorDisabled,
- FormData());
- return;
- }
-
base::Callback<void(const FormStructure*)> callback =
base::Bind(&RequestAutocompleteManager::ReturnAutocompleteData,
weak_ptr_factory_.GetWeakPtr());
diff --git a/components/autofill/content/browser/request_autocomplete_manager_unittest.cc b/components/autofill/content/browser/request_autocomplete_manager_unittest.cc
index cf6ec40..72fae80 100644
--- a/components/autofill/content/browser/request_autocomplete_manager_unittest.cc
+++ b/components/autofill/content/browser/request_autocomplete_manager_unittest.cc
@@ -153,12 +153,12 @@ TEST_F(RequestAutocompleteManagerTest, OnRequestAutocompleteCancel) {
}
TEST_F(RequestAutocompleteManagerTest,
- OnRequestAutocompleteWithAutocompleteDisabled) {
+ OnRequestAutocompleteWithAutofillDisabled) {
blink::WebFormElement::AutocompleteResult result;
driver_->mock_autofill_manager()->set_autofill_enabled(false);
request_autocomplete_manager_->OnRequestAutocomplete(FormData(), GURL());
EXPECT_TRUE(GetAutocompleteResultMessage(&result));
- EXPECT_EQ(result, blink::WebFormElement::AutocompleteResultErrorDisabled);
+ EXPECT_EQ(result, blink::WebFormElement::AutocompleteResultSuccess);
}
} // namespace autofill