| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (!controller) | 78 if (!controller) |
| 79 return false; | 79 return false; |
| 80 | 80 |
| 81 keyboard::KeyboardController::GetInstance()->set_lock_keyboard(state); | 81 keyboard::KeyboardController::GetInstance()->set_lock_keyboard(state); |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool ChromeVirtualKeyboardDelegate::MoveCursor(int swipe_direction, | 85 bool ChromeVirtualKeyboardDelegate::MoveCursor(int swipe_direction, |
| 86 int modifier_flags) { | 86 int modifier_flags) { |
| 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 88 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 88 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 89 keyboard::switches::kEnableSwipeSelection)) { | 89 keyboard::switches::kEnableSwipeSelection)) { |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 aura::Window* window = GetKeyboardContainer(); | 92 aura::Window* window = GetKeyboardContainer(); |
| 93 return window && keyboard::MoveCursor( | 93 return window && keyboard::MoveCursor( |
| 94 swipe_direction, modifier_flags, window->GetHost()); | 94 swipe_direction, modifier_flags, window->GetHost()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, | 97 bool ChromeVirtualKeyboardDelegate::SendKeyEvent(const std::string& type, |
| 98 int char_value, | 98 int char_value, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 120 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 121 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 121 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 122 !chromeos::UserAddingScreen::Get()->IsRunning() && | 122 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 123 !(chromeos::ScreenLocker::default_screen_locker() && | 123 !(chromeos::ScreenLocker::default_screen_locker() && |
| 124 chromeos::ScreenLocker::default_screen_locker()->locked())); | 124 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |