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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientationDispatcher.h

Issue 419643008: Make Screen Orientation use Platform Events in order to handle polling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@platform_events
Patch Set: rebase Created 6 years, 4 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
OLDNEW
(Empty)
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.
4
5 #ifndef ScreenOrientationDispatcher_h
6 #define ScreenOrientationDispatcher_h
7
8 #include "core/frame/PlatformEventDispatcher.h"
9
10 namespace blink {
11
12 class FrameView;
13 class ScreenOrientation;
14
15 // ScreenOrientationDispatcher is a singleton that handles whether the current
16 // Blink instance should be listening to the screen orientation platform events.
17 // It is not a common implementation of PlatformEventDispatcher in the sense
18 // that it doesn't actually dispatch events but simply start/stop listening. The
19 // reason being that screen orientation events are always sent to the WebFrame's
20 // but some platforms require to poll to have an accurate reporting. When
21 // ScreenOrientationDispatcher is listening, that means that the platform should
22 // be polling if required.
23 class ScreenOrientationDispatcher FINAL :
24 public PlatformEventDispatcher {
25 public:
26 static ScreenOrientationDispatcher& instance();
27
28 private:
29 ScreenOrientationDispatcher();
30 virtual ~ScreenOrientationDispatcher();
31
32 // Inherited from PlatformEventDispatcher.
33 virtual void startListening() OVERRIDE;
34 virtual void stopListening() OVERRIDE;
35 };
36
37 } // namespace blink
38
39 #endif // ScreenOrientationDispatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698