| 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. | |
| 11 var syncEnabled = false; | |
| 12 var syncSetupCompleted = false; | |
| 13 | |
| 14 /** | 10 /** |
| 15 * Encapsulated handling of personal options page. | 11 * Encapsulated handling of personal options page. |
| 16 * @constructor | 12 * @constructor |
| 17 */ | 13 */ |
| 18 function PersonalOptions() { | 14 function PersonalOptions() { |
| 19 OptionsPage.call(this, 'personal', | 15 OptionsPage.call(this, 'personal', |
| 20 templateData.personalPageTabTitle, | 16 templateData.personalPageTabTitle, |
| 21 'personal-page'); | 17 'personal-page'); |
| 22 if (cr.isChromeOS) { | 18 if (cr.isChromeOS) { |
| 23 // Email of the currently logged in user (or |kGuestUser|). | 19 // Email of the currently logged in user (or |kGuestUser|). |
| 24 this.userEmail_ = localStrings.getString('userEmail'); | 20 this.userEmail_ = localStrings.getString('userEmail'); |
| 25 } | 21 } |
| 26 } | 22 } |
| 27 | 23 |
| 28 cr.addSingletonGetter(PersonalOptions); | 24 cr.addSingletonGetter(PersonalOptions); |
| 29 | 25 |
| 30 PersonalOptions.prototype = { | 26 PersonalOptions.prototype = { |
| 31 // Inherit PersonalOptions from OptionsPage. | 27 // Inherit PersonalOptions from OptionsPage. |
| 32 __proto__: options.OptionsPage.prototype, | 28 __proto__: options.OptionsPage.prototype, |
| 33 | 29 |
| 30 // State variables. |
| 31 syncEnabled: false, |
| 32 syncSetupCompleted: false, |
| 33 |
| 34 // Initialize PersonalOptions page. | 34 // Initialize PersonalOptions page. |
| 35 initializePage: function() { | 35 initializePage: function() { |
| 36 // Call base class implementation to start preference initialization. | 36 // Call base class implementation to start preference initialization. |
| 37 OptionsPage.prototype.initializePage.call(this); | 37 OptionsPage.prototype.initializePage.call(this); |
| 38 | 38 |
| 39 var self = this; | 39 var self = this; |
| 40 | 40 |
| 41 // Sync. | 41 // Sync. |
| 42 $('sync-action-link').onclick = function(event) { | 42 $('sync-action-link').onclick = function(event) { |
| 43 SyncSetupOverlay.showErrorUI(); | 43 SyncSetupOverlay.showErrorUI(); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 PersonalOptions.getInstance()[name + '_'](value); | 352 PersonalOptions.getInstance()[name + '_'](value); |
| 353 }; | 353 }; |
| 354 }); | 354 }); |
| 355 | 355 |
| 356 // Export | 356 // Export |
| 357 return { | 357 return { |
| 358 PersonalOptions: PersonalOptions | 358 PersonalOptions: PersonalOptions |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 }); | 361 }); |
| OLD | NEW |