aw: Ensure fallback tick unsets |block_invalidates_|
[chromium-blink-merge.git] / content / renderer / screen_orientation / screen_orientation_observer.h
blobf1ed843f819f16db5e3673755a92c21e9ed29178
1 // Copyright 2014 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.
5 #include "content/public/renderer/platform_event_observer.h"
7 namespace content {
9 // ScreenOrientationObserver is a helper class implementing the
10 // PlatformEventObserver template with blink::WebPlatformEventListener, which is
11 // a pure virtual class because it doesn't expect listeners.
12 // It is implemented on top of PlatformEventObserver to make sure it follows a
13 // common code path even though it only uses part of this code path: it is not
14 // expected to receive messages back but should send messages to start/stop
15 // listening.
16 // The intent of this class is to make sure that platforms that can't listen for
17 // display rotations at a marginal cost can be told when to actually do it.
18 class ScreenOrientationObserver
19 : public PlatformEventObserver<blink::WebPlatformEventListener> {
20 public:
21 ScreenOrientationObserver();
23 // Overriding this method just to make sure |listener| is always null.
24 virtual void Start(blink::WebPlatformEventListener* listener) OVERRIDE;
26 protected:
27 virtual void SendStartMessage() OVERRIDE;
28 virtual void SendStopMessage() OVERRIDE;
31 }; // namespace content