| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_SENSORS_SENSORS_PROVIDER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_SENSORS_SENSORS_PROVIDER_IMPL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "base/observer_list_threadsafe.h" | |
| 12 #include "content/public/browser/sensors_provider.h" | |
| 13 | |
| 14 template <typename T> struct DefaultSingletonTraits; | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 class SensorsProviderImpl : public SensorsProvider { | |
| 19 public: | |
| 20 static SensorsProviderImpl* GetInstance(); | |
| 21 | |
| 22 // SensorsProvider implementation: | |
| 23 virtual void AddListener(SensorsListener* listener) OVERRIDE; | |
| 24 virtual void RemoveListener(SensorsListener* listener) OVERRIDE; | |
| 25 virtual void ScreenOrientationChanged(ScreenOrientation change) OVERRIDE; | |
| 26 | |
| 27 private: | |
| 28 friend struct DefaultSingletonTraits<SensorsProviderImpl>; | |
| 29 | |
| 30 SensorsProviderImpl(); | |
| 31 virtual ~SensorsProviderImpl(); | |
| 32 | |
| 33 typedef ObserverListThreadSafe<SensorsListener> ListenerList; | |
| 34 scoped_refptr<ListenerList> listeners_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(SensorsProviderImpl); | |
| 37 }; | |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_BROWSER_SENSORS_SENSORS_PROVIDER_IMPL_H_ | |
| OLD | NEW |