Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
| 10 // AutofillOptions class: | 10 // AutofillOptions class: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 var self = this; | 48 var self = this; |
| 49 $('autofill-add-address').onclick = function(event) { | 49 $('autofill-add-address').onclick = function(event) { |
| 50 self.showAddAddressOverlay_(); | 50 self.showAddAddressOverlay_(); |
| 51 }; | 51 }; |
| 52 $('autofill-add-creditcard').onclick = function(event) { | 52 $('autofill-add-creditcard').onclick = function(event) { |
| 53 self.showAddCreditCardOverlay_(); | 53 self.showAddCreditCardOverlay_(); |
| 54 }; | 54 }; |
| 55 $('autofill-options-confirm').onclick = function(event) { | 55 $('autofill-options-confirm').onclick = function(event) { |
| 56 OptionsPage.closeOverlay(); | 56 OptionsPage.closeOverlay(); |
| 57 }; | 57 }; |
| 58 <if expr="is_macosx"> | |
| 59 $('autofill-mac-auxiliary-profile-checkbox').onchange = function(event) { | |
| 60 if (this.checked) { | |
| 61 setTimeout(function() { | |
| 62 // Prompt the user to give Chrome access to the user's Address | |
| 63 // Book, if the user was not previously prompted. The dialog that | |
| 64 // appears blocks the Chrome process, so wait for a small period of | |
| 65 // time to allow the checkbox to appear filled in. | |
| 66 chrome.send('accessAddressBook'); | |
|
erikchen
2014/05/30 02:06:15
I assumed that we would need to refresh the list o
Ilya Sherman
2014/05/30 23:39:48
Indeed, we do not show Address Book addresses in t
| |
| 67 }, 10); | |
| 68 } | |
| 69 }; | |
| 70 </if> | |
| 58 | 71 |
| 59 // TODO(jhawkins): What happens when Autofill is disabled whilst on the | 72 // TODO(jhawkins): What happens when Autofill is disabled whilst on the |
| 60 // Autofill options page? | 73 // Autofill options page? |
| 61 }, | 74 }, |
| 62 | 75 |
| 63 /** | 76 /** |
| 64 * Creates, decorates and initializes the address list. | 77 * Creates, decorates and initializes the address list. |
| 65 * @private | 78 * @private |
| 66 */ | 79 */ |
| 67 createAddressList_: function() { | 80 createAddressList_: function() { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 220 AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); |
| 208 }; | 221 }; |
| 209 | 222 |
| 210 // Export | 223 // Export |
| 211 return { | 224 return { |
| 212 AutofillOptions: AutofillOptions | 225 AutofillOptions: AutofillOptions |
| 213 }; | 226 }; |
| 214 | 227 |
| 215 }); | 228 }); |
| 216 | 229 |
| OLD | NEW |