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

Unified 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: Restore more specific version of another missing header. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/sensors/sensors_provider_impl.h ('k') | content/common/sensors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/sensors/sensors_provider_impl.cc
diff --git a/content/browser/sensors/sensors_provider_impl.cc b/content/browser/sensors/sensors_provider_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9c151f739020e2268d9d419645e5b32adceabe2f
--- /dev/null
+++ b/content/browser/sensors/sensors_provider_impl.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/sensors/sensors_provider_impl.h"
+
+#include "base/memory/singleton.h"
+
+namespace sensors {
+
+ProviderImpl* ProviderImpl::GetInstance() {
+ return Singleton<ProviderImpl>::get();
+}
+
+ProviderImpl::ProviderImpl()
+ : listeners_(new ListenerList()) {
+}
+
+ProviderImpl::~ProviderImpl() {
+}
+
+void ProviderImpl::AddListener(Listener* listener) {
+ listeners_->AddObserver(listener);
+}
+
+void ProviderImpl::RemoveListener(Listener* listener) {
+ listeners_->RemoveObserver(listener);
+}
+
+void ProviderImpl::ScreenOrientationChanged(
+ const ScreenOrientation& change) {
+ listeners_->Notify(&Listener::OnScreenOrientationChanged, change);
+}
+
+} // namespace sensors
« no previous file with comments | « content/browser/sensors/sensors_provider_impl.h ('k') | content/common/sensors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698