| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // | 5 // |
| 6 // PersonalOptions class | 6 // PersonalOptions class |
| 7 // Encapsulated handling of personal options page. | 7 // Encapsulated handling of personal options page. |
| 8 // | 8 // |
| 9 function PersonalOptions() { | 9 function PersonalOptions() { |
| 10 OptionsPage.call(this, 'personal', templateData.personalPage, 'personalPage'); | 10 OptionsPage.call(this, 'personal', templateData.personalPage, 'personalPage'); |
| 11 } | 11 } |
| 12 | 12 |
| 13 cr.addSingletonGetter(PersonalOptions); | 13 cr.addSingletonGetter(PersonalOptions); |
| 14 | 14 |
| 15 PersonalOptions.prototype = { | 15 PersonalOptions.prototype = { |
| 16 // Inherit PersonalOptions from OptionsPage. | 16 // Inherit PersonalOptions from OptionsPage. |
| 17 __proto__: OptionsPage.prototype, | 17 __proto__: OptionsPage.prototype, |
| 18 | 18 |
| 19 // Initialize PersonalOptions page. | 19 // Initialize PersonalOptions page. |
| 20 initializePage: function() { | 20 initializePage: function() { |
| 21 // Call base class implementation to starts preference initialization. | 21 // Call base class implementation to starts preference initialization. |
| 22 OptionsPage.prototype.initializePage.call(this); | 22 OptionsPage.prototype.initializePage.call(this); |
| 23 | 23 |
| 24 | 24 // TODO(csilv): add any needed initialization here or delete this method. |
| 25 // Listen to pref changes. | 25 } |
| 26 Preferences.getInstance().addEventListener('sync.has_setup_completed', | |
| 27 function(event) { | |
| 28 if(event.value){ | |
| 29 $('text-when-synced').style.display = 'block'; | |
| 30 $('button-when-synced').style.display = 'block'; | |
| 31 } | |
| 32 else{ | |
| 33 $('text-when-not-synced').style.display = 'block'; | |
| 34 $('button-when-not-synced').style.display = 'block'; | |
| 35 } | |
| 36 }); | |
| 37 | |
| 38 $('sync-customize').onclick = function(event){ | |
| 39 OptionsPage.showPageByName('sync'); | |
| 40 }; | |
| 41 | |
| 42 $('showpasswords').onclick = function(event){ | |
| 43 //TODO(sargrass): Show passwords dialog here. | |
| 44 }; | |
| 45 | |
| 46 $('autofill_options').onclick = function(event){ | |
| 47 //TODO(sargrass): Show autofill dialog here. | |
| 48 }; | |
| 49 | |
| 50 $('import_data').onclick = function(event){ | |
| 51 //TODO(sargrass): Show import_data dialog here. | |
| 52 }; | |
| 53 | |
| 54 if(navigator.platform.match(/linux|BSD/i)){ | |
| 55 $('themes_GTK_button').onclick = function(event){ | |
| 56 //TODO(sargrass): Show themes GTK dialog here. | |
| 57 }; | |
| 58 | |
| 59 $('themes_set_classic').onclick = function(event){ | |
| 60 //TODO(sargrass): Show themes set classic dialog here. | |
| 61 }; | |
| 62 } | |
| 63 | |
| 64 if(navigator.platform.match(/Mac|Win|CrOS/i)){ | |
| 65 $('themes_reset').onclick = function(event){ | |
| 66 //TODO(sargrass): Show themes reset dialog here. | |
| 67 }; | |
| 68 } | |
| 69 | |
| 70 }, | |
| 71 }; | 26 }; |
| OLD | NEW |