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

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

Issue 169403006: Screen Orientation API: screen.orientation & orientationchange event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
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 ScreenOrientationController_h
6 #define ScreenOrientationController_h
7
8 #include "modules/screen_orientation/ScreenOrientation.h"
9 #include "platform/Supplementable.h"
10 #include "wtf/HashSet.h"
11 #include "wtf/PassOwnPtr.h"
12
13 namespace WebCore {
14
15 class Page;
16
17 class ScreenOrientationController : public Supplement<Page> {
18 WTF_MAKE_NONCOPYABLE(ScreenOrientationController);
19 public:
20 static PassOwnPtr<ScreenOrientationController> create();
21 virtual ~ScreenOrientationController();
22
23 void addObserver(ScreenOrientation*);
24 void removeObserver(ScreenOrientation*);
25
26 // API for Supplement<Page>.
27 static const char* supplementName();
28 static ScreenOrientationController* from(Page*);
29
30 void orientationChanged(ScreenOrientationValue);
31 ScreenOrientationValue orientation() const { return m_orientation; }
32
33 private:
34 ScreenOrientationController();
35
36 ScreenOrientationValue m_orientation;
37 typedef HashSet<ScreenOrientation*> ObserversSet;
38 ObserversSet m_observers;
39 };
40
41 void provideScreenOrientationTo(Page*);
42
43 } // namespace WebCore
44
45 #endif // ScreenOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698