Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: chrome/browser/background/background_mode_manager.cc

Issue 10823221: Do not create login items if the user deleted a previous one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // We're going away, so exit background mode (does nothing if we aren't in 209 // We're going away, so exit background mode (does nothing if we aren't in
210 // background mode currently). This is primarily needed for unit tests, 210 // background mode currently). This is primarily needed for unit tests,
211 // because in an actual running system we'd get an APP_TERMINATING 211 // because in an actual running system we'd get an APP_TERMINATING
212 // notification before being destroyed. 212 // notification before being destroyed.
213 EndBackgroundMode(); 213 EndBackgroundMode();
214 } 214 }
215 215
216 // static 216 // static
217 void BackgroundModeManager::RegisterPrefs(PrefService* prefs) { 217 void BackgroundModeManager::RegisterPrefs(PrefService* prefs) {
218 prefs->RegisterBooleanPref(prefs::kUserCreatedLoginItem, false); 218 prefs->RegisterBooleanPref(prefs::kUserCreatedLoginItem, false);
219 prefs->RegisterBooleanPref(prefs::kUserRemovedLoginItem, false);
219 prefs->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true); 220 prefs->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
220 } 221 }
221 222
222 223
223 void BackgroundModeManager::RegisterProfile(Profile* profile) { 224 void BackgroundModeManager::RegisterProfile(Profile* profile) {
224 // We don't want to register multiple times for one profile. 225 // We don't want to register multiple times for one profile.
225 DCHECK(background_mode_data_.find(profile) == background_mode_data_.end()); 226 DCHECK(background_mode_data_.find(profile) == background_mode_data_.end());
226 BackgroundModeInfo bmd(new BackgroundModeData(current_command_id_++, 227 BackgroundModeInfo bmd(new BackgroundModeData(current_command_id_++,
227 profile)); 228 profile));
228 background_mode_data_[profile] = bmd; 229 background_mode_data_[profile] = bmd;
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 768 }
768 } 769 }
769 return profile_it; 770 return profile_it;
770 } 771 }
771 772
772 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 773 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
773 PrefService* service = g_browser_process->local_state(); 774 PrefService* service = g_browser_process->local_state();
774 DCHECK(service); 775 DCHECK(service);
775 return service->GetBoolean(prefs::kBackgroundModeEnabled); 776 return service->GetBoolean(prefs::kBackgroundModeEnabled);
776 } 777 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698