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