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