OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ | |
6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ | |
7 | |
8 #include "base/memory/weak_ptr.h" | |
9 #include "content/common/wake_lock_service.mojom.h" | |
10 #include "mojo/public/cpp/bindings/interface_request.h" | |
11 #include "mojo/public/cpp/bindings/strong_binding.h" | |
12 | |
13 namespace content { | |
14 | |
15 class RenderFrameHost; | |
16 | |
17 class WakeLockServiceImpl: public WakeLockService { | |
18 public: | |
19 class WakeLockServiceCallback { | |
20 public: | |
21 virtual ~WakeLockServiceCallback() { } | |
22 virtual void RequestWakeLock(RenderFrameHost* render_frame_host) = 0; | |
23 virtual void CancelWakeLock(RenderFrameHost* render_frame_host) = 0; | |
24 }; | |
25 | |
26 ~WakeLockServiceImpl() override; | |
27 | |
28 static void CreateService(base::WeakPtr<WakeLockServiceCallback> callback, | |
29 RenderFrameHost* render_frame_host, | |
30 mojo::InterfaceRequest<WakeLockService> request); | |
31 | |
32 // WakeLockSevice implementation. | |
33 void RequestWakeLock() override; | |
34 void CancelWakeLock() override; | |
35 | |
36 private: | |
37 WakeLockServiceImpl(base::WeakPtr<WakeLockServiceCallback> callback, | |
38 RenderFrameHost* render_frame_host, | |
39 mojo::InterfaceRequest<WakeLockService> request); | |
mlamouri (slow - plz ping)
2015/08/21 10:03:35
I think you should pass the WakeLockServiceContext
alogvinov
2015/08/26 14:47:19
Done.
| |
40 | |
41 base::WeakPtr<WakeLockServiceCallback> callback_; | |
42 RenderFrameHost* render_frame_host_; | |
43 mojo::StrongBinding<WakeLockService> binding_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceImpl); | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ | |
OLD | NEW |