summaryrefslogtreecommitdiffstats
path: root/components/autofill/content/renderer/autofill_agent.cc
diff options
context:
space:
mode:
authorerikchen@chromium.org <erikchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 05:14:36 +0000
committererikchen@chromium.org <erikchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 05:14:36 +0000
commit27cd8ff93067dafdd8aa90eceb83625fb1c9e4fd (patch)
treeb4b7eff44bd28deb757714f45d23afe46d6c7935 /components/autofill/content/renderer/autofill_agent.cc
parentae37c4561a23368438671ce73c76c8f5e85f2068 (diff)
downloadchromium_src-27cd8ff93067dafdd8aa90eceb83625fb1c9e4fd.zip
chromium_src-27cd8ff93067dafdd8aa90eceb83625fb1c9e4fd.tar.gz
chromium_src-27cd8ff93067dafdd8aa90eceb83625fb1c9e4fd.tar.bz2
Mac: Autofill should not immediately request access to address book.
If the browser does not yet have permission to access the user's contacts, one of the Autofill suggestions has the text "Enable Autofill using Contacts". If the user selects that suggestion, the browser will prompt the user for access to the user's address book. The act of clicking the permissions dialog causes Blink to lose its focus on the text field, which also dismisses the Autofill popup. If the user has granted Chrome access to the address book, the autofill popup will be presented again, and filled in. This CL does not include the image asset, nor does it include the logic to display the image asset on the left of the autofill entry. BUG=139154 TEST=Run the command `tccutil reset AddressBook` to reset AddressBook permissions for all applications. Clear the default Chromium profile: `rm -rf ~/Library/Application\ Support/Chromium/Default/`. Launch Chromium by double clicking on it from Finder. Navigate to `https://www.mycontactform.com/samples/change_address.php`. Double click the "First Name" field. There should not be a prompt to access your "Contacts". There should be exactly 1 autofill entry: "Enable Autofill using Contacts...". Clicking that autofill entry should open a system prompt that asks for Contacts permissions for Chromium. Review URL: https://codereview.chromium.org/286243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill/content/renderer/autofill_agent.cc')
-rw-r--r--components/autofill/content/renderer/autofill_agent.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index bcc9a4a..bfd5731 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -150,6 +150,7 @@ AutofillAgent::~AutofillAgent() {}
bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AutofillAgent, message)
+ IPC_MESSAGE_HANDLER(AutofillMsg_Ping, OnPing)
IPC_MESSAGE_HANDLER(AutofillMsg_FillForm, OnFillForm)
IPC_MESSAGE_HANDLER(AutofillMsg_PreviewForm, OnPreviewForm)
IPC_MESSAGE_HANDLER(AutofillMsg_FieldTypePredictionsAvailable,
@@ -454,6 +455,10 @@ void AutofillAgent::OnFillForm(int query_id, const FormData& form) {
base::TimeTicks::Now()));
}
+void AutofillAgent::OnPing() {
+ Send(new AutofillHostMsg_PingAck(routing_id()));
+}
+
void AutofillAgent::OnPreviewForm(int query_id, const FormData& form) {
if (!render_view()->GetWebView() || query_id != autofill_query_id_)
return;