Chromium Code Reviews| Index: chrome/browser/browser_main.cc |
| diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc |
| index e5711ccd96482516edeb4cd185e791e35f05c7c6..95a2226c62e1acfed6bff5c26683428a68e8ded7 100644 |
| --- a/chrome/browser/browser_main.cc |
| +++ b/chrome/browser/browser_main.cc |
| @@ -78,6 +78,7 @@ |
| #include "chrome/browser/web_resource/gpu_blacklist_updater.h" |
| #include "chrome/common/chrome_constants.h" |
| #include "chrome/common/chrome_paths.h" |
| +#include "chrome/common/chrome_result_codes.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/chrome_version_info.h" |
| #include "chrome/common/env_vars.h" |
| @@ -94,7 +95,6 @@ |
| #include "content/common/content_client.h" |
| #include "content/common/hi_res_timer_manager.h" |
| #include "content/common/main_function_params.h" |
| -#include "content/common/result_codes.h" |
| #include "grit/app_locale_settings.h" |
| #include "grit/chromium_strings.h" |
| #include "grit/generated_resources.h" |
| @@ -1428,12 +1428,12 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| TryChromeDialogView::Result answer = |
| TryChromeDialogView::Show(try_chrome_int, &process_singleton); |
| if (answer == TryChromeDialogView::NOT_NOW) |
| - return ResultCodes::NORMAL_EXIT_CANCEL; |
| + return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; |
| if (answer == TryChromeDialogView::UNINSTALL_CHROME) |
| - return ResultCodes::NORMAL_EXIT_EXP2; |
| + return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; |
| #else |
| // We don't support retention experiments on Mac or Linux. |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| #endif // defined(OS_WIN) |
| } |
| @@ -1555,7 +1555,8 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| return HandleIconsCommands(parsed_command_line); |
| if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { |
| return ShellIntegration::SetAsDefaultBrowser() ? |
| - ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; |
| + static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : |
|
jam
2011/07/15 19:42:43
I don't think the casts are needed?
Dirk Pranke
2011/07/15 20:02:23
content::ResultCode and chrome::ResultCode are two
|
| + static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); |
| } |
| // If the command line specifies --pack-extension, attempt the pack extension |
| @@ -1563,9 +1564,9 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| if (parsed_command_line.HasSwitch(switches::kPackExtension)) { |
| ExtensionsStartupUtil extension_startup_util; |
| if (extension_startup_util.PackExtension(parsed_command_line)) { |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| } else { |
| - return ResultCodes::PACK_EXTENSION_ERROR; |
| + return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; |
| } |
| } |
| @@ -1591,10 +1592,10 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( |
| l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); |
| #endif |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| case ProcessSingleton::PROFILE_IN_USE: |
| - return ResultCodes::PROFILE_IN_USE; |
| + return chrome::RESULT_CODE_PROFILE_IN_USE; |
| case ProcessSingleton::LOCK_ERROR: |
| LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " |
| @@ -1602,7 +1603,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| "would start multiple browser processes rather than " |
| "opening a new window in the existing process. Aborting " |
| "now to avoid profile corruption."; |
| - return ResultCodes::PROFILE_IN_USE; |
| + return chrome::RESULT_CODE_PROFILE_IN_USE; |
| default: |
| NOTREACHED(); |
| @@ -1650,7 +1651,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| Profile* profile = CreateProfile(parameters, user_data_dir); |
| if (!profile) |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| // Post-profile init --------------------------------------------------------- |
| @@ -1692,7 +1693,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| #if defined(OS_WIN) |
| // Do the tasks if chrome has been upgraded while it was last running. |
| if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| #endif |
| // Check if there is any machine level Chrome installed on the current |
| @@ -1705,7 +1706,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| // Do not allow this to occur for Chrome Frame user-to-system handoffs. |
| if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && |
| CheckMachineLevelInstall()) |
| - return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; |
| + return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; |
| // Create the TranslateManager singleton. |
| TranslateManager* translate_manager = TranslateManager::GetInstance(); |
| @@ -1718,7 +1719,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| if (MaybeInstallFromDiskImage()) { |
| // The application was installed and the installed copy has been |
| // launched. This process is now obsolete. Exit. |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| } |
| } |
| #endif |
| @@ -1910,9 +1911,9 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { |
| ExtensionsStartupUtil ext_startup_util; |
| if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { |
| - return ResultCodes::NORMAL_EXIT; |
| + return content::RESULT_CODE_NORMAL_EXIT; |
| } else { |
| - return ResultCodes::UNINSTALL_EXTENSION_ERROR; |
| + return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; |
| } |
| } |
| @@ -1957,7 +1958,7 @@ int BrowserMain(const MainFunctionParams& parameters) { |
| // Start watching all browser threads for responsiveness. |
| ThreadWatcherList::StartWatchingAll(parsed_command_line); |
| - int result_code = ResultCodes::NORMAL_EXIT; |
| + int result_code = content::RESULT_CODE_NORMAL_EXIT; |
| if (parameters.ui_task) { |
| // We are in test mode. Run one task and enter the main message loop. |
| if (pool) |