Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc

Issue 684143003: Make chrome/browser/ui/webui not depend on ash when using Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash43_kiosk_mode
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/options/chromeos/keyboard_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/keyboard_handler.h"
6 6
7 #include "ash/new_window_delegate.h"
8 #include "ash/shell.h"
9 #include "base/bind.h" 7 #include "base/bind.h"
10 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 9 #include "base/command_line.h"
12 #include "base/values.h" 10 #include "base/values.h"
13 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
14 #include "chromeos/chromeos_switches.h" 12 #include "chromeos/chromeos_switches.h"
15 #include "chromeos/ime/ime_keyboard.h" 13 #include "chromeos/ime/ime_keyboard.h"
16 #include "content/public/browser/web_ui.h" 14 #include "content/public/browser/web_ui.h"
17 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
18 16
17 #if !defined(USE_ATHENA)
18 #include "ash/new_window_delegate.h"
19 #include "ash/shell.h"
20 #endif
21
19 namespace { 22 namespace {
20 const struct ModifierKeysSelectItem { 23 const struct ModifierKeysSelectItem {
21 int message_id; 24 int message_id;
22 chromeos::input_method::ModifierKey value; 25 chromeos::input_method::ModifierKey value;
23 } kModifierKeysSelectItems[] = { 26 } kModifierKeysSelectItems[] = {
24 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_SEARCH, 27 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_SEARCH,
25 chromeos::input_method::kSearchKey }, 28 chromeos::input_method::kSearchKey },
26 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_LEFT_CTRL, 29 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_LEFT_CTRL,
27 chromeos::input_method::kControlKey }, 30 chromeos::input_method::kControlKey },
28 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_LEFT_ALT, 31 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_LEFT_ALT,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 152
150 void KeyboardHandler::RegisterMessages() { 153 void KeyboardHandler::RegisterMessages() {
151 // Callback to show keyboard overlay. 154 // Callback to show keyboard overlay.
152 web_ui()->RegisterMessageCallback( 155 web_ui()->RegisterMessageCallback(
153 "showKeyboardShortcuts", 156 "showKeyboardShortcuts",
154 base::Bind(&KeyboardHandler::HandleShowKeyboardShortcuts, 157 base::Bind(&KeyboardHandler::HandleShowKeyboardShortcuts,
155 base::Unretained(this))); 158 base::Unretained(this)));
156 } 159 }
157 160
158 void KeyboardHandler::HandleShowKeyboardShortcuts(const base::ListValue* args) { 161 void KeyboardHandler::HandleShowKeyboardShortcuts(const base::ListValue* args) {
159 #if defined(USE_ATHENA) 162 #if !defined(USE_ATHENA)
160 // Athena doesn't have ash::Shell and its new_window_delegate so keyboard 163 // Athena doesn't have ash::Shell and its new_window_delegate so keyboard
161 // shortcut overlays are not supported. 164 // shortcut overlays are not supported.
162 // TODO(mukai): re-enable this. 165 // TODO(mukai): re-enable this.
163 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); 166 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay();
164 #endif 167 #endif
165 } 168 }
166 169
167 } // namespace options 170 } // namespace options
168 } // namespace chromeos 171 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698