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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_PREFERENCE_H_
6 #define CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_PREFERENCE_H_
7
8 #include <string>
9 #include "base/memory/scoped_ptr.h"
10
11 class PrefService;
12
13 namespace user_prefs {
14 class PrefRegistrySyncable;
15 }
16
17 class WakeLockPreference {
18 public:
19 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
20 static scoped_ptr<WakeLockPreference> createWakeLockPreference(
21 int render_process_id, int routed_id);
22
23 bool isSavedAllow(const std::string& key);
24 bool isAllowed(const std::string& key);
25 void setAllowed(const std::string& key, bool allowed);
26 private:
27 enum WakeLockPreferenceStatus {
28 WakeLockPreferenceNotFound = 0,
29 WakeLockPreferenceYes,
30 WakeLockPreferenceNo
31 };
32
33 WakeLockPreference(int render_process_id, int routed_id);
34 WakeLockPreferenceStatus getAllowed(const std::string& key);
35
36 PrefService* pref_service_;
37 };
38
39 #endif // CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_PREFERENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698