Index: content/browser/wake_lock/wake_lock_service_impl.h |
diff --git a/content/browser/wake_lock/wake_lock_service_impl.h b/content/browser/wake_lock/wake_lock_service_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c2aaf20cccfba1fe8c2dd85745083fdd3bb6894 |
--- /dev/null |
+++ b/content/browser/wake_lock/wake_lock_service_impl.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ |
+#define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "content/common/wake_lock_service.mojom.h" |
+#include "mojo/public/cpp/bindings/interface_request.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+ |
+namespace content { |
+ |
+class RenderFrameHost; |
+ |
+class WakeLockServiceImpl: public WakeLockService { |
+ public: |
+ class WakeLockServiceCallback { |
+ public: |
+ virtual ~WakeLockServiceCallback() { } |
+ virtual void RequestWakeLock(RenderFrameHost* render_frame_host) = 0; |
+ virtual void CancelWakeLock(RenderFrameHost* render_frame_host) = 0; |
+ }; |
+ |
+ ~WakeLockServiceImpl() override; |
+ |
+ static void CreateService(base::WeakPtr<WakeLockServiceCallback> callback, |
+ RenderFrameHost* render_frame_host, |
+ mojo::InterfaceRequest<WakeLockService> request); |
+ |
+ // WakeLockSevice |
mlamouri (slow - plz ping)
2015/08/06 09:18:51
// WakeLockService implementation.
alogvinov
2015/08/11 13:06:43
Done.
|
+ void RequestWakeLock() override; |
+ void CancelWakeLock() override; |
+ |
+ private: |
+ WakeLockServiceImpl(base::WeakPtr<WakeLockServiceCallback> callback, |
+ RenderFrameHost* render_frame_host, |
+ mojo::InterfaceRequest<WakeLockService> request); |
+ |
+ base::WeakPtr<WakeLockServiceCallback> callback_; |
+ RenderFrameHost* render_frame_host_; |
+ mojo::StrongBinding<WakeLockService> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WakeLockServiceImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_ |