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

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

Issue 1195793008: [DevTools] Implement screen orientation override. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
39 static void provideTo(LocalFrame&, WebScreenOrientationClient*); 42 static void provideTo(LocalFrame&, WebScreenOrientationClient*);
40 static ScreenOrientationController* from(LocalFrame&); 43 static ScreenOrientationController* from(LocalFrame&);
41 static const char* supplementName(); 44 static const char* supplementName();
42 45
43 DECLARE_VIRTUAL_TRACE(); 46 DECLARE_VIRTUAL_TRACE();
44 47
45 private: 48 private:
46 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); 49 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
47 50
48 static WebScreenOrientationType computeOrientation(ChromeClient&); 51 static WebScreenOrientationType computeOrientation(ChromeClient&);
(...skipping 12 matching lines...) Expand all
61 64
62 void updateOrientation(); 65 void updateOrientation();
63 66
64 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); 67 void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
65 68
66 bool isActiveAndVisible() const; 69 bool isActiveAndVisible() const;
67 70
68 PersistentWillBeMember<ScreenOrientation> m_orientation; 71 PersistentWillBeMember<ScreenOrientation> m_orientation;
69 WebScreenOrientationClient* m_client; 72 WebScreenOrientationClient* m_client;
70 Timer<ScreenOrientationController> m_dispatchEventTimer; 73 Timer<ScreenOrientationController> m_dispatchEventTimer;
74 bool m_override;
75 WebScreenOrientationType m_overrideType;
76 unsigned short m_overrideAngle;
71 }; 77 };
72 78
73 } // namespace blink 79 } // namespace blink
74 80
75 #endif // ScreenOrientationController_h 81 #endif // ScreenOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698