| OLD | NEW | 
|   1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |   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 |   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   /** |   7   /** | 
|   8    * Encapsulated handling of the keyboard overlay. |   8    * Encapsulated handling of the keyboard overlay. | 
|   9    * @constructor |   9    * @constructor | 
|  10    */ |  10    */ | 
|  11   function KeyboardOverlay() { |  11   function KeyboardOverlay() { | 
|  12     options.SettingsDialog.call(this, 'keyboard-overlay', |  12     options.SettingsDialog.call(this, 'keyboard-overlay', | 
|  13         loadTimeData.getString('keyboardOverlayTitle'), |  13         loadTimeData.getString('keyboardOverlayTitle'), | 
|  14         'keyboard-overlay', |  14         'keyboard-overlay', | 
|  15         $('keyboard-confirm'), $('keyboard-cancel')); |  15         $('keyboard-confirm'), $('keyboard-cancel')); | 
|  16   } |  16   } | 
|  17  |  17  | 
|  18   cr.addSingletonGetter(KeyboardOverlay); |  18   cr.addSingletonGetter(KeyboardOverlay); | 
|  19  |  19  | 
|  20   KeyboardOverlay.prototype = { |  20   KeyboardOverlay.prototype = { | 
|  21     __proto__: options.SettingsDialog.prototype, |  21     __proto__: options.SettingsDialog.prototype, | 
|  22  |  22  | 
|  23     /** |  23     /** | 
|  24      * Show/hide the caps lock remapping section. |  24      * Show/hide the caps lock remapping section. | 
|  25      * @private |  25      * @private | 
|  26      */ |  26      */ | 
|  27     showCapsLockOptions_: function(show) { |  27     showCapsLockOptions_: function(show) { | 
|  28       $('caps-lock-remapping-section').hidden = !show; |  28       $('caps-lock-remapping-section').hidden = !show; | 
|  29     }, |  29     }, | 
 |  30  | 
 |  31     /** | 
 |  32      * Show/hide the function key remapping section. | 
 |  33      * @private | 
 |  34      */ | 
 |  35     showFunctionKeyOptions_: function(show) { | 
 |  36       $('function-key-remapping-section').hidden = !show; | 
 |  37     }, | 
|  30   }; |  38   }; | 
|  31  |  39  | 
|  32   // Forward public APIs to private implementations. |  40   // Forward public APIs to private implementations. | 
|  33   [ |  41   [ | 
|  34     'showCapsLockOptions', |  42     'showCapsLockOptions', | 
 |  43     'showFunctionKeyOptions', | 
|  35   ].forEach(function(name) { |  44   ].forEach(function(name) { | 
|  36     KeyboardOverlay[name] = function() { |  45     KeyboardOverlay[name] = function() { | 
|  37       var instance = KeyboardOverlay.getInstance(); |  46       var instance = KeyboardOverlay.getInstance(); | 
|  38       return instance[name + '_'].apply(instance, arguments); |  47       return instance[name + '_'].apply(instance, arguments); | 
|  39     }; |  48     }; | 
|  40   }); |  49   }); | 
|  41  |  50  | 
|  42   // Export |  51   // Export | 
|  43   return { |  52   return { | 
|  44     KeyboardOverlay: KeyboardOverlay |  53     KeyboardOverlay: KeyboardOverlay | 
|  45   }; |  54   }; | 
|  46 }); |  55 }); | 
| OLD | NEW |