OLD | NEW |
(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_ |
OLD | NEW |