Index: content/browser/wake_lock/wake_lock_manager.h |
diff --git a/content/browser/wake_lock/wake_lock_manager.h b/content/browser/wake_lock/wake_lock_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6f8d3e6e5891eced0176c8a432eb9432d540fa50 |
--- /dev/null |
+++ b/content/browser/wake_lock/wake_lock_manager.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 CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_ |
+#define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_ |
+ |
+#include <set> |
+#include "base/memory/singleton.h" |
+ |
+namespace content { |
+ |
+class Lock; |
+ |
+class WakeLockManager { |
+ public: |
+ static WakeLockManager* GetInstance(); |
+ |
+ void createScreenLock(int render_process_id, int routed_id); |
+ bool releaseScreenLock(int render_process_id, int routed_id); |
+ |
+ // Used for both tab switching and minimizing/maximizing browser |
+ void tabWasShown(int render_process_id, int routed_id); |
+ void tabWasHidden(int render_process_id, int routed_id); |
+ |
+ void createWebContentsObserver(int render_process_id, int routed_id); |
+ |
+ virtual ~WakeLockManager(); |
+ |
+ private: |
+ friend struct DefaultSingletonTraits<WakeLockManager>; |
+ WakeLockManager(); |
+ void tabChangeVisibility(int render_process_id, int routed_id, bool visible); |
+ Lock* getLock(int render_process_if, int routed_id); |
+ |
+ // TODO(redchenko): need smart pointer |
+ std::set<Lock*> locks_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WakeLockManager); |
+}; |
+} |
+ |
+#endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_MANAGER_H_ |