| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/background/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace | 82 } // namespace |
| 83 | 83 |
| 84 void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { | 84 void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { |
| 85 // LoginItems are associated with an executable, not with a specific | 85 // LoginItems are associated with an executable, not with a specific |
| 86 // user-data-dir, so only mess with the LoginItem when running with the | 86 // user-data-dir, so only mess with the LoginItem when running with the |
| 87 // default user-data-dir. So if a user is running multiple instances of | 87 // default user-data-dir. So if a user is running multiple instances of |
| 88 // Chrome with different user-data-dirs, they won't conflict in their | 88 // Chrome with different user-data-dirs, they won't conflict in their |
| 89 // use of LoginItems. | 89 // use of LoginItems. |
| 90 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) | 90 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) |
| 91 return; | 91 return; |
| 92 | 92 |
| 93 // There are a few cases we need to handle: | 93 // There are a few cases we need to handle: |
| 94 // | 94 // |
| 95 // 1) Chrome is transitioning to "launch on startup" state, and there's no | 95 // 1) Chrome is transitioning to "launch on startup" state, and there's no |
| 96 // login item currently. We create a new item if the kUserRemovedLoginItem | 96 // login item currently. We create a new item if the kUserRemovedLoginItem |
| 97 // and kChromeCreatedLoginItem flags are already false, and set the | 97 // and kChromeCreatedLoginItem flags are already false, and set the |
| 98 // kChromeCreatedLoginItem flag to true. If kChromeCreatedLoginItem is | 98 // kChromeCreatedLoginItem flag to true. If kChromeCreatedLoginItem is |
| 99 // already set (meaning that we created a login item that has since been | 99 // already set (meaning that we created a login item that has since been |
| 100 // deleted) then we will set the kUserRemovedLoginItem so we do not create | 100 // deleted) then we will set the kUserRemovedLoginItem so we do not create |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 void BackgroundModeManager::DisplayAppInstalledNotification( | 152 void BackgroundModeManager::DisplayAppInstalledNotification( |
| 153 const extensions::Extension* extension) { | 153 const extensions::Extension* extension) { |
| 154 // TODO(atwilson): Display a platform-appropriate notification here. | 154 // TODO(atwilson): Display a platform-appropriate notification here. |
| 155 // http://crbug.com/74970 | 155 // http://crbug.com/74970 |
| 156 } | 156 } |
| 157 | 157 |
| 158 base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { | 158 base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { |
| 159 return l10n_util::GetStringUTF16(IDS_OPTIONS); | 159 return l10n_util::GetStringUTF16(IDS_OPTIONS); |
| 160 } | 160 } |
| OLD | NEW |