| 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 "chrome/browser/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/plugin_service.h" | 49 #include "chrome/browser/plugin_service.h" |
| 50 #include "chrome/browser/pref_service.h" | 50 #include "chrome/browser/pref_service.h" |
| 51 #include "chrome/browser/pref_value_store.h" | 51 #include "chrome/browser/pref_value_store.h" |
| 52 #include "chrome/browser/process_singleton.h" | 52 #include "chrome/browser/process_singleton.h" |
| 53 #include "chrome/browser/profile.h" | 53 #include "chrome/browser/profile.h" |
| 54 #include "chrome/browser/profile_manager.h" | 54 #include "chrome/browser/profile_manager.h" |
| 55 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 55 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 56 #include "chrome/browser/search_engines/template_url_model.h" | 56 #include "chrome/browser/search_engines/template_url_model.h" |
| 57 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 57 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 58 #include "chrome/browser/shell_integration.h" | 58 #include "chrome/browser/shell_integration.h" |
| 59 #if !defined(OS_WIN) |
| 59 #include "chrome/browser/translate/translate_manager.h" | 60 #include "chrome/browser/translate/translate_manager.h" |
| 61 #else |
| 62 #include "chrome/browser/translate/translate_manager2.h" |
| 63 #endif |
| 60 #include "chrome/browser/user_data_manager.h" | 64 #include "chrome/browser/user_data_manager.h" |
| 61 #include "chrome/common/chrome_constants.h" | 65 #include "chrome/common/chrome_constants.h" |
| 62 #include "chrome/common/chrome_paths.h" | 66 #include "chrome/common/chrome_paths.h" |
| 63 #include "chrome/common/chrome_switches.h" | 67 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/json_pref_store.h" | 68 #include "chrome/common/json_pref_store.h" |
| 65 #include "chrome/common/jstemplate_builder.h" | 69 #include "chrome/common/jstemplate_builder.h" |
| 66 #include "chrome/common/main_function_params.h" | 70 #include "chrome/common/main_function_params.h" |
| 67 #include "chrome/common/net/net_resource_provider.h" | 71 #include "chrome/common/net/net_resource_provider.h" |
| 68 #include "chrome/common/pref_names.h" | 72 #include "chrome/common/pref_names.h" |
| 69 #include "chrome/common/result_codes.h" | 73 #include "chrome/common/result_codes.h" |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 // machine. If yes and the current Chrome process is user level, we do not | 1129 // machine. If yes and the current Chrome process is user level, we do not |
| 1126 // allow the user level Chrome to run. So we notify the user and uninstall | 1130 // allow the user level Chrome to run. So we notify the user and uninstall |
| 1127 // user level Chrome. | 1131 // user level Chrome. |
| 1128 // Note this check should only happen here, after all the checks above | 1132 // Note this check should only happen here, after all the checks above |
| 1129 // (uninstall, resource bundle initialization, other chrome browser | 1133 // (uninstall, resource bundle initialization, other chrome browser |
| 1130 // processes etc). | 1134 // processes etc). |
| 1131 if (CheckMachineLevelInstall()) | 1135 if (CheckMachineLevelInstall()) |
| 1132 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; | 1136 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; |
| 1133 | 1137 |
| 1134 // Create the TranslateManager singleton. | 1138 // Create the TranslateManager singleton. |
| 1139 #if defined(OS_WIN) |
| 1140 Singleton<TranslateManager2>::get(); |
| 1141 #else |
| 1135 Singleton<TranslateManager>::get(); | 1142 Singleton<TranslateManager>::get(); |
| 1143 #endif |
| 1136 | 1144 |
| 1137 #if defined(OS_MACOSX) | 1145 #if defined(OS_MACOSX) |
| 1138 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { | 1146 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { |
| 1139 // Disk image installation is sort of a first-run task, so it shares the | 1147 // Disk image installation is sort of a first-run task, so it shares the |
| 1140 // kNoFirstRun switch. | 1148 // kNoFirstRun switch. |
| 1141 if (MaybeInstallFromDiskImage()) { | 1149 if (MaybeInstallFromDiskImage()) { |
| 1142 // The application was installed and the installed copy has been | 1150 // The application was installed and the installed copy has been |
| 1143 // launched. This process is now obsolete. Exit. | 1151 // launched. This process is now obsolete. Exit. |
| 1144 return ResultCodes::NORMAL_EXIT; | 1152 return ResultCodes::NORMAL_EXIT; |
| 1145 } | 1153 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 | 1361 |
| 1354 metrics->Stop(); | 1362 metrics->Stop(); |
| 1355 | 1363 |
| 1356 // browser_shutdown takes care of deleting browser_process, so we need to | 1364 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1357 // release it. | 1365 // release it. |
| 1358 ignore_result(browser_process.release()); | 1366 ignore_result(browser_process.release()); |
| 1359 browser_shutdown::Shutdown(); | 1367 browser_shutdown::Shutdown(); |
| 1360 | 1368 |
| 1361 return result_code; | 1369 return result_code; |
| 1362 } | 1370 } |
| OLD | NEW |