| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" | 5 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ash::Shell::GetInstance()->CreateKeyboard(); | 133 ash::Shell::GetInstance()->CreateKeyboard(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) { | 136 bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) { |
| 137 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 137 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 138 keyboard::KeyboardController* controller = | 138 keyboard::KeyboardController* controller = |
| 139 keyboard::KeyboardController::GetInstance(); | 139 keyboard::KeyboardController::GetInstance(); |
| 140 if (!controller) | 140 if (!controller) |
| 141 return false; | 141 return false; |
| 142 | 142 |
| 143 keyboard::KeyboardController::GetInstance()->set_lock_keyboard(state); | 143 keyboard::KeyboardController::GetInstance()->set_keyboard_locked(state); |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, | 147 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, |
| 148 int char_value, | 148 int char_value, |
| 149 int key_code, | 149 int key_code, |
| 150 const std::string& key_name, | 150 const std::string& key_name, |
| 151 int modifiers) { | 151 int modifiers) { |
| 152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 153 aura::Window* window = GetKeyboardContainer(); | 153 aura::Window* window = GetKeyboardContainer(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 200 !chromeos::UserAddingScreen::Get()->IsRunning() && | 200 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 201 !(chromeos::ScreenLocker::default_screen_locker() && | 201 !(chromeos::ScreenLocker::default_screen_locker() && |
| 202 chromeos::ScreenLocker::default_screen_locker()->locked())); | 202 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace extensions | 205 } // namespace extensions |
| OLD | NEW |