| 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 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" |
| 6 | 6 |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 struct ModifierToLabel { | 48 struct ModifierToLabel { |
| 49 const ModifierKey modifier; | 49 const ModifierKey modifier; |
| 50 const char* label; | 50 const char* label; |
| 51 } kModifierToLabels[] = { | 51 } kModifierToLabels[] = { |
| 52 {chromeos::input_method::kSearchKey, "search"}, | 52 {chromeos::input_method::kSearchKey, "search"}, |
| 53 {chromeos::input_method::kControlKey, "ctrl"}, | 53 {chromeos::input_method::kControlKey, "ctrl"}, |
| 54 {chromeos::input_method::kAltKey, "alt"}, | 54 {chromeos::input_method::kAltKey, "alt"}, |
| 55 {chromeos::input_method::kVoidKey, "disabled"}, | 55 {chromeos::input_method::kVoidKey, "disabled"}, |
| 56 {chromeos::input_method::kCapsLockKey, "caps lock"}, | 56 {chromeos::input_method::kCapsLockKey, "caps lock"}, |
| 57 {chromeos::input_method::kEscapeKey, "esc"}, |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 struct I18nContentToMessage { | 60 struct I18nContentToMessage { |
| 60 const char* i18n_content; | 61 const char* i18n_content; |
| 61 int message; | 62 int message; |
| 62 } kI18nContentToMessage[] = { | 63 } kI18nContentToMessage[] = { |
| 63 { "keyboardOverlayLearnMore", IDS_KEYBOARD_OVERLAY_LEARN_MORE }, | 64 { "keyboardOverlayLearnMore", IDS_KEYBOARD_OVERLAY_LEARN_MORE }, |
| 64 { "keyboardOverlayTitle", IDS_KEYBOARD_OVERLAY_TITLE }, | 65 { "keyboardOverlayTitle", IDS_KEYBOARD_OVERLAY_TITLE }, |
| 65 { "keyboardOverlayInstructions", IDS_KEYBOARD_OVERLAY_INSTRUCTIONS }, | 66 { "keyboardOverlayInstructions", IDS_KEYBOARD_OVERLAY_INSTRUCTIONS }, |
| 66 { "keyboardOverlayInstructionsHide", IDS_KEYBOARD_OVERLAY_INSTRUCTIONS_HIDE }, | 67 { "keyboardOverlayInstructionsHide", IDS_KEYBOARD_OVERLAY_INSTRUCTIONS_HIDE }, |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 373 |
| 373 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 374 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
| 374 : WebDialogUI(web_ui) { | 375 : WebDialogUI(web_ui) { |
| 375 Profile* profile = Profile::FromWebUI(web_ui); | 376 Profile* profile = Profile::FromWebUI(web_ui); |
| 376 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); | 377 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); |
| 377 web_ui->AddMessageHandler(handler); | 378 web_ui->AddMessageHandler(handler); |
| 378 | 379 |
| 379 // Set up the chrome://keyboardoverlay/ source. | 380 // Set up the chrome://keyboardoverlay/ source. |
| 380 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); | 381 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); |
| 381 } | 382 } |
| OLD | NEW |