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

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

Issue 1711083002: [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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
43 static void provideTo(LocalFrame&, WebScreenOrientationClient*); 40 static void provideTo(LocalFrame&, WebScreenOrientationClient*);
44 static ScreenOrientationController* from(LocalFrame&); 41 static ScreenOrientationController* from(LocalFrame&);
45 static const char* supplementName(); 42 static const char* supplementName();
46 43
47 DECLARE_VIRTUAL_TRACE(); 44 DECLARE_VIRTUAL_TRACE();
48 45
49 private: 46 private:
50 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); 47 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
51 48
52 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t) ; 49 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t) ;
53 50
54 // Inherited from PlatformEventController. 51 // Inherited from PlatformEventController.
55 void didUpdateData() override; 52 void didUpdateData() override;
56 void registerWithDispatcher() override; 53 void registerWithDispatcher() override;
57 void unregisterWithDispatcher() override; 54 void unregisterWithDispatcher() override;
58 bool hasLastData() override; 55 bool hasLastData() override;
59 void pageVisibilityChanged() override; 56 void pageVisibilityChanged() override;
60 57
61 // Inherited from LocalFrameLifecycleObserver. 58 // Inherited from LocalFrameLifecycleObserver.
62 void willDetachFrameHost() override; 59 void willDetachFrameHost() override;
63 60
64 unsigned short effectiveAngle(ChromeClient&);
65 WebScreenOrientationType effectiveType(ChromeClient&);
66
67 void notifyDispatcher(); 61 void notifyDispatcher();
68 62
69 void updateOrientation(); 63 void updateOrientation();
70 64
71 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); 65 void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
72 66
73 bool isActiveAndVisible() const; 67 bool isActiveAndVisible() const;
74 68
75 PersistentWillBeMember<ScreenOrientation> m_orientation; 69 PersistentWillBeMember<ScreenOrientation> m_orientation;
76 WebScreenOrientationClient* m_client; 70 WebScreenOrientationClient* m_client;
77 Timer<ScreenOrientationController> m_dispatchEventTimer; 71 Timer<ScreenOrientationController> m_dispatchEventTimer;
78 bool m_override;
79 WebScreenOrientationType m_overrideType;
80 unsigned short m_overrideAngle;
81 }; 72 };
82 73
83 } // namespace blink 74 } // namespace blink
84 75
85 #endif // ScreenOrientationController_h 76 #endif // ScreenOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698