Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: content/browser/sensors/sensors_provider_impl.cc

Issue 7366011: Initial sensor event provider for testing views screen rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Style fixes Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698