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 16 matching lines...) Expand all Loading... |
27 namespace keyboard_api = extensions::api::virtual_keyboard_private; | 27 namespace keyboard_api = extensions::api::virtual_keyboard_private; |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 aura::Window* GetKeyboardContainer() { | 31 aura::Window* GetKeyboardContainer() { |
32 keyboard::KeyboardController* controller = | 32 keyboard::KeyboardController* controller = |
33 keyboard::KeyboardController::GetInstance(); | 33 keyboard::KeyboardController::GetInstance(); |
34 return controller ? controller->GetContainerWindow() : nullptr; | 34 return controller ? controller->GetContainerWindow() : nullptr; |
35 } | 35 } |
36 | 36 |
37 std::string GenerateFeatureFlag(std::string feature, bool enabled) { | 37 std::string GenerateFeatureFlag(const std::string& feature, bool enabled) { |
38 return feature + (enabled ? "-enabled" : "-disabled"); | 38 return feature + (enabled ? "-enabled" : "-disabled"); |
39 } | 39 } |
40 | 40 |
41 keyboard::KeyboardMode getKeyboardModeEnum(keyboard_api::KeyboardMode mode) { | 41 keyboard::KeyboardMode getKeyboardModeEnum(keyboard_api::KeyboardMode mode) { |
42 switch (mode) { | 42 switch (mode) { |
43 case keyboard_api::KEYBOARD_MODE_NONE: | 43 case keyboard_api::KEYBOARD_MODE_NONE: |
44 return keyboard::NONE; | 44 return keyboard::NONE; |
45 case keyboard_api::KEYBOARD_MODE_FULL_WIDTH: | 45 case keyboard_api::KEYBOARD_MODE_FULL_WIDTH: |
46 return keyboard::FULL_WIDTH; | 46 return keyboard::FULL_WIDTH; |
47 case keyboard_api::KEYBOARD_MODE_FLOATING: | 47 case keyboard_api::KEYBOARD_MODE_FLOATING: |
(...skipping 147 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 |