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/page/PageVisibilityObserver.h" | 9 #include "core/page/PageVisibilityObserver.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "public/platform/modules/wake_lock/wake_lock_service.mojom-blink.h" | 11 #include "public/platform/modules/wake_lock/wake_lock_service.mojom-blink.h" |
12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class LocalFrame; | 16 class LocalFrame; |
17 class Screen; | 17 class Screen; |
18 class ServiceRegistry; | |
19 | 18 |
20 class MODULES_EXPORT ScreenWakeLock final : public GarbageCollectedFinalized<Scr
eenWakeLock>, public Supplement<LocalFrame>, public ContextLifecycleObserver, pu
blic PageVisibilityObserver { | 19 class MODULES_EXPORT ScreenWakeLock final : public GarbageCollectedFinalized<Scr
eenWakeLock>, public Supplement<LocalFrame>, public ContextLifecycleObserver, pu
blic PageVisibilityObserver { |
21 USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); | 20 USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); |
22 WTF_MAKE_NONCOPYABLE(ScreenWakeLock); | 21 WTF_MAKE_NONCOPYABLE(ScreenWakeLock); |
23 public: | 22 public: |
24 static bool keepAwake(Screen&); | 23 static bool keepAwake(Screen&); |
25 static void setKeepAwake(Screen&, bool); | 24 static void setKeepAwake(Screen&, bool); |
26 | 25 |
27 static const char* supplementName(); | 26 static const char* supplementName(); |
28 static ScreenWakeLock* from(LocalFrame*); | 27 static ScreenWakeLock* from(LocalFrame*); |
(...skipping 15 matching lines...) Expand all Loading... |
44 static ScreenWakeLock* fromScreen(Screen&); | 43 static ScreenWakeLock* fromScreen(Screen&); |
45 void notifyService(); | 44 void notifyService(); |
46 | 45 |
47 mojom::blink::WakeLockServicePtr m_service; | 46 mojom::blink::WakeLockServicePtr m_service; |
48 bool m_keepAwake; | 47 bool m_keepAwake; |
49 }; | 48 }; |
50 | 49 |
51 } // namespace blink | 50 } // namespace blink |
52 | 51 |
53 #endif // ScreenWakeLock_h | 52 #endif // ScreenWakeLock_h |
OLD | NEW |