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