| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/chromeos/device_keyboard_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/new_window_delegate.h" | |
| 8 #include "ash/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
| 8 #include "ash/public/interfaces/new_window.mojom.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chromeos/chromeos_switches.h" | 13 #include "chromeos/chromeos_switches.h" |
| 14 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
| 15 #include "ui/events/devices/input_device_manager.h" | 15 #include "ui/events/devices/input_device_manager.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 UpdateShowKeys(); | 60 UpdateShowKeys(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void KeyboardHandler::HandleInitialize(const base::ListValue* args) { | 63 void KeyboardHandler::HandleInitialize(const base::ListValue* args) { |
| 64 AllowJavascript(); | 64 AllowJavascript(); |
| 65 UpdateShowKeys(); | 65 UpdateShowKeys(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void KeyboardHandler::HandleShowKeyboardShortcutsOverlay( | 68 void KeyboardHandler::HandleShowKeyboardShortcutsOverlay( |
| 69 const base::ListValue* args) const { | 69 const base::ListValue* args) const { |
| 70 ash::WmShell::Get()->new_window_delegate()->ShowKeyboardOverlay(); | 70 ash::WmShell::Get()->new_window_client()->ShowKeyboardOverlay(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void KeyboardHandler::UpdateShowKeys() { | 73 void KeyboardHandler::UpdateShowKeys() { |
| 74 const base::FundamentalValue has_caps_lock(HasExternalKeyboard()); | 74 const base::FundamentalValue has_caps_lock(HasExternalKeyboard()); |
| 75 const base::FundamentalValue has_diamond_key( | 75 const base::FundamentalValue has_diamond_key( |
| 76 base::CommandLine::ForCurrentProcess()->HasSwitch( | 76 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 77 chromeos::switches::kHasChromeOSDiamondKey)); | 77 chromeos::switches::kHasChromeOSDiamondKey)); |
| 78 CallJavascriptFunction("cr.webUIListenerCallback", | 78 CallJavascriptFunction("cr.webUIListenerCallback", |
| 79 base::StringValue("show-keys-changed"), has_caps_lock, | 79 base::StringValue("show-keys-changed"), has_caps_lock, |
| 80 has_diamond_key); | 80 has_diamond_key); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace settings | 83 } // namespace settings |
| 84 } // namespace chromeos | 84 } // namespace chromeos |
| OLD | NEW |