diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 20:48:36 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 20:48:36 +0000 |
commit | 0a30765779382fa4cd46d47dab4db0ad607e7569 (patch) | |
tree | ae593d32fc4052115c428382f451bdd110bcf460 /chrome/browser/profile_manager.h | |
parent | a211dddeb82823e7bf1baa24eb9583f95db7de4e (diff) | |
download | chromium_src-0a30765779382fa4cd46d47dab4db0ad607e7569.zip chromium_src-0a30765779382fa4cd46d47dab4db0ad607e7569.tar.gz chromium_src-0a30765779382fa4cd46d47dab4db0ad607e7569.tar.bz2 |
A new shot at the old system monitor changelist.
Review URL: http://codereview.chromium.org/12883
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_manager.h')
-rw-r--r-- | chrome/browser/profile_manager.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/profile_manager.h b/chrome/browser/profile_manager.h index 5c3ad89..72f1d63 100644 --- a/chrome/browser/profile_manager.h +++ b/chrome/browser/profile_manager.h @@ -12,6 +12,9 @@ #include <vector> #include "base/basictypes.h" +#include "base/message_loop.h" +#include "base/non_thread_safe.h" +#include "base/system_monitor.h" #include "base/values.h" #include "chrome/browser/profile.h" @@ -57,7 +60,8 @@ class AvailableProfile { DISALLOW_EVIL_CONSTRUCTORS(AvailableProfile); }; -class ProfileManager { +class ProfileManager : public NonThreadSafe, + public base::SystemMonitor::PowerObserver { public: ProfileManager(); virtual ~ProfileManager(); @@ -122,6 +126,11 @@ class ProfileManager { // Creates a new window with the given profile. void NewWindowWithProfile(Profile* profile); + // PowerObserver notifications + void OnPowerStateChange(base::SystemMonitor*) {} + void OnSuspend(base::SystemMonitor*); + void OnResume(base::SystemMonitor*); + // ------------------ static utility functions ------------------- // Returns the path to the profile directory based on the user data directory. @@ -157,6 +166,11 @@ class ProfileManager { // or NULL if no match is found. AvailableProfile* GetAvailableProfileByID(const std::wstring& id); + // Hooks to suspend/resume per-profile network traffic. + // These must be called on the IO thread. + static void SuspendProfile(Profile*); + static void ResumeProfile(Profile*); + // We keep a simple vector of profiles rather than something fancier // because we expect there to be a small number of profiles active. ProfileVector profiles_; |