| 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() override; | 44 void contextDestroyed(Page*) override; |
| 45 // Inherited from ContextLifecycleObserver. |
| 46 void contextDestroyed(ExecutionContext*) override; |
| 45 | 47 |
| 46 bool keepAwake() const; | 48 bool keepAwake() const; |
| 47 void setKeepAwake(bool); | 49 void setKeepAwake(bool); |
| 48 | 50 |
| 49 static ScreenWakeLock* fromScreen(Screen&); | 51 static ScreenWakeLock* fromScreen(Screen&); |
| 50 void notifyService(); | 52 void notifyService(); |
| 51 | 53 |
| 52 device::mojom::blink::WakeLockServicePtr m_service; | 54 device::mojom::blink::WakeLockServicePtr m_service; |
| 53 bool m_keepAwake; | 55 bool m_keepAwake; |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 } // namespace blink | 58 } // namespace blink |
| 57 | 59 |
| 58 #endif // ScreenWakeLock_h | 60 #endif // ScreenWakeLock_h |
| OLD | NEW |