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

Side by Side Diff: content/browser/wake_lock/wake_lock_manager.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 CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_
6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_
7
8 #include <set>
9 #include "base/memory/singleton.h"
10
11 namespace content {
12
13 class Lock;
14
15 class WakeLockManager {
16 public:
17 static WakeLockManager* GetInstance();
18
19 void createScreenLock(int render_process_id, int routed_id);
20 bool releaseScreenLock(int render_process_id, int routed_id);
21
22 // Used for both tab switching and minimizing/maximizing browser
23 void tabWasShown(int render_process_id, int routed_id);
24 void tabWasHidden(int render_process_id, int routed_id);
25
26 void createWebContentsObserver(int render_process_id, int routed_id);
27
28 virtual ~WakeLockManager();
29
30 private:
31 friend struct DefaultSingletonTraits<WakeLockManager>;
32 WakeLockManager();
33 void tabChangeVisibility(int render_process_id, int routed_id, bool visible);
34 Lock* getLock(int render_process_if, int routed_id);
35
36 // TODO(redchenko): need smart pointer
37 std::set<Lock*> locks_;
38
39 DISALLOW_COPY_AND_ASSIGN(WakeLockManager);
40 };
41 }
42
43 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698