OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ |
6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ | 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Returns the number of background apps in the system (virtual to allow | 299 // Returns the number of background apps in the system (virtual to allow |
300 // overriding in unit tests). | 300 // overriding in unit tests). |
301 virtual int GetBackgroundAppCount() const; | 301 virtual int GetBackgroundAppCount() const; |
302 | 302 |
303 // Returns the number of background apps for a profile. | 303 // Returns the number of background apps for a profile. |
304 virtual int GetBackgroundAppCountForProfile(Profile* const profile) const; | 304 virtual int GetBackgroundAppCountForProfile(Profile* const profile) const; |
305 | 305 |
306 // Returns true if we should be in background mode. | 306 // Returns true if we should be in background mode. |
307 bool ShouldBeInBackgroundMode() const; | 307 bool ShouldBeInBackgroundMode() const; |
308 | 308 |
| 309 // Finds the BackgroundModeData associated with the last active profile, |
| 310 // if the profile isn't locked. Returns NULL otherwise. |
| 311 BackgroundModeManager::BackgroundModeData* |
| 312 GetBackgroundModeDataForLastProfile() const; |
| 313 |
309 // Reference to the profile info cache. It is used to update the background | 314 // Reference to the profile info cache. It is used to update the background |
310 // app status of profiles when they open/close background apps. | 315 // app status of profiles when they open/close background apps. |
311 ProfileInfoCache* profile_cache_; | 316 ProfileInfoCache* profile_cache_; |
312 | 317 |
313 // Registrars for managing our change observers. | 318 // Registrars for managing our change observers. |
314 content::NotificationRegistrar registrar_; | 319 content::NotificationRegistrar registrar_; |
315 PrefChangeRegistrar pref_registrar_; | 320 PrefChangeRegistrar pref_registrar_; |
316 | 321 |
317 // The profile-keyed data for this background mode manager. Keyed on profile. | 322 // The profile-keyed data for this background mode manager. Keyed on profile. |
318 BackgroundModeInfoMap background_mode_data_; | 323 BackgroundModeInfoMap background_mode_data_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 // Set to true when background mode is suspended. | 357 // Set to true when background mode is suspended. |
353 bool background_mode_suspended_; | 358 bool background_mode_suspended_; |
354 | 359 |
355 // Set to true when background mode is keeping Chrome alive. | 360 // Set to true when background mode is keeping Chrome alive. |
356 bool keeping_alive_; | 361 bool keeping_alive_; |
357 | 362 |
358 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); | 363 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); |
359 }; | 364 }; |
360 | 365 |
361 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ | 366 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ |
OLD | NEW |