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

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

Issue 1723663005: Revert of [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 ScreenOrientationController_h 5 #ifndef ScreenOrientationController_h
6 #define ScreenOrientationController_h 6 #define ScreenOrientationController_h
7 7
8 #include "core/frame/LocalFrameLifecycleObserver.h" 8 #include "core/frame/LocalFrameLifecycleObserver.h"
9 #include "core/frame/PlatformEventController.h" 9 #include "core/frame/PlatformEventController.h"
10 #include "modules/ModulesExport.h" 10 #include "modules/ModulesExport.h"
(...skipping 19 matching lines...) Expand all
30 USING_FAST_MALLOC_WILL_BE_REMOVED(ScreenOrientationController); 30 USING_FAST_MALLOC_WILL_BE_REMOVED(ScreenOrientationController);
31 public: 31 public:
32 ~ScreenOrientationController() override; 32 ~ScreenOrientationController() override;
33 33
34 void setOrientation(ScreenOrientation*); 34 void setOrientation(ScreenOrientation*);
35 void notifyOrientationChanged(); 35 void notifyOrientationChanged();
36 36
37 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); 37 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*);
38 void unlock(); 38 void unlock();
39 39
40 void setOverride(WebScreenOrientationType, unsigned short angle);
41 void clearOverride();
42
40 static void provideTo(LocalFrame&, WebScreenOrientationClient*); 43 static void provideTo(LocalFrame&, WebScreenOrientationClient*);
41 static ScreenOrientationController* from(LocalFrame&); 44 static ScreenOrientationController* from(LocalFrame&);
42 static const char* supplementName(); 45 static const char* supplementName();
43 46
44 DECLARE_VIRTUAL_TRACE(); 47 DECLARE_VIRTUAL_TRACE();
45 48
46 private: 49 private:
47 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); 50 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
48 51
49 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t) ; 52 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t) ;
50 53
51 // Inherited from PlatformEventController. 54 // Inherited from PlatformEventController.
52 void didUpdateData() override; 55 void didUpdateData() override;
53 void registerWithDispatcher() override; 56 void registerWithDispatcher() override;
54 void unregisterWithDispatcher() override; 57 void unregisterWithDispatcher() override;
55 bool hasLastData() override; 58 bool hasLastData() override;
56 void pageVisibilityChanged() override; 59 void pageVisibilityChanged() override;
57 60
58 // Inherited from LocalFrameLifecycleObserver. 61 // Inherited from LocalFrameLifecycleObserver.
59 void willDetachFrameHost() override; 62 void willDetachFrameHost() override;
60 63
64 unsigned short effectiveAngle(ChromeClient&);
65 WebScreenOrientationType effectiveType(ChromeClient&);
66
61 void notifyDispatcher(); 67 void notifyDispatcher();
62 68
63 void updateOrientation(); 69 void updateOrientation();
64 70
65 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); 71 void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
66 72
67 bool isActiveAndVisible() const; 73 bool isActiveAndVisible() const;
68 74
69 PersistentWillBeMember<ScreenOrientation> m_orientation; 75 PersistentWillBeMember<ScreenOrientation> m_orientation;
70 WebScreenOrientationClient* m_client; 76 WebScreenOrientationClient* m_client;
71 Timer<ScreenOrientationController> m_dispatchEventTimer; 77 Timer<ScreenOrientationController> m_dispatchEventTimer;
78 bool m_override;
79 WebScreenOrientationType m_overrideType;
80 unsigned short m_overrideAngle;
72 }; 81 };
73 82
74 } // namespace blink 83 } // namespace blink
75 84
76 #endif // ScreenOrientationController_h 85 #endif // ScreenOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698