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.
5 cr.define('options', function() {
8 * Encapsulated handling of the keyboard overlay.
11 function KeyboardOverlay() {
12 options.SettingsDialog.call(this, 'keyboard-overlay',
13 loadTimeData.getString('keyboardOverlayTitle'),
15 $('keyboard-confirm'), $('keyboard-cancel'));
18 cr.addSingletonGetter(KeyboardOverlay);
20 KeyboardOverlay.prototype = {
21 __proto__: options.SettingsDialog.prototype,
24 * Initializes the page. This method is called in initialize.
26 initializePage: function() {
27 options.SettingsDialog.prototype.initializePage.call(this);
29 $('languages-and-input-settings').onclick = function(e) {
30 OptionsPage.navigateToPage('languages');
31 chrome.send('coreOptionsUserMetricsAction',
32 ['Options_KeyboardShowLanguageSettings']);
37 * Show/hide the caps lock remapping section.
40 showCapsLockOptions_: function(show) {
41 $('caps-lock-remapping-section').hidden = !show;
45 * Show/hide the diamond key remapping section.
48 showDiamondKeyOptions_: function(show) {
49 $('diamond-key-remapping-section').hidden = !show;
53 // Forward public APIs to private implementations.
55 'showCapsLockOptions',
56 'showDiamondKeyOptions',
57 ].forEach(function(name) {
58 KeyboardOverlay[name] = function() {
59 var instance = KeyboardOverlay.getInstance();
60 return instance[name + '_'].apply(instance, arguments);
66 KeyboardOverlay: KeyboardOverlay