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

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

Issue 6325016: DOMUI: Revert back to v1 sync UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/browser/resources/options/personal_options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/personal_options.js
diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js
index 66d5d007378d55861348e319de9596d39befbf01..91a7484cc1173abeaf6e825fab71bb89dae79783 100644
--- a/chrome/browser/resources/options/personal_options.js
+++ b/chrome/browser/resources/options/personal_options.js
@@ -40,6 +40,9 @@ cr.define('options', function() {
else
chrome.send('showSyncLoginDialog');
};
+ $('customize-sync').onclick = function(event) {
+ chrome.send('showCustomizeSyncDialog');
+ };
$('privacy-dashboard-link').onclick = function(event) {
chrome.send('openPrivacyDashboardTabAndActivate');
};
@@ -58,20 +61,6 @@ cr.define('options', function() {
chrome.send('themesReset');
};
- // Initialize sync select control.
- $('sync-select').onchange = function(event) {
- self.updateSyncSelection_();
- }
-
- var syncCheckboxes = $('sync-table').getElementsByTagName('input');
- for (var i = 0; i < syncCheckboxes.length; i++) {
- if (syncCheckboxes[i].type == "checkbox") {
- syncCheckboxes[i].onclick = function(event) {
- chrome.send('updatePreferredDataTypes');
- };
- }
- }
-
if (!cr.isChromeOS) {
$('import-data').onclick = function(event) {
OptionsPage.showOverlay('importDataOverlay');
@@ -92,35 +81,6 @@ cr.define('options', function() {
$('enable-screen-lock').disabled = true;
},
- /**
- * Updates the sync datatype checkboxes based on the selected sync option.
- * @private
- */
- updateSyncSelection_: function() {
- var idx = $('sync-select').selectedIndex;
- var syncCheckboxes = $('sync-table').getElementsByTagName('input');
- if (idx == 0) {
- // 'Choose what to sync.'
- for (var i = 0; i < syncCheckboxes.length; i++) {
- syncCheckboxes[i].disabled = false;
- }
- } else if (idx == 1) {
- // 'Everything' is synced.
- for (var i = 0; i < syncCheckboxes.length; i++) {
- if (!syncCheckboxes[i].checked) {
- syncCheckboxes[i].checked = true;
-
- // Merely setting checked = true is not enough to trigger the pref
- // being set; thus, we dispatch a change event to notify
- // PrefCheckbox |checked| has changed.
- cr.dispatchSimpleEvent(syncCheckboxes[i], 'change');
- }
-
- syncCheckboxes[i].disabled = true;
- }
- }
- },
-
showStopSyncingOverlay_: function(event) {
AlertOverlay.show(localStrings.getString('stop_syncing_title'),
localStrings.getString('stop_syncing_explanation'),
@@ -147,6 +107,7 @@ cr.define('options', function() {
setSyncSetupCompleted_: function(completed) {
this.syncSetupCompleted = completed;
+ this.setElementVisible_($('customize-sync'), completed);
},
setAccountPicture_: function(image) {
« no previous file with comments | « chrome/browser/resources/options/personal_options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698