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

Unified Diff: chrome/browser/wake_lock/wake_lock_preference.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/wake_lock_preference.h
diff --git a/chrome/browser/wake_lock/wake_lock_preference.h b/chrome/browser/wake_lock/wake_lock_preference.h
new file mode 100644
index 0000000000000000000000000000000000000000..88275a5b2a8fb2e81ce1b50c7d623ed67772b633
--- /dev/null
+++ b/chrome/browser/wake_lock/wake_lock_preference.h
@@ -0,0 +1,39 @@
+// 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_WAKE_LOCK_PREFERENCE_H_
+#define CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_PREFERENCE_H_
+
+#include <string>
+#include "base/memory/scoped_ptr.h"
+
+class PrefService;
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+class WakeLockPreference {
+ public:
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+ static scoped_ptr<WakeLockPreference> createWakeLockPreference(
+ int render_process_id, int routed_id);
+
+ bool isSavedAllow(const std::string& key);
+ bool isAllowed(const std::string& key);
+ void setAllowed(const std::string& key, bool allowed);
+ private:
+ enum WakeLockPreferenceStatus {
+ WakeLockPreferenceNotFound = 0,
+ WakeLockPreferenceYes,
+ WakeLockPreferenceNo
+ };
+
+ WakeLockPreference(int render_process_id, int routed_id);
+ WakeLockPreferenceStatus getAllowed(const std::string& key);
+
+ PrefService* pref_service_;
+};
+
+#endif // CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_PREFERENCE_H_

Powered by Google App Engine
This is Rietveld 408576698