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

Unified Diff: content/browser/sensors/sensors_provider_impl.h

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/sensors/sensors_provider_impl.h
diff --git a/content/browser/sensors/sensors_provider_impl.h b/content/browser/sensors/sensors_provider_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd39416064a8783ab869d41fc7c3a79065c35f33
--- /dev/null
+++ b/content/browser/sensors/sensors_provider_impl.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_SENSORS_PROVIDER_IMPL_H_
tfarina 2011/07/25 14:57:52 CONTENT_BROWSER_SENSORS_SENSORS_PROVIDER_IMPL_H_
+#define CONTENT_BROWSER_SENSORS_PROVIDER_IMPL_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "base/observer_list_threadsafe.h"
+#include "content/browser/sensors/sensors_provider.h"
+
+template <typename T> struct DefaultSingletonTraits;
+
+namespace sensors {
+
+class ProviderImpl : public Provider {
+ public:
+ static ProviderImpl* GetInstance();
+
+ // Provider implementation
+ virtual void AddListener(Listener* listener) OVERRIDE;
tfarina 2011/07/25 14:57:52 It's more common to have this named: AddObserver(
cwolfe 2011/07/25 15:49:45 Differences coming in later revisions. Most notabl
+ virtual void RemoveListener(Listener* listener) OVERRIDE;
+ virtual void ScreenOrientationChanged(const ScreenOrientation& change)
tfarina 2011/07/25 14:57:52 move this to the line below so you don't leave OVE
+ OVERRIDE;
+
+ private:
+ friend struct DefaultSingletonTraits<ProviderImpl>;
+
+ ProviderImpl();
+ virtual ~ProviderImpl();
+
+ typedef ObserverListThreadSafe<Listener> ListenerList;
+ scoped_refptr<ListenerList> listeners_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProviderImpl);
+};
+
+} // namespace sensors
+
+DISABLE_RUNNABLE_METHOD_REFCOUNT(sensors::ProviderImpl);
tfarina 2011/07/25 14:57:52 Add a comment explaining why you need this?
+
+#endif // CONTENT_BROWSER_SENSORS_PROVIDER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698