Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7137)

Unified Diff: chrome/browser/resources/options/autofill_options.js

Issue 301343002: mac: Clean up autofill integration with Address Book. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_cleanup2_base
Patch Set: Autofill test failures on Android. Undo a change to autofill_test_utils.cc. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/autofill_options.js
diff --git a/chrome/browser/resources/options/autofill_options.js b/chrome/browser/resources/options/autofill_options.js
index 65fb71964ae3b36009ec69e61533028ee7926a55..bc4c90cf7036f97ea56085d23c1f6fab26f6170e 100644
--- a/chrome/browser/resources/options/autofill_options.js
+++ b/chrome/browser/resources/options/autofill_options.js
@@ -55,6 +55,19 @@ cr.define('options', function() {
$('autofill-options-confirm').onclick = function(event) {
OptionsPage.closeOverlay();
};
+<if expr="is_macosx">
+ $('autofill-use-mac-address-book-checkbox').onchange = function(event) {
+ if (this.checked) {
+ setTimeout(function() {
+ // Prompt the user to give Chrome access to the user's Address
+ // Book, if the user was not previously prompted. The dialog that
+ // appears blocks the Chrome process, so wait for a small period of
+ // time to allow the checkbox to appear filled in.
+ chrome.send('accessAddressBook');
+ }, 10);
+ }
+ };
+</if>
// TODO(jhawkins): What happens when Autofill is disabled whilst on the
// Autofill options page?

Powered by Google App Engine
This is Rietveld 408576698