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/chromeos/system/input_device_settings.h" | 5 #include "chrome/browser/chromeos/system/input_device_settings.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" | 9 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 #include "services/shell/runner/common/client_util.h" |
11 #include "ui/ozone/public/input_controller.h" | 12 #include "ui/ozone/public/input_controller.h" |
12 #include "ui/ozone/public/ozone_platform.h" | 13 #include "ui/ozone/public/ozone_platform.h" |
13 | 14 |
14 #if defined(MOJO_SHELL_CLIENT) | |
15 #include "services/shell/runner/common/client_util.h" | |
16 #endif | |
17 | |
18 namespace chromeos { | 15 namespace chromeos { |
19 namespace system { | 16 namespace system { |
20 | 17 |
21 namespace { | 18 namespace { |
22 | 19 |
23 InputDeviceSettings* g_instance = nullptr; | 20 InputDeviceSettings* g_instance = nullptr; |
24 | 21 |
25 std::unique_ptr<ui::InputController> CreateStubInputControllerIfNecessary() { | 22 std::unique_ptr<ui::InputController> CreateStubInputControllerIfNecessary() { |
26 #if defined(MOJO_SHELL_CLIENT) | |
27 return shell::ShellIsRemote() ? ui::CreateStubInputController() : nullptr; | 23 return shell::ShellIsRemote() ? ui::CreateStubInputController() : nullptr; |
28 #else | |
29 return nullptr; | |
30 #endif | |
31 } | 24 } |
32 | 25 |
33 // InputDeviceSettings for Linux without X11 (a.k.a. Ozone). | 26 // InputDeviceSettings for Linux without X11 (a.k.a. Ozone). |
34 class InputDeviceSettingsImplOzone : public InputDeviceSettings { | 27 class InputDeviceSettingsImplOzone : public InputDeviceSettings { |
35 public: | 28 public: |
36 InputDeviceSettingsImplOzone(); | 29 InputDeviceSettingsImplOzone(); |
37 | 30 |
38 protected: | 31 protected: |
39 ~InputDeviceSettingsImplOzone() override {} | 32 ~InputDeviceSettingsImplOzone() override {} |
40 | 33 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (base::SysInfo::IsRunningOnChromeOS()) | 166 if (base::SysInfo::IsRunningOnChromeOS()) |
174 g_instance = new InputDeviceSettingsImplOzone; | 167 g_instance = new InputDeviceSettingsImplOzone; |
175 else | 168 else |
176 g_instance = new FakeInputDeviceSettings(); | 169 g_instance = new FakeInputDeviceSettings(); |
177 } | 170 } |
178 return g_instance; | 171 return g_instance; |
179 } | 172 } |
180 | 173 |
181 } // namespace system | 174 } // namespace system |
182 } // namespace chromeos | 175 } // namespace chromeos |
OLD | NEW |