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

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

Issue 241203003: Screen Orientation: fire event on Window instead of Screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@ScreenOrientationUndefined
Patch Set: fix tests Created 6 years, 8 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
« no previous file with comments | « Source/core/frame/Screen.idl ('k') | Source/modules/screen_orientation/ScreenOrientation.idl » ('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 ScreenOrientation_h 5 #ifndef ScreenOrientation_h
6 #define ScreenOrientation_h 6 #define ScreenOrientation_h
7 7
8 #include "core/events/EventTarget.h"
9 #include "core/frame/DOMWindowProperty.h" 8 #include "core/frame/DOMWindowProperty.h"
10 #include "heap/Handle.h" 9 #include "heap/Handle.h"
11 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
12 #include "platform/Timer.h" 11 #include "platform/Timer.h"
13 #include "public/platform/WebScreenOrientationLockType.h" 12 #include "public/platform/WebScreenOrientationLockType.h"
14 #include "wtf/text/AtomicString.h" 13 #include "wtf/text/AtomicString.h"
15 #include "wtf/text/WTFString.h" 14 #include "wtf/text/WTFString.h"
16 15
17 namespace WebCore { 16 namespace WebCore {
18 17
19 class Document; 18 class Document;
20 class Screen; 19 class Screen;
21 20
22 class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<Scr eenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty { 21 class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<Scr eenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty {
23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation);
24 public: 23 public:
25 static ScreenOrientation& from(Screen&); 24 static ScreenOrientation& from(Screen&);
26 virtual ~ScreenOrientation(); 25 virtual ~ScreenOrientation();
27 26
28 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange);
29
30 static const AtomicString& orientation(Screen&); 27 static const AtomicString& orientation(Screen&);
31 static bool lockOrientation(Screen&, const AtomicString& orientation); 28 static bool lockOrientation(Screen&, const AtomicString& orientation);
32 static void unlockOrientation(Screen&); 29 static void unlockOrientation(Screen&);
33 30
34 virtual void trace(Visitor*) { } 31 virtual void trace(Visitor*) { }
35 32
36 private: 33 private:
37 explicit ScreenOrientation(Screen&); 34 explicit ScreenOrientation(Screen&);
38 35
39 void lockOrientationAsync(blink::WebScreenOrientationLockType); 36 void lockOrientationAsync(blink::WebScreenOrientationLockType);
40 void orientationLockTimerFired(Timer<ScreenOrientation>*); 37 void orientationLockTimerFired(Timer<ScreenOrientation>*);
41 38
42 static const char* supplementName(); 39 static const char* supplementName();
43 Document* document() const; 40 Document* document() const;
44 41
45 Timer<ScreenOrientation> m_orientationLockTimer; 42 Timer<ScreenOrientation> m_orientationLockTimer;
46 blink::WebScreenOrientationLockType m_prospectiveLock; 43 blink::WebScreenOrientationLockType m_prospectiveLock;
47 }; 44 };
48 45
49 } // namespace WebCore 46 } // namespace WebCore
50 47
51 #endif // ScreenOrientation_h 48 #endif // ScreenOrientation_h
OLDNEW
« no previous file with comments | « Source/core/frame/Screen.idl ('k') | Source/modules/screen_orientation/ScreenOrientation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698