| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 // Variable to track if a captcha challenge was issued. If this gets set to | 8 // Variable to track if a captcha challenge was issued. If this gets set to |
| 9 // true, it stays that way until we are told about successful login from | 9 // true, it stays that way until we are told about successful login from |
| 10 // the browser. This means subsequent errors (like invalid password) are | 10 // the browser. This means subsequent errors (like invalid password) are |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 logo_td.parentNode.appendChild(logo_td); | 51 logo_td.parentNode.appendChild(logo_td); |
| 52 } | 52 } |
| 53 acct_text.textContent = translated_text.replace('Google',''); | 53 acct_text.textContent = translated_text.replace('Google',''); |
| 54 } | 54 } |
| 55 | 55 |
| 56 var self = this; | 56 var self = this; |
| 57 $('gaia-login-form').onsubmit = function() { | 57 $('gaia-login-form').onsubmit = function() { |
| 58 self.sendCredentialsAndClose_(); | 58 self.sendCredentialsAndClose_(); |
| 59 return false; | 59 return false; |
| 60 }; | 60 }; |
| 61 $('choose-data-types-form').onsubmit = function() { | |
| 62 self.sendConfiguration_(); | |
| 63 return false; | |
| 64 }; | |
| 65 $('google-option').onchange = $('explicit-option').onchange = function() { | 61 $('google-option').onchange = $('explicit-option').onchange = function() { |
| 66 self.onPassphraseRadioChanged_(); | 62 self.onPassphraseRadioChanged_(); |
| 67 }; | 63 }; |
| 68 $('choose-datatypes-cancel').onclick = $('sync-setup-cancel').onclick = | 64 $('choose-datatypes-cancel').onclick = $('sync-setup-cancel').onclick = |
| 69 $('confirm-everything-cancel').onclick = function() { | 65 $('confirm-everything-cancel').onclick = function() { |
| 70 self.closeOverlay_(); | 66 self.closeOverlay_(); |
| 71 }; | 67 }; |
| 72 $('customize-link').onclick = function() { | 68 $('customize-link').onclick = function() { |
| 73 self.showCustomizePage_(null, true); | 69 self.showCustomizePage_(null, true); |
| 74 }; | 70 }; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 var datatypeSelect = document.getElementById('sync-select-datatypes'); | 364 var datatypeSelect = document.getElementById('sync-select-datatypes'); |
| 369 var self = this; | 365 var self = this; |
| 370 datatypeSelect.onchange = function() { | 366 datatypeSelect.onchange = function() { |
| 371 var syncAll = this.selectedIndex == 0; | 367 var syncAll = this.selectedIndex == 0; |
| 372 self.setCheckboxesToKeepEverythingSynced_(syncAll); | 368 self.setCheckboxesToKeepEverythingSynced_(syncAll); |
| 373 }; | 369 }; |
| 374 | 370 |
| 375 this.resetPage_('sync-setup-configure'); | 371 this.resetPage_('sync-setup-configure'); |
| 376 $('sync-setup-configure').hidden = false; | 372 $('sync-setup-configure').hidden = false; |
| 377 | 373 |
| 374 // onsubmit is changed when submitting a passphrase. Reset it to its |
| 375 // default. |
| 376 $('choose-data-types-form').onsubmit = function() { |
| 377 self.sendConfiguration_(); |
| 378 return false; |
| 379 }; |
| 380 |
| 378 if (args) { | 381 if (args) { |
| 379 if (!args['encryptionEnabled']) | 382 if (!args['encryptionEnabled']) |
| 380 $('customize-sync-encryption').hidden = true; | 383 $('customize-sync-encryption').hidden = true; |
| 381 this.setCheckboxesAndErrors_(args); | 384 this.setCheckboxesAndErrors_(args); |
| 382 | 385 |
| 383 // Whether to display the 'Sync everything' confirmation page or the | 386 // Whether to display the 'Sync everything' confirmation page or the |
| 384 // customize data types page. | 387 // customize data types page. |
| 385 var keepEverythingSynced = args['keepEverythingSynced']; | 388 var keepEverythingSynced = args['keepEverythingSynced']; |
| 386 this.usePassphrase_ = args['usePassphrase']; | 389 this.usePassphrase_ = args['usePassphrase']; |
| 387 if (args['showSyncEverythingPage'] == false || this.usePassphrase_ || | 390 if (args['showSyncEverythingPage'] == false || this.usePassphrase_ || |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 727 |
| 725 SyncSetupOverlay.showSuccessAndSettingUp = function() { | 728 SyncSetupOverlay.showSuccessAndSettingUp = function() { |
| 726 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_(); | 729 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_(); |
| 727 }; | 730 }; |
| 728 | 731 |
| 729 // Export | 732 // Export |
| 730 return { | 733 return { |
| 731 SyncSetupOverlay: SyncSetupOverlay | 734 SyncSetupOverlay: SyncSetupOverlay |
| 732 }; | 735 }; |
| 733 }); | 736 }); |
| OLD | NEW |