OLD | NEW |
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 "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 ~ScreenOrientation() override; | 32 ~ScreenOrientation() override; |
33 | 33 |
34 // EventTarget implementation. | 34 // EventTarget implementation. |
35 const WTF::AtomicString& interfaceName() const override; | 35 const WTF::AtomicString& interfaceName() const override; |
36 ExecutionContext* getExecutionContext() const override; | 36 ExecutionContext* getExecutionContext() const override; |
37 | 37 |
38 String type() const; | 38 String type() const; |
39 unsigned short angle() const; | 39 unsigned short angle() const; |
40 | 40 |
| 41 WebScreenOrientationType getType() const; |
41 void setType(WebScreenOrientationType); | 42 void setType(WebScreenOrientationType); |
42 void setAngle(unsigned short); | 43 void setAngle(unsigned short); |
43 | 44 |
44 ScriptPromise lock(ScriptState*, const AtomicString& orientation); | 45 ScriptPromise lock(ScriptState*, const AtomicString& orientation); |
45 void unlock(); | 46 void unlock(); |
46 | 47 |
47 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); |
48 | 49 |
49 // Helper being used by this class and LockOrientationCallback. | 50 // Helper being used by this class and LockOrientationCallback. |
50 static const AtomicString& orientationTypeToString(WebScreenOrientationType); | 51 static const AtomicString& orientationTypeToString(WebScreenOrientationType); |
51 | 52 |
52 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
53 | 54 |
54 private: | 55 private: |
55 explicit ScreenOrientation(LocalFrame*); | 56 explicit ScreenOrientation(LocalFrame*); |
56 | 57 |
57 ScreenOrientationControllerImpl* controller(); | 58 ScreenOrientationControllerImpl* controller(); |
58 | 59 |
59 WebScreenOrientationType m_type; | 60 WebScreenOrientationType m_type; |
60 unsigned short m_angle; | 61 unsigned short m_angle; |
61 }; | 62 }; |
62 | 63 |
63 } // namespace blink | 64 } // namespace blink |
64 | 65 |
65 #endif // ScreenOrientation_h | 66 #endif // ScreenOrientation_h |
OLD | NEW |