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

Unified Diff: device/wake_lock/wake_lock_context_provider.h

Issue 2734943003: Device Service: Decouple Wake Lock from //content (Closed)
Patch Set: Rebase Created 3 years, 9 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: device/wake_lock/wake_lock_context_provider.h
diff --git a/device/wake_lock/wake_lock_context_provider.h b/device/wake_lock/wake_lock_context_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..9909a08986578fb46747601572d5e5a98b9bb47e
--- /dev/null
+++ b/device/wake_lock/wake_lock_context_provider.h
@@ -0,0 +1,44 @@
+// Copyright 2017 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 DEVICE_WAKE_LOCK_WAKE_LOCK_CONTEXT_PROVIDER_H_
+#define DEVICE_WAKE_LOCK_WAKE_LOCK_CONTEXT_PROVIDER_H_
+
+#include "base/sequenced_task_runner.h"
+#include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
+#include "device/wake_lock/public/interfaces/wake_lock_context_provider.mojom.h"
+#include "device/wake_lock/wake_lock_service_context.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace device {
+
+// Serves requests for WakeLockContext connections.
+class WakeLockContextProvider : public mojom::WakeLockContextProvider {
+ public:
+ WakeLockContextProvider(
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ const WakeLockContextCallback& native_view_getter);
+ ~WakeLockContextProvider() override;
+
+ static void Create(
+ mojom::WakeLockContextProviderRequest request,
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ const WakeLockContextCallback& native_view_getter);
+
+ // mojom::WakeLockContextProvider:
+ void GetContext(
+ int context_id,
+ mojo::InterfaceRequest<mojom::WakeLockContext> request) override;
+
+ private:
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
+ WakeLockContextCallback native_view_getter_;
+
+ DISALLOW_COPY_AND_ASSIGN(WakeLockContextProvider);
+};
+
+} // namespace device
+
+#endif // DEVICE_WAKE_LOCK_WAKE_LOCK_CONTEXT_PROVIDER_H_
« no previous file with comments | « device/wake_lock/public/interfaces/wake_lock_context_provider.mojom ('k') | device/wake_lock/wake_lock_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698