| 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 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 void ChromeVirtualKeyboardDelegate::SetHotrodKeyboard(bool enable) { | 123 void ChromeVirtualKeyboardDelegate::SetHotrodKeyboard(bool enable) { |
| 124 if (keyboard::GetHotrodKeyboardEnabled() == enable) | 124 if (keyboard::GetHotrodKeyboardEnabled() == enable) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 keyboard::SetHotrodKeyboardEnabled(enable); | 127 keyboard::SetHotrodKeyboardEnabled(enable); |
| 128 // This reloads virtual keyboard even if it exists. This ensures virtual | 128 // This reloads virtual keyboard even if it exists. This ensures virtual |
| 129 // keyboard gets the correct state of the hotrod keyboard through | 129 // keyboard gets the correct state of the hotrod keyboard through |
| 130 // chrome.virtualKeyboardPrivate.getKeyboardConfig. | 130 // chrome.virtualKeyboardPrivate.getKeyboardConfig. |
| 131 if (enable && keyboard::IsKeyboardEnabled()) | 131 if (keyboard::IsKeyboardEnabled()) |
| 132 ash::Shell::GetInstance()->CreateKeyboard(); | 132 ash::Shell::GetInstance()->CreateKeyboard(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) { | 135 bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) { |
| 136 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 136 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 137 keyboard::KeyboardController* controller = | 137 keyboard::KeyboardController* controller = |
| 138 keyboard::KeyboardController::GetInstance(); | 138 keyboard::KeyboardController::GetInstance(); |
| 139 if (!controller) | 139 if (!controller) |
| 140 return false; | 140 return false; |
| 141 | 141 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 197 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 198 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 198 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 199 !chromeos::UserAddingScreen::Get()->IsRunning() && | 199 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 200 !(chromeos::ScreenLocker::default_screen_locker() && | 200 !(chromeos::ScreenLocker::default_screen_locker() && |
| 201 chromeos::ScreenLocker::default_screen_locker()->locked())); | 201 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace extensions | 204 } // namespace extensions |
| OLD | NEW |