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

Unified Diff: content/browser/wake_lock/wake_lock_service_impl.cc

Issue 1107333002: Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: content/browser/wake_lock/wake_lock_service_impl.cc
diff --git a/content/browser/wake_lock/wake_lock_service_impl.cc b/content/browser/wake_lock/wake_lock_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..333512c8a753fcf0d6543c826259d6f19ada9cc9
--- /dev/null
+++ b/content/browser/wake_lock/wake_lock_service_impl.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "content/browser/wake_lock/wake_lock_service_impl.h"
+
+namespace content {
+
+WakeLockServiceImpl::WakeLockServiceImpl(
+ KeepScreenAwakeCallback callback,
+ mojo::InterfaceRequest<WakeLockService> request)
+ : callback_(callback),
+ binding_(this, request.Pass()) {
+}
+
+WakeLockServiceImpl::~WakeLockServiceImpl() {
+}
+
+// static
+void WakeLockServiceImpl::CreateService(
+ KeepScreenAwakeCallback callback,
+ mojo::InterfaceRequest<WakeLockService> request) {
+ new WakeLockServiceImpl(callback, request.Pass());
+}
+
+void WakeLockServiceImpl::KeepScreenAwake(bool intention) {
+ callback_.Run(intention);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698