| Index: content/browser/device_orientation/provider_impl.cc
|
| diff --git a/content/browser/device_orientation/provider_impl.cc b/content/browser/device_orientation/provider_impl.cc
|
| index b27421c4a513e14c46fce48d0fda95a881c399af..8c20181c003cbab9609cb03b4a87e362d83afb31 100644
|
| --- a/content/browser/device_orientation/provider_impl.cc
|
| +++ b/content/browser/device_orientation/provider_impl.cc
|
| @@ -26,21 +26,21 @@ ProviderImpl::ProviderImpl(const DataFetcherFactory factories[])
|
| ProviderImpl::~ProviderImpl() {
|
| }
|
|
|
| -void ProviderImpl::AddObserver(Observer* observer) {
|
| +void ProviderImpl::AddOrientationObserver(OrientationObserver* observer) {
|
| DCHECK(MessageLoop::current() == creator_loop_);
|
|
|
| - observers_.insert(observer);
|
| - if (observers_.size() == 1)
|
| + orientation_observers_.insert(observer);
|
| + if (orientation_observers_.size() == 1)
|
| Start();
|
| else
|
| observer->OnOrientationUpdate(last_notification_);
|
| }
|
|
|
| -void ProviderImpl::RemoveObserver(Observer* observer) {
|
| +void ProviderImpl::RemoveOrientationObserver(OrientationObserver* observer) {
|
| DCHECK(MessageLoop::current() == creator_loop_);
|
|
|
| - observers_.erase(observer);
|
| - if (observers_.empty())
|
| + orientation_observers_.erase(observer);
|
| + if (orientation_observers_.empty())
|
| Stop();
|
| }
|
|
|
| @@ -111,13 +111,14 @@ void ProviderImpl::DoNotify(const Orientation& orientation) {
|
|
|
| last_notification_ = orientation;
|
|
|
| - typedef std::set<Observer*>::const_iterator Iterator;
|
| - for (Iterator i = observers_.begin(), e = observers_.end(); i != e; ++i)
|
| + typedef std::set<OrientationObserver*>::const_iterator Iterator;
|
| + for (Iterator i = orientation_observers_.begin(),
|
| + e = orientation_observers_.end(); i != e; ++i)
|
| (*i)->OnOrientationUpdate(orientation);
|
|
|
| if (orientation.IsEmpty()) {
|
| // Notify observers about failure to provide data exactly once.
|
| - observers_.clear();
|
| + orientation_observers_.clear();
|
| Stop();
|
| }
|
| }
|
|
|