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 7a92a942ffa5a479de46eb472358ef9256cbfc8a..17952e4057b1810eea0f1b36fad39f0bbd4e9936 100644 |
--- a/chrome/browser/resources/options/personal_options.js |
+++ b/chrome/browser/resources/options/personal_options.js |
@@ -100,17 +100,20 @@ cr.define('options', 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++) { |
- // Merely setting checked = true is not enough to trigger the pref |
- // being set; thus, we simulate the click. |
- if (!syncCheckboxes[i].checked) |
- syncCheckboxes[i].click(); |
- |
+ syncCheckboxes[i].checked = true; |
syncCheckboxes[i].disabled = true; |
+ |
+ // Merely setting checked = true is not enough to trigger the pref |
+ // being set; thus, we dispatch a change even to notify PrefCheckbox |
+ // |checked| has changed. |
+ cr.dispatchSimpleEvent(syncCheckboxes[i], 'change') |
stuartmorgan
2011/01/20 18:19:42
Shouldn't you only send this if it wasn't previous
James Hawkins
2011/01/20 18:25:13
Done.
|
} |
} |
}, |