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

Unified Diff: chrome/browser/wake_lock/chrome_wake_lock_permission_context.h

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: chrome/browser/wake_lock/chrome_wake_lock_permission_context.h
diff --git a/chrome/browser/wake_lock/chrome_wake_lock_permission_context.h b/chrome/browser/wake_lock/chrome_wake_lock_permission_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..79bfb5128eef90c2243e200c119ba1c374946726
--- /dev/null
+++ b/chrome/browser/wake_lock/chrome_wake_lock_permission_context.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2014 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 CHROME_BROWSER_WAKE_LOCK_CHROME_WAKE_LOCK_PERMISSION_CONTEXT_H_
+#define CHROME_BROWSER_WAKE_LOCK_CHROME_WAKE_LOCK_PERMISSION_CONTEXT_H_
+
+#include "content/public/browser/wake_lock_permission_context.h"
+
+namespace content {
+class WebContents;
+}
+
+class PermissionRequestID;
+class Profile;
+
+class ChromeWakeLockPermissionContext
+ : public content::WakeLockPermissionContext {
+ public:
+ explicit ChromeWakeLockPermissionContext(Profile* profile);
+
+ // WakeLockPermissionContext:
+ virtual void RequestWakeLockPermission(
+ int render_process_id,
+ int render_view_id,
+ const GURL& requesting_frame,
+ WakeLockCallback callback) OVERRIDE;
+
+ void ShutdownOnUIThread();
+
+ protected:
+ virtual ~ChromeWakeLockPermissionContext();
+
+ Profile* profile() const { return profile_; }
+
+ private:
+ Profile* const profile_;
+ bool shutting_down_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeWakeLockPermissionContext);
+};
+
+#endif // CHROME_BROWSER_WAKE_LOCK_CHROME_WAKE_LOCK_PERMISSION_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698