OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 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 // The SuspendController keeps track of actions related to the computer going | |
6 // into power savings mode. Its purpose right now is to close all network | |
7 // requests and prevent creation of new requests until the computer resumes. | |
8 | |
9 #ifndef CHROME_BROWSER_SUSPEND_CONTROLLER_H__ | |
10 #define CHROME_BROWSER_SUSPEND_CONTROLLER_H__ | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "chrome/browser/profile.h" | |
14 | |
15 class Profile; | |
16 | |
17 // The browser process owns the only instance of this class. | |
18 class SuspendController : public base::RefCountedThreadSafe<SuspendController> { | |
19 public: | |
20 SuspendController() {} | |
21 ~SuspendController() {} | |
22 | |
23 // Called when the system is going to be suspended. | |
24 static void OnSuspend(Profile* profile); | |
25 | |
26 // Called when the system has been resumed. | |
27 static void OnResume(Profile* profile); | |
28 | |
29 private: | |
30 // Run on the io_thread. | |
31 void StopRequests(Profile* profile); | |
32 void AllowNewRequests(Profile* profile); | |
33 | |
34 static bool is_suspended_; | |
35 | |
36 DISALLOW_EVIL_CONSTRUCTORS(SuspendController); | |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_SUSPEND_CONTROLLER_H__ | |
40 | |
OLD | NEW |