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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1267 parsed_command_line.HasSwitch(switches::kShowIcons)) | 1267 parsed_command_line.HasSwitch(switches::kShowIcons)) |
1268 return HandleIconsCommands(parsed_command_line); | 1268 return HandleIconsCommands(parsed_command_line); |
1269 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { | 1269 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { |
1270 return ShellIntegration::SetAsDefaultBrowser() ? | 1270 return ShellIntegration::SetAsDefaultBrowser() ? |
1271 ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; | 1271 ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; |
1272 } | 1272 } |
1273 | 1273 |
1274 // If the command line specifies --pack-extension, attempt the pack extension | 1274 // If the command line specifies --pack-extension, attempt the pack extension |
1275 // startup action and exit. | 1275 // startup action and exit. |
1276 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { | 1276 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { |
1277 extensions_startup::HandlePackExtension(parsed_command_line); | 1277 ExtensionsStartupUtil extension_startup_util; |
1278 extension_startup_util.PackExtension(parsed_command_line); | |
1278 return ResultCodes::NORMAL_EXIT; | 1279 return ResultCodes::NORMAL_EXIT; |
Mark Mentovai
2010/12/13 20:44:46
Check PackExtension’s return value and return some
| |
1279 } | 1280 } |
1280 | 1281 |
1281 #if !defined(OS_MACOSX) | 1282 #if !defined(OS_MACOSX) |
1282 // In environments other than Mac OS X we support import of settings | 1283 // In environments other than Mac OS X we support import of settings |
1283 // from other browsers. In case this process is a short-lived "import" | 1284 // from other browsers. In case this process is a short-lived "import" |
1284 // process that another browser runs just to import the settings, we | 1285 // process that another browser runs just to import the settings, we |
1285 // don't want to be checking for another browser process, by design. | 1286 // don't want to be checking for another browser process, by design. |
1286 if (!(parsed_command_line.HasSwitch(switches::kImport) || | 1287 if (!(parsed_command_line.HasSwitch(switches::kImport) || |
1287 parsed_command_line.HasSwitch(switches::kImportFromFile))) { | 1288 parsed_command_line.HasSwitch(switches::kImportFromFile))) { |
1288 #endif | 1289 #endif |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1563 if (profile->GetExtensionsService()) { | 1564 if (profile->GetExtensionsService()) { |
1564 // This will initialize bookmarks. Call it after bookmark import is done. | 1565 // This will initialize bookmarks. Call it after bookmark import is done. |
1565 // See issue 40144. | 1566 // See issue 40144. |
1566 profile->GetExtensionsService()->InitEventRouters(); | 1567 profile->GetExtensionsService()->InitEventRouters(); |
1567 } | 1568 } |
1568 | 1569 |
1569 // The extension service may be available at this point. If the command line | 1570 // The extension service may be available at this point. If the command line |
1570 // specifies --uninstall-extension, attempt the uninstall extension startup | 1571 // specifies --uninstall-extension, attempt the uninstall extension startup |
1571 // action. | 1572 // action. |
1572 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { | 1573 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { |
1573 if (extensions_startup::HandleUninstallExtension(parsed_command_line, | 1574 ExtensionsStartupUtil ext_startup_util; |
1574 profile)) { | 1575 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { |
1575 return ResultCodes::NORMAL_EXIT; | 1576 return ResultCodes::NORMAL_EXIT; |
1576 } else { | 1577 } else { |
1577 return ResultCodes::UNINSTALL_EXTENSION_ERROR; | 1578 return ResultCodes::UNINSTALL_EXTENSION_ERROR; |
1578 } | 1579 } |
1579 } | 1580 } |
1580 | 1581 |
1581 #if defined(OS_WIN) | 1582 #if defined(OS_WIN) |
1582 // We check this here because if the profile is OTR (chromeos possibility) | 1583 // We check this here because if the profile is OTR (chromeos possibility) |
1583 // it won't still be accessible after browser is destroyed. | 1584 // it won't still be accessible after browser is destroyed. |
1584 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); | 1585 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1716 #if defined(OS_CHROMEOS) | 1717 #if defined(OS_CHROMEOS) |
1717 // To be precise, logout (browser shutdown) is not yet done, but the | 1718 // To be precise, logout (browser shutdown) is not yet done, but the |
1718 // remaining work is negligible, hence we say LogoutDone here. | 1719 // remaining work is negligible, hence we say LogoutDone here. |
1719 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1720 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1720 false); | 1721 false); |
1721 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1722 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1722 #endif | 1723 #endif |
1723 TRACE_EVENT_END("BrowserMain", 0, 0); | 1724 TRACE_EVENT_END("BrowserMain", 0, 0); |
1724 return result_code; | 1725 return result_code; |
1725 } | 1726 } |
OLD | NEW |