Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 <unistd.h> | 5 #include <unistd.h> |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 result = result.Append(kAutostart); | 45 result = result.Append(kAutostart); |
| 46 return result; | 46 return result; |
| 47 } | 47 } |
| 48 | 48 |
| 49 FilePath GetAutostartFilename(base::Environment* environment) { | 49 FilePath GetAutostartFilename(base::Environment* environment) { |
| 50 FilePath directory = GetAutostartDirectory(environment); | 50 FilePath directory = GetAutostartDirectory(environment); |
| 51 return directory.Append(ShellIntegration::GetDesktopName(environment)); | 51 return directory.Append(ShellIntegration::GetDesktopName(environment)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
|
The wrong rickcam account
2010/12/09 17:34:27
I would recommend this as the point to us #ifndef
| |
| 56 void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { | 56 void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { |
| 57 // This functionality is only defined for default profile, currently. | 57 // This functionality is only defined for default profile, currently. |
| 58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) | 58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) |
| 59 return; | 59 return; |
| 60 if (should_launch) { | 60 if (should_launch) { |
| 61 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 61 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 62 new EnableLaunchOnStartupTask()); | 62 new EnableLaunchOnStartupTask()); |
| 63 } else { | 63 } else { |
| 64 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 64 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 65 new DisableLaunchOnStartupTask()); | 65 new DisableLaunchOnStartupTask()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 std::string::size_type content_length = autostart_file_contents.length(); | 101 std::string::size_type content_length = autostart_file_contents.length(); |
| 102 if (file_util::WriteFile(autostart_file, autostart_file_contents.c_str(), | 102 if (file_util::WriteFile(autostart_file, autostart_file_contents.c_str(), |
| 103 content_length) != | 103 content_length) != |
| 104 static_cast<int>(content_length)) { | 104 static_cast<int>(content_length)) { |
| 105 NOTREACHED() << "Failed to register launch on login. Failed to write " | 105 NOTREACHED() << "Failed to register launch on login. Failed to write " |
| 106 << autostart_file.value(); | 106 << autostart_file.value(); |
| 107 file_util::Delete(GetAutostartFilename(environment.get()), false); | 107 file_util::Delete(GetAutostartFilename(environment.get()), false); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 #if !defined(OS_CHROMEOS) | |
| 111 string16 BackgroundModeManager::GetPreferencesMenuLabel() { | 112 string16 BackgroundModeManager::GetPreferencesMenuLabel() { |
| 112 string16 result = gtk_util::GetStockPreferencesMenuLabel(); | 113 string16 result = gtk_util::GetStockPreferencesMenuLabel(); |
| 113 if (!result.empty()) | 114 if (!result.empty()) |
| 114 return result; | 115 return result; |
| 115 return l10n_util::GetStringUTF16(IDS_PREFERENCES); | 116 return l10n_util::GetStringUTF16(IDS_PREFERENCES); |
| 116 } | 117 } |
| 118 #endif // OS_CHROMEOS | |
| OLD | NEW |