| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 cr.define('options', function() { | |
| 6 var SettingsDialog = options.SettingsDialog; | |
| 7 | |
| 8 /* | |
| 9 * SpellingConfirmOverlay class | |
| 10 * Dialog to confirm that the user really wants to use the Spelling service | |
| 11 * @extends {SettingsDialog} | |
| 12 */ | |
| 13 function SpellingConfirmOverlay() { | |
| 14 SettingsDialog.call( | |
| 15 this, | |
| 16 'spellingConfirm', | |
| 17 loadTimeData.getString('spellingConfirmOverlayTabTitle'), | |
| 18 'spelling-confirm-overlay', | |
| 19 $('spelling-confirm-ok'), | |
| 20 $('spelling-confirm-cancel')); | |
| 21 }; | |
| 22 | |
| 23 cr.addSingletonGetter(SpellingConfirmOverlay); | |
| 24 | |
| 25 SpellingConfirmOverlay.prototype = { | |
| 26 __proto__: SettingsDialog.prototype, | |
| 27 | |
| 28 /** @inheritDoc */ | |
| 29 initializePage: function() { | |
| 30 SettingsDialog.prototype.initializePage.call(this); | |
| 31 }, | |
| 32 | |
| 33 /** @inheritDoc */ | |
| 34 handleConfirm: function() { | |
| 35 SettingsDialog.prototype.handleConfirm.call(this); | |
| 36 Preferences.setBooleanPref('spellcheck.use_spelling_service', | |
| 37 true, true); | |
| 38 Preferences.setBooleanPref('spellcheck.confirm_dialog_shown', | |
| 39 true, true); | |
| 40 }, | |
| 41 | |
| 42 /** @inheritDoc */ | |
| 43 handleCancel: function() { | |
| 44 SettingsDialog.prototype.handleCancel.call(this); | |
| 45 $('spelling-enabled-control').checked = false; | |
| 46 }, | |
| 47 }; | |
| 48 | |
| 49 // Export | |
| 50 return { | |
| 51 SpellingConfirmOverlay: SpellingConfirmOverlay | |
| 52 }; | |
| 53 }); | |
| OLD | NEW |