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 "ui/events/gesture_detection/gesture_configuration.h" | 5 #include "ui/events/gesture_detection/gesture_configuration.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "ui/gfx/screen.h" | 9 #include "ui/display/screen.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 namespace { | 12 namespace { |
13 class GestureConfigurationDefault : public GestureConfiguration { | 13 class GestureConfigurationDefault : public GestureConfiguration { |
14 public: | 14 public: |
15 ~GestureConfigurationDefault() override { | 15 ~GestureConfigurationDefault() override { |
16 } | 16 } |
17 | 17 |
18 static GestureConfigurationDefault* GetInstance() { | 18 static GestureConfigurationDefault* GetInstance() { |
19 return base::Singleton<GestureConfigurationDefault>::get(); | 19 return base::Singleton<GestureConfigurationDefault>::get(); |
20 } | 20 } |
21 | 21 |
22 private: | 22 private: |
23 GestureConfigurationDefault() {} | 23 GestureConfigurationDefault() {} |
24 | 24 |
25 friend struct base::DefaultSingletonTraits<GestureConfigurationDefault>; | 25 friend struct base::DefaultSingletonTraits<GestureConfigurationDefault>; |
26 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationDefault); | 26 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationDefault); |
27 }; | 27 }; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 // Create a GestureConfiguration singleton instance when using Mac. | 31 // Create a GestureConfiguration singleton instance when using Mac. |
32 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { | 32 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { |
33 return GestureConfigurationDefault::GetInstance(); | 33 return GestureConfigurationDefault::GetInstance(); |
34 } | 34 } |
35 | 35 |
36 } // namespace ui | 36 } // namespace ui |
OLD | NEW |