| 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/options/chromeos/keyboard_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/keyboard_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/new_window_delegate.h" | 9 #include "ash/common/new_window_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 17 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
| 18 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.h" |
| 19 #include "ui/base/ime/chromeos/ime_keyboard.h" | 19 #include "ui/base/ime/chromeos/ime_keyboard.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 "showKeyboardShortcuts", | 168 "showKeyboardShortcuts", |
| 169 base::Bind(&KeyboardHandler::HandleShowKeyboardShortcuts, | 169 base::Bind(&KeyboardHandler::HandleShowKeyboardShortcuts, |
| 170 base::Unretained(this))); | 170 base::Unretained(this))); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void KeyboardHandler::OnKeyboardDeviceConfigurationChanged() { | 173 void KeyboardHandler::OnKeyboardDeviceConfigurationChanged() { |
| 174 UpdateCapsLockOptions(); | 174 UpdateCapsLockOptions(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void KeyboardHandler::HandleShowKeyboardShortcuts(const base::ListValue* args) { | 177 void KeyboardHandler::HandleShowKeyboardShortcuts(const base::ListValue* args) { |
| 178 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); | 178 ash::WmShell::Get()->new_window_delegate()->ShowKeyboardOverlay(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void KeyboardHandler::UpdateCapsLockOptions() const { | 181 void KeyboardHandler::UpdateCapsLockOptions() const { |
| 182 const base::FundamentalValue show_caps_lock_options(HasExternalKeyboard()); | 182 const base::FundamentalValue show_caps_lock_options(HasExternalKeyboard()); |
| 183 web_ui()->CallJavascriptFunctionUnsafe( | 183 web_ui()->CallJavascriptFunctionUnsafe( |
| 184 "options.KeyboardOverlay.showCapsLockOptions", show_caps_lock_options); | 184 "options.KeyboardOverlay.showCapsLockOptions", show_caps_lock_options); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace options | 187 } // namespace options |
| 188 } // namespace chromeos | 188 } // namespace chromeos |
| OLD | NEW |