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

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

Issue 659953002: Add a pure virtual method to the GarbageCollectedMixin class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/presentation/Presentation.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ScreenOrientationDispatcher_h 5 #ifndef ScreenOrientationDispatcher_h
6 #define ScreenOrientationDispatcher_h 6 #define ScreenOrientationDispatcher_h
7 7
8 #include "core/frame/PlatformEventDispatcher.h" 8 #include "core/frame/PlatformEventDispatcher.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // ScreenOrientationDispatcher is a singleton that handles whether the current 13 // ScreenOrientationDispatcher is a singleton that handles whether the current
14 // Blink instance should be listening to the screen orientation platform events. 14 // Blink instance should be listening to the screen orientation platform events.
15 // It is not a common implementation of PlatformEventDispatcher in the sense 15 // It is not a common implementation of PlatformEventDispatcher in the sense
16 // that it doesn't actually dispatch events but simply start/stop listening. The 16 // that it doesn't actually dispatch events but simply start/stop listening. The
17 // reason being that screen orientation events are always sent to the WebFrame's 17 // reason being that screen orientation events are always sent to the WebFrame's
18 // but some platforms require to poll to have an accurate reporting. When 18 // but some platforms require to poll to have an accurate reporting. When
19 // ScreenOrientationDispatcher is listening, that means that the platform should 19 // ScreenOrientationDispatcher is listening, that means that the platform should
20 // be polling if required. 20 // be polling if required.
21 class ScreenOrientationDispatcher final : public GarbageCollectedFinalized<Scree nOrientationDispatcher>, public PlatformEventDispatcher { 21 class ScreenOrientationDispatcher final : public GarbageCollectedFinalized<Scree nOrientationDispatcher>, public PlatformEventDispatcher {
22 USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationDispatcher);
22 public: 23 public:
23 static ScreenOrientationDispatcher& instance(); 24 static ScreenOrientationDispatcher& instance();
24 25
25 virtual void trace(Visitor*) override; 26 virtual void trace(Visitor*) override;
26 27
27 private: 28 private:
28 ScreenOrientationDispatcher(); 29 ScreenOrientationDispatcher();
29 30
30 // Inherited from PlatformEventDispatcher. 31 // Inherited from PlatformEventDispatcher.
31 virtual void startListening() override; 32 virtual void startListening() override;
32 virtual void stopListening() override; 33 virtual void stopListening() override;
33 }; 34 };
34 35
35 } // namespace blink 36 } // namespace blink
36 37
37 #endif // ScreenOrientationDispatcher_h 38 #endif // ScreenOrientationDispatcher_h
OLDNEW
« no previous file with comments | « Source/modules/presentation/Presentation.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698