| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 | 213 |
| 214 // We're going away, so exit background mode (does nothing if we aren't in | 214 // We're going away, so exit background mode (does nothing if we aren't in |
| 215 // background mode currently). This is primarily needed for unit tests, | 215 // background mode currently). This is primarily needed for unit tests, |
| 216 // because in an actual running system we'd get an APP_TERMINATING | 216 // because in an actual running system we'd get an APP_TERMINATING |
| 217 // notification before being destroyed. | 217 // notification before being destroyed. |
| 218 EndBackgroundMode(); | 218 EndBackgroundMode(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 void BackgroundModeManager::RegisterPrefs(PrefService* prefs) { | 222 void BackgroundModeManager::RegisterPrefs(PrefServiceSimple* prefs) { |
| 223 prefs->RegisterBooleanPref(prefs::kUserCreatedLoginItem, false); | 223 prefs->RegisterBooleanPref(prefs::kUserCreatedLoginItem, false); |
| 224 prefs->RegisterBooleanPref(prefs::kUserRemovedLoginItem, false); | 224 prefs->RegisterBooleanPref(prefs::kUserRemovedLoginItem, false); |
| 225 prefs->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true); | 225 prefs->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true); |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 void BackgroundModeManager::RegisterProfile(Profile* profile) { | 229 void BackgroundModeManager::RegisterProfile(Profile* profile) { |
| 230 // We don't want to register multiple times for one profile. | 230 // We don't want to register multiple times for one profile. |
| 231 DCHECK(background_mode_data_.find(profile) == background_mode_data_.end()); | 231 DCHECK(background_mode_data_.find(profile) == background_mode_data_.end()); |
| 232 BackgroundModeInfo bmd(new BackgroundModeData(current_command_id_++, | 232 BackgroundModeInfo bmd(new BackgroundModeData(current_command_id_++, |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 } | 775 } |
| 776 } | 776 } |
| 777 return profile_it; | 777 return profile_it; |
| 778 } | 778 } |
| 779 | 779 |
| 780 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 780 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
| 781 PrefService* service = g_browser_process->local_state(); | 781 PrefService* service = g_browser_process->local_state(); |
| 782 DCHECK(service); | 782 DCHECK(service); |
| 783 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 783 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
| 784 } | 784 } |
| OLD | NEW |