| 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 #include "content/browser/sensors/sensors_provider_impl.h" | |
| 6 | |
| 7 #include "base/memory/singleton.h" | |
| 8 #include "content/public/browser/sensors_listener.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 // static | |
| 13 SensorsProvider* SensorsProvider::GetInstance() { | |
| 14 return SensorsProviderImpl::GetInstance(); | |
| 15 } | |
| 16 | |
| 17 // static | |
| 18 SensorsProviderImpl* SensorsProviderImpl::GetInstance() { | |
| 19 return Singleton<SensorsProviderImpl>::get(); | |
| 20 } | |
| 21 | |
| 22 void SensorsProviderImpl::AddListener(SensorsListener* listener) { | |
| 23 listeners_->AddObserver(listener); | |
| 24 } | |
| 25 | |
| 26 void SensorsProviderImpl::RemoveListener(SensorsListener* listener) { | |
| 27 listeners_->RemoveObserver(listener); | |
| 28 } | |
| 29 | |
| 30 void SensorsProviderImpl::ScreenOrientationChanged(ScreenOrientation change) { | |
| 31 listeners_->Notify(&SensorsListener::OnScreenOrientationChanged, change); | |
| 32 } | |
| 33 | |
| 34 SensorsProviderImpl::SensorsProviderImpl() | |
| 35 : listeners_(new ListenerList()) { | |
| 36 } | |
| 37 | |
| 38 SensorsProviderImpl::~SensorsProviderImpl() { | |
| 39 } | |
| 40 | |
| 41 } // namespace content | |
| OLD | NEW |