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

Side by Side Diff: chrome/browser/resources/options/sync_setup_overlay.js

Issue 1868273002: Enhanced Sync Confirmation modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dan's comments + rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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.exportPath('options'); 5 cr.exportPath('options');
6 6
7 /** @typedef {{appsEnforced: boolean, 7 /** @typedef {{appsEnforced: boolean,
8 * appsRegistered: boolean, 8 * appsRegistered: boolean,
9 * appsSynced: boolean, 9 * appsSynced: boolean,
10 * autofillEnforced: boolean, 10 * autofillEnforced: boolean,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 $('basic-encryption-option').onchange = 137 $('basic-encryption-option').onchange =
138 $('full-encryption-option').onchange = function() { 138 $('full-encryption-option').onchange = function() {
139 self.onEncryptionRadioChanged_(); 139 self.onEncryptionRadioChanged_();
140 }; 140 };
141 $('choose-datatypes-cancel').onclick = 141 $('choose-datatypes-cancel').onclick =
142 $('confirm-everything-cancel').onclick = 142 $('confirm-everything-cancel').onclick =
143 $('stop-syncing-cancel').onclick = 143 $('stop-syncing-cancel').onclick =
144 $('sync-spinner-cancel').onclick = function() { 144 $('sync-spinner-cancel').onclick = function() {
145 self.closeOverlay_(); 145 self.closeOverlay_();
146 }; 146 };
147 $('activity-controls').onclick = function() {
148 chrome.metricsPrivate.recordUserAction(
149 'Signin_AccountSettings_GoogleActivityControlsClicked');
150 };
147 $('confirm-everything-ok').onclick = function() { 151 $('confirm-everything-ok').onclick = function() {
148 self.sendConfiguration_(); 152 self.sendConfiguration_();
149 }; 153 };
150 $('timeout-ok').onclick = function() { 154 $('timeout-ok').onclick = function() {
151 chrome.send('CloseTimeout'); 155 chrome.send('CloseTimeout');
152 self.closeOverlay_(); 156 self.closeOverlay_();
153 }; 157 };
154 $('stop-syncing-ok').onclick = function() { 158 $('stop-syncing-ok').onclick = function() {
155 var deleteProfile = $('delete-profile') != undefined && 159 var deleteProfile = $('delete-profile') != undefined &&
156 $('delete-profile').checked; 160 $('delete-profile').checked;
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 // Reset the selection to 'Sync nothing'. 640 // Reset the selection to 'Sync nothing'.
637 $('sync-select-datatypes').selectedIndex = 641 $('sync-select-datatypes').selectedIndex =
638 options.DataTypeSelection.SYNC_NOTHING; 642 options.DataTypeSelection.SYNC_NOTHING;
639 643
640 // Uncheck and disable the individual data type checkboxes. 644 // Uncheck and disable the individual data type checkboxes.
641 this.checkAllDataTypeCheckboxes_(false); 645 this.checkAllDataTypeCheckboxes_(false);
642 this.setDataTypeCheckboxesEnabled_(false); 646 this.setDataTypeCheckboxesEnabled_(false);
643 647
644 // Hide the encryption section. 648 // Hide the encryption section.
645 $('customize-sync-encryption-new').hidden = true; 649 $('customize-sync-encryption-new').hidden = true;
650 $('personalize-google-services').hidden = true;
646 $('sync-custom-passphrase-container').hidden = true; 651 $('sync-custom-passphrase-container').hidden = true;
647 $('sync-existing-passphrase-container').hidden = true; 652 $('sync-existing-passphrase-container').hidden = true;
648 653
649 // Hide the "use default settings" link. 654 // Hide the "use default settings" link.
650 $('use-default-link').hidden = true; 655 $('use-default-link').hidden = true;
651 }, 656 },
652 657
653 /** 658 /**
654 * Reveals the UI for entering a custom passphrase during initial setup. 659 * Reveals the UI for entering a custom passphrase during initial setup.
655 * This happens if the user has previously enabled a custom passphrase on a 660 * This happens if the user has previously enabled a custom passphrase on a
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 * @param {options.DataTypeSelection} index Index of item to pre-select. 700 * @param {options.DataTypeSelection} index Index of item to pre-select.
696 * @private 701 * @private
697 */ 702 */
698 showCustomizePage_: function(args, index) { 703 showCustomizePage_: function(args, index) {
699 $('confirm-sync-preferences').hidden = true; 704 $('confirm-sync-preferences').hidden = true;
700 $('customize-sync-preferences').hidden = false; 705 $('customize-sync-preferences').hidden = false;
701 706
702 $('sync-custom-passphrase-container').hidden = false; 707 $('sync-custom-passphrase-container').hidden = false;
703 $('sync-new-encryption-section-container').hidden = false; 708 $('sync-new-encryption-section-container').hidden = false;
704 $('customize-sync-encryption-new').hidden = !args.encryptAllDataAllowed; 709 $('customize-sync-encryption-new').hidden = !args.encryptAllDataAllowed;
710 $('personalize-google-services').hidden = false;
705 711
706 $('sync-existing-passphrase-container').hidden = true; 712 $('sync-existing-passphrase-container').hidden = true;
707 713
708 $('sync-select-datatypes').selectedIndex = index; 714 $('sync-select-datatypes').selectedIndex = index;
709 this.setDataTypeCheckboxesEnabled_( 715 this.setDataTypeCheckboxesEnabled_(
710 index == options.DataTypeSelection.CHOOSE_WHAT_TO_SYNC); 716 index == options.DataTypeSelection.CHOOSE_WHAT_TO_SYNC);
711 717
712 if (args.showPassphrase) { 718 if (args.showPassphrase) {
713 this.showPassphraseContainer_(args); 719 this.showPassphraseContainer_(args);
714 // TODO(dbeam): add an #updatePassphrase and only focus with that hash? 720 // TODO(dbeam): add an #updatePassphrase and only focus with that hash?
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 'showSyncSetupPage', 873 'showSyncSetupPage',
868 'showCustomizePage', 874 'showCustomizePage',
869 'showStopSyncingUI', 875 'showStopSyncingUI',
870 ]); 876 ]);
871 877
872 // Export 878 // Export
873 return { 879 return {
874 SyncSetupOverlay: SyncSetupOverlay 880 SyncSetupOverlay: SyncSetupOverlay
875 }; 881 };
876 }); 882 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698