OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/input/InputDeviceCapabilities.h" | 5 #include "core/input/InputDeviceCapabilities.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 InputDeviceCapabilities::InputDeviceCapabilities(bool firesTouchEvents) { | 9 InputDeviceCapabilities::InputDeviceCapabilities(bool firesTouchEvents) { |
10 m_firesTouchEvents = firesTouchEvents; | 10 m_firesTouchEvents = firesTouchEvents; |
11 } | 11 } |
12 | 12 |
13 InputDeviceCapabilities::InputDeviceCapabilities( | 13 InputDeviceCapabilities::InputDeviceCapabilities( |
14 const InputDeviceCapabilitiesInit& initializer) { | 14 const InputDeviceCapabilitiesInit& initializer) { |
15 m_firesTouchEvents = initializer.firesTouchEvents(); | 15 m_firesTouchEvents = initializer.firesTouchEvents(); |
16 } | 16 } |
17 | 17 |
18 InputDeviceCapabilities* | 18 InputDeviceCapabilities* InputDeviceCapabilitiesConstants::firesTouchEvents( |
19 InputDeviceCapabilities::firesTouchEventsSourceCapabilities() { | 19 bool firesTouch) { |
20 DEFINE_STATIC_LOCAL(InputDeviceCapabilities, instance, | 20 if (firesTouch) { |
21 (InputDeviceCapabilities::create(true))); | 21 if (!m_firesTouchEvents) |
22 return &instance; | 22 m_firesTouchEvents = InputDeviceCapabilities::create(true); |
23 } | 23 return m_firesTouchEvents; |
24 | 24 } |
25 InputDeviceCapabilities* | 25 if (!m_doesntFireTouchEvents) |
26 InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities() { | 26 m_doesntFireTouchEvents = InputDeviceCapabilities::create(false); |
27 DEFINE_STATIC_LOCAL(InputDeviceCapabilities, instance, | 27 return m_doesntFireTouchEvents; |
28 (InputDeviceCapabilities::create(false))); | |
29 return &instance; | |
30 } | 28 } |
31 | 29 |
32 } // namespace blink | 30 } // namespace blink |
OLD | NEW |