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 "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
8 #include "ui/events/base_event_utils.h" | |
8 #include "ui/ozone/public/input_controller.h" | 9 #include "ui/ozone/public/input_controller.h" |
9 #include "ui/ozone/public/ozone_platform.h" | 10 #include "ui/ozone/public/ozone_platform.h" |
10 | 11 |
11 namespace chromeos { | 12 namespace chromeos { |
12 namespace system { | 13 namespace system { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 InputDeviceSettings* g_instance = nullptr; | 17 InputDeviceSettings* g_instance = nullptr; |
17 InputDeviceSettings* g_test_instance = nullptr; | 18 InputDeviceSettings* g_test_instance = nullptr; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 void InputDeviceSettingsImplOzone::ReapplyMouseSettings() { | 130 void InputDeviceSettingsImplOzone::ReapplyMouseSettings() { |
130 MouseSettings::Apply(current_mouse_settings_, this); | 131 MouseSettings::Apply(current_mouse_settings_, this); |
131 } | 132 } |
132 | 133 |
133 void InputDeviceSettingsImplOzone::SetInternalTouchpadEnabled(bool enabled) { | 134 void InputDeviceSettingsImplOzone::SetInternalTouchpadEnabled(bool enabled) { |
134 input_controller_->SetInternalTouchpadEnabled(enabled); | 135 input_controller_->SetInternalTouchpadEnabled(enabled); |
135 } | 136 } |
136 | 137 |
137 void InputDeviceSettingsImplOzone::SetTouchscreensEnabled(bool enabled) { | 138 void InputDeviceSettingsImplOzone::SetTouchscreensEnabled(bool enabled) { |
138 input_controller_->SetTouchscreensEnabled(enabled); | 139 input_controller_->SetTouchscreensEnabled(enabled); |
140 ui::SetTouchEventsCrOsMasterSwitch(enabled); | |
oshima
2015/11/18 22:49:41
I think it's better for the input controller to se
| |
139 } | 141 } |
140 | 142 |
141 } // namespace | 143 } // namespace |
142 | 144 |
143 // static | 145 // static |
144 InputDeviceSettings* InputDeviceSettings::Get() { | 146 InputDeviceSettings* InputDeviceSettings::Get() { |
145 if (g_test_instance) | 147 if (g_test_instance) |
146 return g_test_instance; | 148 return g_test_instance; |
147 if (!g_instance) | 149 if (!g_instance) |
148 g_instance = new InputDeviceSettingsImplOzone; | 150 g_instance = new InputDeviceSettingsImplOzone; |
149 return g_instance; | 151 return g_instance; |
150 } | 152 } |
151 | 153 |
152 // static | 154 // static |
153 void InputDeviceSettings::SetSettingsForTesting( | 155 void InputDeviceSettings::SetSettingsForTesting( |
154 InputDeviceSettings* test_settings) { | 156 InputDeviceSettings* test_settings) { |
155 if (g_test_instance == test_settings) | 157 if (g_test_instance == test_settings) |
156 return; | 158 return; |
157 delete g_test_instance; | 159 delete g_test_instance; |
158 g_test_instance = test_settings; | 160 g_test_instance = test_settings; |
159 } | 161 } |
160 | 162 |
161 } // namespace system | 163 } // namespace system |
162 } // namespace chromeos | 164 } // namespace chromeos |
OLD | NEW |