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

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

Issue 943483003: Gracefully handle screen.orientation access over unsupported frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch to testharness.js Created 5 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
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/FrameDestructionObserver.h" 8 #include "core/frame/FrameDestructionObserver.h"
9 #include "core/frame/PlatformEventController.h" 9 #include "core/frame/PlatformEventController.h"
10 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
(...skipping 24 matching lines...) Expand all
35 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); 35 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*);
36 void unlock(); 36 void unlock();
37 37
38 static void provideTo(LocalFrame&, WebScreenOrientationClient*); 38 static void provideTo(LocalFrame&, WebScreenOrientationClient*);
39 static ScreenOrientationController* from(LocalFrame&); 39 static ScreenOrientationController* from(LocalFrame&);
40 static const char* supplementName(); 40 static const char* supplementName();
41 41
42 DECLARE_VIRTUAL_TRACE(); 42 DECLARE_VIRTUAL_TRACE();
43 43
44 private: 44 private:
45 explicit ScreenOrientationController(LocalFrame&, WebScreenOrientationClient *); 45 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
46
46 static WebScreenOrientationType computeOrientation(FrameView*); 47 static WebScreenOrientationType computeOrientation(FrameView*);
47 48
48 // Inherited from PlatformEventController. 49 // Inherited from PlatformEventController.
49 virtual void didUpdateData() override; 50 virtual void didUpdateData() override;
50 virtual void registerWithDispatcher() override; 51 virtual void registerWithDispatcher() override;
51 virtual void unregisterWithDispatcher() override; 52 virtual void unregisterWithDispatcher() override;
52 virtual bool hasLastData() override; 53 virtual bool hasLastData() override;
53 virtual void pageVisibilityChanged() override; 54 virtual void pageVisibilityChanged() override;
54 55
55 // Inherited from FrameDestructionObserver. 56 // Inherited from FrameDestructionObserver.
56 virtual void willDetachFrameHost() override; 57 virtual void willDetachFrameHost() override;
57 58
58 void notifyDispatcher(); 59 void notifyDispatcher();
59 60
60 void updateOrientation(); 61 void updateOrientation();
61 62
62 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); 63 void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
63 64
64 bool isActiveAndVisible() const; 65 bool isActiveAndVisible() const;
65 66
66 PersistentWillBeMember<ScreenOrientation> m_orientation; 67 PersistentWillBeMember<ScreenOrientation> m_orientation;
67 WebScreenOrientationClient* m_client; 68 WebScreenOrientationClient* m_client;
68 Timer<ScreenOrientationController> m_dispatchEventTimer; 69 Timer<ScreenOrientationController> m_dispatchEventTimer;
69 }; 70 };
70 71
71 } // namespace blink 72 } // namespace blink
72 73
73 #endif // ScreenOrientationController_h 74 #endif // ScreenOrientationController_h
OLDNEW
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698