Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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 "base/memory/singleton.h" | |
| 6 #include "content/browser/sensors/sensors_provider_impl.h" | |
|
tfarina
2011/07/25 14:57:52
this should be the first include.
| |
| 7 | |
| 8 namespace sensors { | |
| 9 | |
| 10 ProviderImpl* ProviderImpl::GetInstance() { | |
| 11 return Singleton<ProviderImpl>::get(); | |
| 12 } | |
| 13 | |
| 14 ProviderImpl::ProviderImpl() | |
|
tfarina
2011/07/25 14:57:52
This and the dtor should be defined after RemoveLi
cwolfe
2011/07/25 15:49:45
Consistent with PluginService, among others. Code
tfarina
2011/07/25 16:18:37
This is not optional :) And Scott will agree with
| |
| 15 : listeners_(new ListenerList()) { | |
| 16 } | |
| 17 | |
| 18 ProviderImpl::~ProviderImpl() { | |
| 19 } | |
| 20 | |
| 21 void ProviderImpl::AddListener(Listener* listener) { | |
| 22 listeners_->AddObserver(listener); | |
| 23 } | |
| 24 | |
| 25 void ProviderImpl::RemoveListener(Listener* listener) { | |
| 26 listeners_->RemoveObserver(listener); | |
| 27 } | |
| 28 | |
| 29 void ProviderImpl::ScreenOrientationChanged( | |
| 30 const ScreenOrientation& change) { | |
| 31 listeners_->Notify(&Listener::OnScreenOrientationChanged, change); | |
| 32 } | |
| 33 | |
| 34 } // namespace sensors | |
| OLD | NEW |