Chromium Code Reviews| 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..66d5d007378d55861348e319de9596d39befbf01 100644 |
| --- a/chrome/browser/resources/options/personal_options.js |
| +++ b/chrome/browser/resources/options/personal_options.js |
| @@ -100,15 +100,21 @@ 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(); |
| + 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'); |
|
arv (Not doing code reviews)
2011/01/21 23:57:29
This seems backwards.
We should not dispatch fake
|
| + } |
| syncCheckboxes[i].disabled = true; |
| } |