| 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 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 | 9 |
| 10 // State variables. | 10 // State variables. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 $('sync-overview').hidden = statusSet; | 169 $('sync-overview').hidden = statusSet; |
| 170 $('sync-status').hidden = !statusSet; | 170 $('sync-status').hidden = !statusSet; |
| 171 $('sync-status-text').innerHTML = status; | 171 $('sync-status-text').innerHTML = status; |
| 172 }, | 172 }, |
| 173 | 173 |
| 174 setSyncStatusErrorVisible_: function(visible) { | 174 setSyncStatusErrorVisible_: function(visible) { |
| 175 visible ? $('sync-status').classList.add('sync-error') : | 175 visible ? $('sync-status').classList.add('sync-error') : |
| 176 $('sync-status').classList.remove('sync-error'); | 176 $('sync-status').classList.remove('sync-error'); |
| 177 }, | 177 }, |
| 178 | 178 |
| 179 setCustomizeSyncButtonEnabled_: function(enabled) { |
| 180 $('customize-sync').disabled = !enabled; |
| 181 }, |
| 182 |
| 179 setSyncActionLinkEnabled_: function(enabled) { | 183 setSyncActionLinkEnabled_: function(enabled) { |
| 180 $('sync-action-link').disabled = !enabled; | 184 $('sync-action-link').disabled = !enabled; |
| 181 }, | 185 }, |
| 182 | 186 |
| 183 setSyncActionLinkLabel_: function(status) { | 187 setSyncActionLinkLabel_: function(status) { |
| 184 $('sync-action-link').textContent = status; | 188 $('sync-action-link').textContent = status; |
| 185 | 189 |
| 186 // link-button does is not zero-area when the contents of the button are | 190 // link-button does is not zero-area when the contents of the button are |
| 187 // empty, so explicitly hide the element. | 191 // empty, so explicitly hide the element. |
| 188 $('sync-action-link').hidden = !status.length; | 192 $('sync-action-link').hidden = !status.length; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 */ | 312 */ |
| 309 PersonalOptions.getLoggedInUserEmail = function() { | 313 PersonalOptions.getLoggedInUserEmail = function() { |
| 310 return PersonalOptions.getInstance().userEmail_; | 314 return PersonalOptions.getInstance().userEmail_; |
| 311 }; | 315 }; |
| 312 } | 316 } |
| 313 | 317 |
| 314 // Forward public APIs to private implementations. | 318 // Forward public APIs to private implementations. |
| 315 [ | 319 [ |
| 316 'hideSyncSection', | 320 'hideSyncSection', |
| 317 'setAutoLoginVisible', | 321 'setAutoLoginVisible', |
| 322 'setCustomizeSyncButtonEnabled', |
| 318 'setGtkThemeButtonEnabled', | 323 'setGtkThemeButtonEnabled', |
| 319 'setProfilesInfo', | 324 'setProfilesInfo', |
| 320 'setProfilesSectionVisible', | 325 'setProfilesSectionVisible', |
| 321 'setStartStopButtonEnabled', | 326 'setStartStopButtonEnabled', |
| 322 'setStartStopButtonLabel', | 327 'setStartStopButtonLabel', |
| 323 'setStartStopButtonVisible', | 328 'setStartStopButtonVisible', |
| 324 'setSyncActionLinkEnabled', | 329 'setSyncActionLinkEnabled', |
| 325 'setSyncActionLinkLabel', | 330 'setSyncActionLinkLabel', |
| 326 'setSyncEnabled', | 331 'setSyncEnabled', |
| 327 'setSyncSetupCompleted', | 332 'setSyncSetupCompleted', |
| 328 'setSyncStatus', | 333 'setSyncStatus', |
| 329 'setSyncStatusErrorVisible', | 334 'setSyncStatusErrorVisible', |
| 330 'setThemesResetButtonEnabled', | 335 'setThemesResetButtonEnabled', |
| 331 'updateAccountPicture', | 336 'updateAccountPicture', |
| 332 ].forEach(function(name) { | 337 ].forEach(function(name) { |
| 333 PersonalOptions[name] = function(value) { | 338 PersonalOptions[name] = function(value) { |
| 334 PersonalOptions.getInstance()[name + '_'](value); | 339 PersonalOptions.getInstance()[name + '_'](value); |
| 335 }; | 340 }; |
| 336 }); | 341 }); |
| 337 | 342 |
| 338 // Export | 343 // Export |
| 339 return { | 344 return { |
| 340 PersonalOptions: PersonalOptions | 345 PersonalOptions: PersonalOptions |
| 341 }; | 346 }; |
| 342 | 347 |
| 343 }); | 348 }); |
| OLD | NEW |