| 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 | 9 |
| 9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 13 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 15 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 15 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 16 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/chrome_pages.h" | 18 #include "chrome/browser/ui/chrome_pages.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 features->AppendString(GenerateFeatureFlag( | 81 features->AppendString(GenerateFeatureFlag( |
| 81 "floatingvirtualkeyboard", keyboard::IsFloatingVirtualKeyboardEnabled())); | 82 "floatingvirtualkeyboard", keyboard::IsFloatingVirtualKeyboardEnabled())); |
| 82 features->AppendString( | 83 features->AppendString( |
| 83 GenerateFeatureFlag("gesturetyping", keyboard::IsGestureTypingEnabled())); | 84 GenerateFeatureFlag("gesturetyping", keyboard::IsGestureTypingEnabled())); |
| 84 features->AppendString(GenerateFeatureFlag( | 85 features->AppendString(GenerateFeatureFlag( |
| 85 "gestureediting", keyboard::IsGestureEditingEnabled())); | 86 "gestureediting", keyboard::IsGestureEditingEnabled())); |
| 86 features->AppendString( | 87 features->AppendString( |
| 87 GenerateFeatureFlag("voiceinput", keyboard::IsVoiceInputEnabled())); | 88 GenerateFeatureFlag("voiceinput", keyboard::IsVoiceInputEnabled())); |
| 88 features->AppendString(GenerateFeatureFlag("experimental", | 89 features->AppendString(GenerateFeatureFlag("experimental", |
| 89 keyboard::IsExperimentalInputViewEnabled())); | 90 keyboard::IsExperimentalInputViewEnabled())); |
| 90 results->Set("features", features.Pass()); | 91 results->Set("features", std::move(features)); |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| 93 | 94 |
| 94 bool ChromeVirtualKeyboardDelegate::HideKeyboard() { | 95 bool ChromeVirtualKeyboardDelegate::HideKeyboard() { |
| 95 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 96 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 96 keyboard::KeyboardController* controller = | 97 keyboard::KeyboardController* controller = |
| 97 keyboard::KeyboardController::GetInstance(); | 98 keyboard::KeyboardController::GetInstance(); |
| 98 if (!controller) | 99 if (!controller) |
| 99 return false; | 100 return false; |
| 100 | 101 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { | 198 bool ChromeVirtualKeyboardDelegate::IsLanguageSettingsEnabled() { |
| 198 return (user_manager::UserManager::Get()->IsUserLoggedIn() && | 199 return (user_manager::UserManager::Get()->IsUserLoggedIn() && |
| 199 !chromeos::UserAddingScreen::Get()->IsRunning() && | 200 !chromeos::UserAddingScreen::Get()->IsRunning() && |
| 200 !(chromeos::ScreenLocker::default_screen_locker() && | 201 !(chromeos::ScreenLocker::default_screen_locker() && |
| 201 chromeos::ScreenLocker::default_screen_locker()->locked())); | 202 chromeos::ScreenLocker::default_screen_locker()->locked())); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace extensions | 205 } // namespace extensions |
| OLD | NEW |