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

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

Issue 366853008: [screen-orientation] Expose orientation info in OrientationInformation interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 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
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/page/PageLifecycleObserver.h" 8 #include "core/page/PageLifecycleObserver.h"
9 #include "platform/Supplementable.h" 9 #include "platform/Supplementable.h"
10 #include "public/platform/WebLockOrientationCallback.h" 10 #include "public/platform/WebLockOrientationCallback.h"
11 #include "public/platform/WebScreenOrientationLockType.h" 11 #include "public/platform/WebScreenOrientationLockType.h"
12 #include "public/platform/WebScreenOrientationType.h" 12 #include "public/platform/WebScreenOrientationType.h"
13 13
14 namespace blink { 14 namespace blink {
15 class WebScreenOrientationClient; 15 class WebScreenOrientationClient;
16 } 16 }
17 17
18 namespace WebCore { 18 namespace WebCore {
19 19
20 class FrameView; 20 class FrameView;
21 class OrientationInformation;
21 22
22 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollectedFin alized<ScreenOrientationController>, public WillBeHeapSupplement<LocalFrame>, pu blic PageLifecycleObserver { 23 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollectedFin alized<ScreenOrientationController>, public WillBeHeapSupplement<LocalFrame>, pu blic PageLifecycleObserver {
23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController);
24 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); 25 WTF_MAKE_NONCOPYABLE(ScreenOrientationController);
25 public: 26 public:
26 virtual ~ScreenOrientationController(); 27 virtual ~ScreenOrientationController();
27 28
28 virtual void persistentHostHasBeenDestroyed() OVERRIDE; 29 virtual void persistentHostHasBeenDestroyed() OVERRIDE;
29 30
30 blink::WebScreenOrientationType orientation() const; 31 OrientationInformation* orientation();
32 void notifyOrientationChanged();
33
34 void lockOrientation(blink::WebScreenOrientationLockType, blink::WebLockOrie ntationCallback*);
35 void unlockOrientation();
31 36
32 static void provideTo(LocalFrame&, blink::WebScreenOrientationClient*); 37 static void provideTo(LocalFrame&, blink::WebScreenOrientationClient*);
33 static ScreenOrientationController& from(LocalFrame&); 38 static ScreenOrientationController& from(LocalFrame&);
34 static const char* supplementName(); 39 static const char* supplementName();
35 40
36 void lockOrientation(blink::WebScreenOrientationLockType, blink::WebLockOrie ntationCallback*); 41 virtual void trace(Visitor*);
37 void unlockOrientation();
38 42
39 private: 43 private:
40 explicit ScreenOrientationController(LocalFrame&, blink::WebScreenOrientatio nClient*); 44 explicit ScreenOrientationController(LocalFrame&, blink::WebScreenOrientatio nClient*);
41 static blink::WebScreenOrientationType computeOrientation(FrameView*); 45 static blink::WebScreenOrientationType computeOrientation(FrameView*);
42 46
43 // Inherited from PageLifecycleObserver. 47 // Inherited from PageLifecycleObserver.
44 virtual void pageVisibilityChanged() OVERRIDE; 48 virtual void pageVisibilityChanged() OVERRIDE;
45 49
46 blink::WebScreenOrientationType m_overrideOrientation; 50 void updateOrientation();
51
52 PersistentWillBeMember<OrientationInformation> m_orientation;
47 blink::WebScreenOrientationClient* m_client; 53 blink::WebScreenOrientationClient* m_client;
48 LocalFrame& m_frame; 54 LocalFrame& m_frame;
49 }; 55 };
50 56
51 } // namespace WebCore 57 } // namespace WebCore
52 58
53 #endif // ScreenOrientationController_h 59 #endif // ScreenOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698