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

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

Issue 1220643002: Revert of [DevTools] Implement screen orientation override. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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
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 18 matching lines...) Expand all
29 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); 29 WTF_MAKE_NONCOPYABLE(ScreenOrientationController);
30 public: 30 public:
31 virtual ~ScreenOrientationController(); 31 virtual ~ScreenOrientationController();
32 32
33 void setOrientation(ScreenOrientation*); 33 void setOrientation(ScreenOrientation*);
34 void notifyOrientationChanged(); 34 void notifyOrientationChanged();
35 35
36 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); 36 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*);
37 void unlock(); 37 void unlock();
38 38
39 void setOverride(WebScreenOrientationType, unsigned short angle);
40 void clearOverride();
41
42 static void provideTo(LocalFrame&, WebScreenOrientationClient*); 39 static void provideTo(LocalFrame&, WebScreenOrientationClient*);
43 static ScreenOrientationController* from(LocalFrame&); 40 static ScreenOrientationController* from(LocalFrame&);
44 static const char* supplementName(); 41 static const char* supplementName();
45 42
46 DECLARE_VIRTUAL_TRACE(); 43 DECLARE_VIRTUAL_TRACE();
47 44
48 private: 45 private:
49 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); 46 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
50 47
51 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t) ; 48 static WebScreenOrientationType computeOrientation(ChromeClient&);
52 49
53 // Inherited from PlatformEventController. 50 // Inherited from PlatformEventController.
54 virtual void didUpdateData() override; 51 virtual void didUpdateData() override;
55 virtual void registerWithDispatcher() override; 52 virtual void registerWithDispatcher() override;
56 virtual void unregisterWithDispatcher() override; 53 virtual void unregisterWithDispatcher() override;
57 virtual bool hasLastData() override; 54 virtual bool hasLastData() override;
58 virtual void pageVisibilityChanged() override; 55 virtual void pageVisibilityChanged() override;
59 56
60 // Inherited from LocalFrameLifecycleObserver. 57 // Inherited from LocalFrameLifecycleObserver.
61 virtual void willDetachFrameHost() override; 58 virtual void willDetachFrameHost() override;
62 59
63 unsigned short effectiveAngle(ChromeClient&);
64 WebScreenOrientationType effectiveType(ChromeClient&);
65
66 void notifyDispatcher(); 60 void notifyDispatcher();
67 61
68 void updateOrientation(); 62 void updateOrientation();
69 63
70 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); 64 void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
71 65
72 bool isActiveAndVisible() const; 66 bool isActiveAndVisible() const;
73 67
74 PersistentWillBeMember<ScreenOrientation> m_orientation; 68 PersistentWillBeMember<ScreenOrientation> m_orientation;
75 WebScreenOrientationClient* m_client; 69 WebScreenOrientationClient* m_client;
76 Timer<ScreenOrientationController> m_dispatchEventTimer; 70 Timer<ScreenOrientationController> m_dispatchEventTimer;
77 bool m_override;
78 WebScreenOrientationType m_overrideType;
79 unsigned short m_overrideAngle;
80 }; 71 };
81 72
82 } // namespace blink 73 } // namespace blink
83 74
84 #endif // ScreenOrientationController_h 75 #endif // ScreenOrientationController_h
OLDNEW
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/screen_orientation/ScreenOrientationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698