Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2010 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 #include "chrome/app/chrome_command_ids.h" | |
| 6 #include "chrome/browser/background_mode_manager.h" | |
| 7 #include "grit/generated_resources.h" | |
| 8 | |
| 9 #include "base/mac_util.h" | |
| 10 | |
| 11 void BackgroundModeManager::DisableLaunchOnStartupTask::Run() { | |
| 12 // If we didn't set Login Item, don't mess with it. | |
| 13 if (!manager_->IsLaunchOnStartupResetAllowed()) | |
|
Andrew T Wilson (Slow)
2010/12/03 02:06:59
See my previous notes - I don't think we can make
The wrong rickcam account
2010/12/04 02:08:04
Done. I've switched to use the family of routines
| |
| 14 return; | |
| 15 manager_->SetLaunchOnStartupResetAllowed(false); | |
| 16 | |
| 17 // Check if Chrome is not a login Item, or is a Login Item but w/o 'hidden' | |
| 18 // flag - most likely user has modified the setting, don't override it. | |
| 19 bool is_hidden = false; | |
| 20 if (!mac_util::CheckLoginItemStatus(&is_hidden) || !is_hidden) | |
| 21 return; | |
| 22 | |
| 23 mac_util::RemoveFromLoginItems(); | |
| 24 } | |
| 25 | |
| 26 void BackgroundModeManager::EnableLaunchOnStartupTask::Run() { | |
| 27 // Return if Chrome is already a Login Item (avoid overriding user choice). | |
| 28 if (mac_util::CheckLoginItemStatus(NULL)) | |
| 29 return; | |
| 30 | |
| 31 mac_util::AddToLoginItems(true); // Hide on startup. | |
| 32 | |
| 33 // Remember we set Login Item, not the user - so we can reset it later. | |
| 34 manager_->SetLaunchOnStartupResetAllowed(true); | |
| 35 } | |
| 36 | |
| 37 void BackgroundModeManager::AddPreferencesItem(menus::SimpleMenuModel* menu) { | |
| 38 menu->AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS); | |
| 39 } | |
| OLD | NEW |