rAc: change how enabling/disabling Autofill affects requestAutocomplete().
commit51fc5d1026240e1a9b9ef13360c3b38e420a68bf
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 21 Feb 2014 01:14:43 +0000 (21 01:14 +0000)
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 21 Feb 2014 01:14:43 +0000 (21 01:14 +0000)
tree81bd586977906647ed4a2f5814167aa95ca1d5aa
parentc0e32201516296da5b4f3e1e39867330f44fbc0d
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
14 files changed:
chrome/app/generated_resources.grd
chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
chrome/browser/ui/autofill/country_combobox_model_unittest.cc
components/autofill/content/browser/request_autocomplete_manager.cc
components/autofill/content/browser/request_autocomplete_manager_unittest.cc
components/autofill/core/browser/autofill_manager_unittest.cc
components/autofill/core/browser/autofill_metrics_unittest.cc
components/autofill/core/browser/personal_data_manager.cc
components/autofill/core/browser/personal_data_manager.h
components/autofill/core/browser/personal_data_manager_unittest.cc
components/autofill/core/browser/test_personal_data_manager.cc