Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 /** @const */ var OptionsPage = options.OptionsPage; | |
| 7 /** @const */ var SettingsDialog = options.SettingsDialog; | |
| 8 | |
| 9 /** | |
| 10 * HomePageOverlay class | |
| 11 * Dialog that allows users to set the home page. | |
| 12 * @extends {SettingsDialog} | |
| 13 */ | |
| 14 function ThirdPartyImeConfirmOverlay() { | |
| 15 SettingsDialog.call( | |
| 16 this, 'thirdPartyImeConfirm', | |
| 17 loadTimeData.getString('thirdPartyImeConfirmOverlayTabTitle'), | |
| 18 'third-party-ime-confirm-overlay', | |
| 19 $('third-party-ime-confirm-ok'), | |
| 20 $('third-party-ime-confirm-cancel')); | |
| 21 } | |
| 22 | |
| 23 cr.addSingletonGetter(ThirdPartyImeConfirmOverlay); | |
| 24 | |
| 25 ThirdPartyImeConfirmOverlay.prototype = { | |
| 26 __proto__: SettingsDialog.prototype, | |
| 27 | |
| 28 /** | |
| 29 * Callback to authorize use of an input method. | |
| 30 * @type {Function} | |
| 31 * @private | |
| 32 */ | |
| 33 confirmationCallback_: null, | |
| 34 | |
| 35 /** | |
| 36 * Callback to cancel enabling an input method. | |
| 37 * @type {Function} | |
| 38 * @private | |
| 39 */ | |
| 40 cancellationCallback_: null, | |
| 41 | |
| 42 /** | |
| 43 * Confirms enabling of a third party IME. | |
| 44 */ | |
| 45 handleConfirm: function() { | |
| 46 this.confirmationCallback_(); | |
| 47 SettingsDialog.prototype.handleConfirm.call(this); | |
|
Dan Beam
2014/06/09 21:37:36
why are you calling into the super second?
kevers
2014/06/10 17:56:44
Either order is fine since there is no preference
| |
| 48 }, | |
| 49 | |
| 50 /** | |
| 51 * Resets state of the checkobx. | |
| 52 */ | |
| 53 handleCancel: function() { | |
| 54 this.cancellationCallback_(); | |
| 55 SettingsDialog.prototype.handleCancel.call(this); | |
| 56 }, | |
| 57 | |
| 58 /** | |
| 59 * Displays a confirmation dialog indicating the risk fo enabling | |
| 60 * a third party IME. | |
| 61 * @param {{extension: string, confirm: Function, cancel: Function}} data | |
| 62 * Options for the confirmation dialog. | |
| 63 * @private | |
| 64 */ | |
| 65 showConfirmationDialog_: function(data) { | |
| 66 this.confirmationCallback_ = data.confirm; | |
| 67 this.cancellationCallback_ = data.cancel; | |
| 68 var message = loadTimeData.getStringF('thirdPartyImeConfirmMessage', | |
| 69 data.extension); | |
| 70 $('third-party-ime-confirm-text').textContent = message; | |
| 71 OptionsPage.showPageByName(this.name, false); | |
| 72 }, | |
| 73 }; | |
| 74 | |
| 75 /** | |
| 76 * Displays a confirmation dialog indicating the risk fo enabling | |
| 77 * a third party IME. | |
| 78 * @param {{extension: string, confirm: Function, cancel: Function}} data | |
| 79 * Options for the confirmation dialog. | |
| 80 */ | |
| 81 ThirdPartyImeConfirmOverlay.showConfirmationDialog = function(data) { | |
| 82 var instance = ThirdPartyImeConfirmOverlay.getInstance(); | |
| 83 instance.showConfirmationDialog_.apply(instance, arguments); | |
|
Dan Beam
2014/06/09 21:37:35
ThirdPartyImeConfirmOverlay.getInstance().showConf
kevers
2014/06/10 17:56:44
Done.
| |
| 84 } | |
|
Dan Beam
2014/06/09 21:37:35
};
kevers
2014/06/10 17:56:44
Done.
| |
| 85 | |
| 86 // Export | |
| 87 return { | |
| 88 ThirdPartyImeConfirmOverlay: ThirdPartyImeConfirmOverlay | |
| 89 }; | |
| 90 }); | |
| OLD | NEW |