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/frame/LocalFrameLifecycleObserver.h" | 8 #include "core/frame/LocalFrameLifecycleObserver.h" |
9 #include "core/page/PageLifecycleObserver.h" | 9 #include "core/page/PageLifecycleObserver.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class LocalFrame; | 15 class LocalFrame; |
16 class Screen; | 16 class Screen; |
17 class WebWakeLockClient; | 17 class WebWakeLockClient; |
18 | 18 |
19 class MODULES_EXPORT ScreenWakeLock final : public GarbageCollected<ScreenWakeLo
ck>, public HeapSupplement<LocalFrame>, public PageLifecycleObserver, public Loc
alFrameLifecycleObserver { | 19 class MODULES_EXPORT ScreenWakeLock final : public GarbageCollected<ScreenWakeLo
ck>, public Supplement<LocalFrame>, public PageLifecycleObserver, public LocalFr
ameLifecycleObserver { |
20 USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); | 20 USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); |
21 WTF_MAKE_NONCOPYABLE(ScreenWakeLock); | 21 WTF_MAKE_NONCOPYABLE(ScreenWakeLock); |
22 public: | 22 public: |
23 static bool keepAwake(Screen&); | 23 static bool keepAwake(Screen&); |
24 static void setKeepAwake(Screen&, bool); | 24 static void setKeepAwake(Screen&, bool); |
25 | 25 |
26 bool keepAwake() const { return m_keepAwake; } | 26 bool keepAwake() const { return m_keepAwake; } |
27 void setKeepAwake(bool); | 27 void setKeepAwake(bool); |
28 | 28 |
29 static const char* supplementName(); | 29 static const char* supplementName(); |
(...skipping 15 matching lines...) Expand all Loading... |
45 static ScreenWakeLock* fromScreen(Screen&); | 45 static ScreenWakeLock* fromScreen(Screen&); |
46 void notifyClient(); | 46 void notifyClient(); |
47 | 47 |
48 WebWakeLockClient* m_client; | 48 WebWakeLockClient* m_client; |
49 bool m_keepAwake; | 49 bool m_keepAwake; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // ScreenWakeLock_h | 54 #endif // ScreenWakeLock_h |
OLD | NEW |