OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ScreenWakeLock_h | 5 #ifndef ScreenWakeLock_h |
6 #define ScreenWakeLock_h | 6 #define ScreenWakeLock_h |
7 | 7 |
8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/page/PageVisibilityObserver.h" | 10 #include "core/page/PageVisibilityObserver.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 ~ScreenWakeLock() = default; | 35 ~ScreenWakeLock() = default; |
36 | 36 |
37 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
38 | 38 |
39 private: | 39 private: |
40 explicit ScreenWakeLock(LocalFrame&); | 40 explicit ScreenWakeLock(LocalFrame&); |
41 | 41 |
42 // Inherited from PageVisibilityObserver. | 42 // Inherited from PageVisibilityObserver. |
43 void pageVisibilityChanged() override; | 43 void pageVisibilityChanged() override; |
44 void contextDestroyed(Page*) override; | 44 |
45 // Inherited from ContextLifecycleObserver. | 45 // Inherited from ContextLifecycleObserver. |
46 void contextDestroyed(ExecutionContext*) override; | 46 void contextDestroyed(ExecutionContext*) override; |
47 | 47 |
48 bool keepAwake() const; | 48 bool keepAwake() const; |
49 void setKeepAwake(bool); | 49 void setKeepAwake(bool); |
50 | 50 |
51 static ScreenWakeLock* fromScreen(Screen&); | 51 static ScreenWakeLock* fromScreen(Screen&); |
52 void notifyService(); | 52 void notifyService(); |
53 | 53 |
54 device::mojom::blink::WakeLockServicePtr m_service; | 54 device::mojom::blink::WakeLockServicePtr m_service; |
55 bool m_keepAwake; | 55 bool m_keepAwake; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace blink | 58 } // namespace blink |
59 | 59 |
60 #endif // ScreenWakeLock_h | 60 #endif // ScreenWakeLock_h |
OLD | NEW |