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 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
7 | 7 |
8 // True if the synced account uses a custom passphrase. | 8 // True if the synced account uses a custom passphrase. |
9 var usePassphrase_ = false; | 9 var usePassphrase_ = false; |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 OptionsPage.call(this, 'syncSetup', | 51 OptionsPage.call(this, 'syncSetup', |
52 loadTimeData.getString('syncSetupOverlayTabTitle'), | 52 loadTimeData.getString('syncSetupOverlayTabTitle'), |
53 'sync-setup-overlay'); | 53 'sync-setup-overlay'); |
54 } | 54 } |
55 | 55 |
56 cr.addSingletonGetter(SyncSetupOverlay); | 56 cr.addSingletonGetter(SyncSetupOverlay); |
57 | 57 |
58 SyncSetupOverlay.prototype = { | 58 SyncSetupOverlay.prototype = { |
59 __proto__: OptionsPage.prototype, | 59 __proto__: OptionsPage.prototype, |
60 | 60 |
61 /** | 61 /** @override */ |
62 * Initializes the page. | |
63 */ | |
64 initializePage: function() { | 62 initializePage: function() { |
65 OptionsPage.prototype.initializePage.call(this); | 63 OptionsPage.prototype.initializePage.call(this); |
66 | 64 |
67 var self = this; | 65 var self = this; |
68 $('basic-encryption-option').onchange = | 66 $('basic-encryption-option').onchange = |
69 $('full-encryption-option').onchange = function() { | 67 $('full-encryption-option').onchange = function() { |
70 self.onEncryptionRadioChanged_(); | 68 self.onEncryptionRadioChanged_(); |
71 } | 69 }; |
72 $('choose-datatypes-cancel').onclick = | 70 $('choose-datatypes-cancel').onclick = |
73 $('confirm-everything-cancel').onclick = | 71 $('confirm-everything-cancel').onclick = |
74 $('stop-syncing-cancel').onclick = | 72 $('stop-syncing-cancel').onclick = |
75 $('sync-spinner-cancel').onclick = function() { | 73 $('sync-spinner-cancel').onclick = function() { |
76 self.closeOverlay_(); | 74 self.closeOverlay_(); |
77 }; | 75 }; |
78 $('confirm-everything-ok').onclick = function() { | 76 $('confirm-everything-ok').onclick = function() { |
79 self.sendConfiguration_(); | 77 self.sendConfiguration_(); |
80 }; | 78 }; |
81 $('timeout-ok').onclick = function() { | 79 $('timeout-ok').onclick = function() { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 */ | 282 */ |
285 setInputElementsDisabledState_: function(disabled) { | 283 setInputElementsDisabledState_: function(disabled) { |
286 var configureElements = | 284 var configureElements = |
287 $('customize-sync-preferences').querySelectorAll('input'); | 285 $('customize-sync-preferences').querySelectorAll('input'); |
288 for (var i = 0; i < configureElements.length; i++) | 286 for (var i = 0; i < configureElements.length; i++) |
289 configureElements[i].disabled = disabled; | 287 configureElements[i].disabled = disabled; |
290 $('sync-select-datatypes').disabled = disabled; | 288 $('sync-select-datatypes').disabled = disabled; |
291 | 289 |
292 $('customize-link').hidden = disabled; | 290 $('customize-link').hidden = disabled; |
293 $('customize-link').disabled = disabled; | 291 $('customize-link').disabled = disabled; |
294 $('customize-link').onclick = (disabled ? null : function() { | 292 $('customize-link').onclick = disabled ? null : function() { |
295 SyncSetupOverlay.showCustomizePage(null, | 293 SyncSetupOverlay.showCustomizePage(null, |
296 DataTypeSelection.SYNC_EVERYTHING); | 294 DataTypeSelection.SYNC_EVERYTHING); |
297 return false; | 295 return false; |
298 }); | 296 }; |
299 }, | 297 }, |
300 | 298 |
301 /** | 299 /** |
302 * Shows or hides the sync data type checkboxes in the advanced sync | 300 * Shows or hides the sync data type checkboxes in the advanced sync |
303 * settings dialog. Also initializes |dataTypeBoxes_| with their values, and | 301 * settings dialog. Also initializes |dataTypeBoxes_| with their values, and |
304 * makes their onclick handlers update |dataTypeBoxes_|. | 302 * makes their onclick handlers update |dataTypeBoxes_|. |
305 * @param {Object} args The configuration data used to show/hide UI. | 303 * @param {Object} args The configuration data used to show/hide UI. |
306 * @private | 304 * @private |
307 */ | 305 */ |
308 setChooseDataTypesCheckboxes_: function(args) { | 306 setChooseDataTypesCheckboxes_: function(args) { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 | 785 |
788 SyncSetupOverlay.showStopSyncingUI = function() { | 786 SyncSetupOverlay.showStopSyncingUI = function() { |
789 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 787 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
790 }; | 788 }; |
791 | 789 |
792 // Export | 790 // Export |
793 return { | 791 return { |
794 SyncSetupOverlay: SyncSetupOverlay | 792 SyncSetupOverlay: SyncSetupOverlay |
795 }; | 793 }; |
796 }); | 794 }); |
OLD | NEW |