Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: content/renderer/wake_lock/wake_lock_dispatcher.h

Issue 1107333002: Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added visibility check to browsertest Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/wake_lock/wake_lock_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/wake_lock/wake_lock_dispatcher.h
diff --git a/content/renderer/wake_lock/wake_lock_dispatcher.h b/content/renderer/wake_lock/wake_lock_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..e36a3e020ac77636a727c65445253082dccc0a3e
--- /dev/null
+++ b/content/renderer/wake_lock/wake_lock_dispatcher.h
@@ -0,0 +1,31 @@
+// 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_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
+#define CONTENT_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
+
+#include "content/common/wake_lock_service.mojom.h"
+#include "content/public/renderer/render_frame_observer.h"
+#include "third_party/WebKit/public/platform/modules/wake_lock/WebWakeLockClient.h"
+
+namespace content {
+
+// WakeLockDispatcher sends wake lock messages to the browser process using the
+// Mojo WakeLockService.
+class WakeLockDispatcher : public RenderFrameObserver,
+ public blink::WebWakeLockClient {
+ public:
+ explicit WakeLockDispatcher(RenderFrame* render_frame);
+ ~WakeLockDispatcher() override;
+
+ private:
+ // WebWakeLockClient implementation.
+ virtual void requestKeepScreenAwake(bool keepScreenAwake);
+
+ WakeLockServicePtr wake_lock_service_;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/wake_lock/wake_lock_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698