Index: content/renderer/screen_orientation/screen_orientation_observer.h |
diff --git a/content/renderer/screen_orientation/screen_orientation_observer.h b/content/renderer/screen_orientation/screen_orientation_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f1ed843f819f16db5e3673755a92c21e9ed29178 |
--- /dev/null |
+++ b/content/renderer/screen_orientation/screen_orientation_observer.h |
@@ -0,0 +1,31 @@ |
+// Copyright 2014 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/public/renderer/platform_event_observer.h" |
+ |
+namespace content { |
+ |
+// ScreenOrientationObserver is a helper class implementing the |
+// PlatformEventObserver template with blink::WebPlatformEventListener, which is |
+// a pure virtual class because it doesn't expect listeners. |
+// It is implemented on top of PlatformEventObserver to make sure it follows a |
+// common code path even though it only uses part of this code path: it is not |
+// expected to receive messages back but should send messages to start/stop |
+// listening. |
+// The intent of this class is to make sure that platforms that can't listen for |
+// display rotations at a marginal cost can be told when to actually do it. |
+class ScreenOrientationObserver |
+ : public PlatformEventObserver<blink::WebPlatformEventListener> { |
+ public: |
+ ScreenOrientationObserver(); |
+ |
+ // Overriding this method just to make sure |listener| is always null. |
+ virtual void Start(blink::WebPlatformEventListener* listener) OVERRIDE; |
+ |
+ protected: |
+ virtual void SendStartMessage() OVERRIDE; |
+ virtual void SendStopMessage() OVERRIDE; |
+}; |
+ |
+}; // namespace content |