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 "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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 #include "chrome/browser/search_engines/template_url_service_factory.h" | 71 #include "chrome/browser/search_engines/template_url_service_factory.h" |
72 #include "chrome/browser/service/service_process_control.h" | 72 #include "chrome/browser/service/service_process_control.h" |
73 #include "chrome/browser/shell_integration.h" | 73 #include "chrome/browser/shell_integration.h" |
74 #include "chrome/browser/translate/translate_manager.h" | 74 #include "chrome/browser/translate/translate_manager.h" |
75 #include "chrome/browser/ui/browser.h" | 75 #include "chrome/browser/ui/browser.h" |
76 #include "chrome/browser/ui/browser_init.h" | 76 #include "chrome/browser/ui/browser_init.h" |
77 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 77 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
78 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" | 78 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" |
79 #include "chrome/common/chrome_constants.h" | 79 #include "chrome/common/chrome_constants.h" |
80 #include "chrome/common/chrome_paths.h" | 80 #include "chrome/common/chrome_paths.h" |
81 #include "chrome/common/chrome_result_codes.h" | |
81 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
82 #include "chrome/common/chrome_version_info.h" | 83 #include "chrome/common/chrome_version_info.h" |
83 #include "chrome/common/env_vars.h" | 84 #include "chrome/common/env_vars.h" |
84 #include "chrome/common/json_pref_store.h" | 85 #include "chrome/common/json_pref_store.h" |
85 #include "chrome/common/jstemplate_builder.h" | 86 #include "chrome/common/jstemplate_builder.h" |
86 #include "chrome/common/logging_chrome.h" | 87 #include "chrome/common/logging_chrome.h" |
87 #include "chrome/common/net/net_resource_provider.h" | 88 #include "chrome/common/net/net_resource_provider.h" |
88 #include "chrome/common/pref_names.h" | 89 #include "chrome/common/pref_names.h" |
89 #include "chrome/common/profiling.h" | 90 #include "chrome/common/profiling.h" |
90 #include "chrome/installer/util/google_update_settings.h" | 91 #include "chrome/installer/util/google_update_settings.h" |
91 #include "content/browser/browser_thread.h" | 92 #include "content/browser/browser_thread.h" |
92 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 93 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
93 #include "content/common/child_process.h" | 94 #include "content/common/child_process.h" |
94 #include "content/common/content_client.h" | 95 #include "content/common/content_client.h" |
95 #include "content/common/hi_res_timer_manager.h" | 96 #include "content/common/hi_res_timer_manager.h" |
96 #include "content/common/main_function_params.h" | 97 #include "content/common/main_function_params.h" |
97 #include "content/common/result_codes.h" | |
98 #include "grit/app_locale_settings.h" | 98 #include "grit/app_locale_settings.h" |
99 #include "grit/chromium_strings.h" | 99 #include "grit/chromium_strings.h" |
100 #include "grit/generated_resources.h" | 100 #include "grit/generated_resources.h" |
101 #include "grit/platform_locale_settings.h" | 101 #include "grit/platform_locale_settings.h" |
102 #include "net/base/cookie_monster.h" | 102 #include "net/base/cookie_monster.h" |
103 #include "net/base/net_module.h" | 103 #include "net/base/net_module.h" |
104 #include "net/base/network_change_notifier.h" | 104 #include "net/base/network_change_notifier.h" |
105 #include "net/http/http_basic_stream.h" | 105 #include "net/http/http_basic_stream.h" |
106 #include "net/http/http_network_layer.h" | 106 #include "net/http/http_network_layer.h" |
107 #include "net/http/http_stream_factory.h" | 107 #include "net/http/http_stream_factory.h" |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1421 // It seems that we don't need to run the experiment since chrome | 1421 // It seems that we don't need to run the experiment since chrome |
1422 // in the same profile is already running. | 1422 // in the same profile is already running. |
1423 VLOG(1) << "Retention experiment not required"; | 1423 VLOG(1) << "Retention experiment not required"; |
1424 return TryChromeDialogView::NOT_NOW; | 1424 return TryChromeDialogView::NOT_NOW; |
1425 } | 1425 } |
1426 int try_chrome_int; | 1426 int try_chrome_int; |
1427 base::StringToInt(try_chrome, &try_chrome_int); | 1427 base::StringToInt(try_chrome, &try_chrome_int); |
1428 TryChromeDialogView::Result answer = | 1428 TryChromeDialogView::Result answer = |
1429 TryChromeDialogView::Show(try_chrome_int, &process_singleton); | 1429 TryChromeDialogView::Show(try_chrome_int, &process_singleton); |
1430 if (answer == TryChromeDialogView::NOT_NOW) | 1430 if (answer == TryChromeDialogView::NOT_NOW) |
1431 return ResultCodes::NORMAL_EXIT_CANCEL; | 1431 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; |
1432 if (answer == TryChromeDialogView::UNINSTALL_CHROME) | 1432 if (answer == TryChromeDialogView::UNINSTALL_CHROME) |
1433 return ResultCodes::NORMAL_EXIT_EXP2; | 1433 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; |
1434 #else | 1434 #else |
1435 // We don't support retention experiments on Mac or Linux. | 1435 // We don't support retention experiments on Mac or Linux. |
1436 return ResultCodes::NORMAL_EXIT; | 1436 return content::RESULT_CODE_NORMAL_EXIT; |
1437 #endif // defined(OS_WIN) | 1437 #endif // defined(OS_WIN) |
1438 } | 1438 } |
1439 | 1439 |
1440 #if defined(OS_CHROMEOS) | 1440 #if defined(OS_CHROMEOS) |
1441 // This needs to be called after the locale has been set. | 1441 // This needs to be called after the locale has been set. |
1442 RegisterTranslateableItems(); | 1442 RegisterTranslateableItems(); |
1443 #endif | 1443 #endif |
1444 | 1444 |
1445 #if defined(TOOLKIT_VIEWS) | 1445 #if defined(TOOLKIT_VIEWS) |
1446 views::Widget::SetPureViews( | 1446 views::Widget::SetPureViews( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1548 // unless we detect another chrome browser running. | 1548 // unless we detect another chrome browser running. |
1549 if (parsed_command_line.HasSwitch(switches::kUninstall)) | 1549 if (parsed_command_line.HasSwitch(switches::kUninstall)) |
1550 return DoUninstallTasks(already_running); | 1550 return DoUninstallTasks(already_running); |
1551 #endif | 1551 #endif |
1552 | 1552 |
1553 if (parsed_command_line.HasSwitch(switches::kHideIcons) || | 1553 if (parsed_command_line.HasSwitch(switches::kHideIcons) || |
1554 parsed_command_line.HasSwitch(switches::kShowIcons)) | 1554 parsed_command_line.HasSwitch(switches::kShowIcons)) |
1555 return HandleIconsCommands(parsed_command_line); | 1555 return HandleIconsCommands(parsed_command_line); |
1556 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { | 1556 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { |
1557 return ShellIntegration::SetAsDefaultBrowser() ? | 1557 return ShellIntegration::SetAsDefaultBrowser() ? |
1558 ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; | 1558 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
| |
1559 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); | |
1559 } | 1560 } |
1560 | 1561 |
1561 // If the command line specifies --pack-extension, attempt the pack extension | 1562 // If the command line specifies --pack-extension, attempt the pack extension |
1562 // startup action and exit. | 1563 // startup action and exit. |
1563 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { | 1564 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { |
1564 ExtensionsStartupUtil extension_startup_util; | 1565 ExtensionsStartupUtil extension_startup_util; |
1565 if (extension_startup_util.PackExtension(parsed_command_line)) { | 1566 if (extension_startup_util.PackExtension(parsed_command_line)) { |
1566 return ResultCodes::NORMAL_EXIT; | 1567 return content::RESULT_CODE_NORMAL_EXIT; |
1567 } else { | 1568 } else { |
1568 return ResultCodes::PACK_EXTENSION_ERROR; | 1569 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; |
1569 } | 1570 } |
1570 } | 1571 } |
1571 | 1572 |
1572 #if !defined(OS_MACOSX) | 1573 #if !defined(OS_MACOSX) |
1573 // In environments other than Mac OS X we support import of settings | 1574 // In environments other than Mac OS X we support import of settings |
1574 // from other browsers. In case this process is a short-lived "import" | 1575 // from other browsers. In case this process is a short-lived "import" |
1575 // process that another browser runs just to import the settings, we | 1576 // process that another browser runs just to import the settings, we |
1576 // don't want to be checking for another browser process, by design. | 1577 // don't want to be checking for another browser process, by design. |
1577 if (!(parsed_command_line.HasSwitch(switches::kImport) || | 1578 if (!(parsed_command_line.HasSwitch(switches::kImport) || |
1578 parsed_command_line.HasSwitch(switches::kImportFromFile))) { | 1579 parsed_command_line.HasSwitch(switches::kImportFromFile))) { |
1579 #endif | 1580 #endif |
1580 // When another process is running, use that process instead of starting a | 1581 // When another process is running, use that process instead of starting a |
1581 // new one. NotifyOtherProcess will currently give the other process up to | 1582 // new one. NotifyOtherProcess will currently give the other process up to |
1582 // 20 seconds to respond. Note that this needs to be done before we attempt | 1583 // 20 seconds to respond. Note that this needs to be done before we attempt |
1583 // to read the profile. | 1584 // to read the profile. |
1584 switch (process_singleton.NotifyOtherProcessOrCreate()) { | 1585 switch (process_singleton.NotifyOtherProcessOrCreate()) { |
1585 case ProcessSingleton::PROCESS_NONE: | 1586 case ProcessSingleton::PROCESS_NONE: |
1586 // No process already running, fall through to starting a new one. | 1587 // No process already running, fall through to starting a new one. |
1587 break; | 1588 break; |
1588 | 1589 |
1589 case ProcessSingleton::PROCESS_NOTIFIED: | 1590 case ProcessSingleton::PROCESS_NOTIFIED: |
1590 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1591 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1591 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( | 1592 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( |
1592 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); | 1593 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); |
1593 #endif | 1594 #endif |
1594 return ResultCodes::NORMAL_EXIT; | 1595 return content::RESULT_CODE_NORMAL_EXIT; |
1595 | 1596 |
1596 case ProcessSingleton::PROFILE_IN_USE: | 1597 case ProcessSingleton::PROFILE_IN_USE: |
1597 return ResultCodes::PROFILE_IN_USE; | 1598 return chrome::RESULT_CODE_PROFILE_IN_USE; |
1598 | 1599 |
1599 case ProcessSingleton::LOCK_ERROR: | 1600 case ProcessSingleton::LOCK_ERROR: |
1600 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " | 1601 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " |
1601 "directory. This means that running multiple instances " | 1602 "directory. This means that running multiple instances " |
1602 "would start multiple browser processes rather than " | 1603 "would start multiple browser processes rather than " |
1603 "opening a new window in the existing process. Aborting " | 1604 "opening a new window in the existing process. Aborting " |
1604 "now to avoid profile corruption."; | 1605 "now to avoid profile corruption."; |
1605 return ResultCodes::PROFILE_IN_USE; | 1606 return chrome::RESULT_CODE_PROFILE_IN_USE; |
1606 | 1607 |
1607 default: | 1608 default: |
1608 NOTREACHED(); | 1609 NOTREACHED(); |
1609 } | 1610 } |
1610 #if !defined(OS_MACOSX) // closing brace for if | 1611 #if !defined(OS_MACOSX) // closing brace for if |
1611 } | 1612 } |
1612 #endif | 1613 #endif |
1613 | 1614 |
1614 #if defined(USE_X11) | 1615 #if defined(USE_X11) |
1615 SetBrowserX11ErrorHandlers(); | 1616 SetBrowserX11ErrorHandlers(); |
(...skipping 27 matching lines...) Expand all Loading... | |
1643 VLOG(1) << "Relaunching browser for user: " << username; | 1644 VLOG(1) << "Relaunching browser for user: " << username; |
1644 chromeos::UserManager::Get()->UserLoggedIn(username); | 1645 chromeos::UserManager::Get()->UserLoggedIn(username); |
1645 | 1646 |
1646 // Redirects Chrome logging to the user data dir. | 1647 // Redirects Chrome logging to the user data dir. |
1647 logging::RedirectChromeLogging(parsed_command_line); | 1648 logging::RedirectChromeLogging(parsed_command_line); |
1648 } | 1649 } |
1649 #endif | 1650 #endif |
1650 | 1651 |
1651 Profile* profile = CreateProfile(parameters, user_data_dir); | 1652 Profile* profile = CreateProfile(parameters, user_data_dir); |
1652 if (!profile) | 1653 if (!profile) |
1653 return ResultCodes::NORMAL_EXIT; | 1654 return content::RESULT_CODE_NORMAL_EXIT; |
1654 | 1655 |
1655 // Post-profile init --------------------------------------------------------- | 1656 // Post-profile init --------------------------------------------------------- |
1656 | 1657 |
1657 #if defined(OS_CHROMEOS) | 1658 #if defined(OS_CHROMEOS) |
1658 // Handling the user cloud policy initialization for case 2 mentioned above. | 1659 // Handling the user cloud policy initialization for case 2 mentioned above. |
1659 // We do this after the profile creation since we need the TokenService. | 1660 // We do this after the profile creation since we need the TokenService. |
1660 if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 1661 if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
1661 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 1662 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
1662 std::string username = | 1663 std::string username = |
1663 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser); | 1664 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser); |
(...skipping 21 matching lines...) Expand all Loading... | |
1685 // replace this implementation. http://crbug.com/22142 | 1686 // replace this implementation. http://crbug.com/22142 |
1686 if (parsed_command_line.HasSwitch(switches::kImport) || | 1687 if (parsed_command_line.HasSwitch(switches::kImport) || |
1687 parsed_command_line.HasSwitch(switches::kImportFromFile)) { | 1688 parsed_command_line.HasSwitch(switches::kImportFromFile)) { |
1688 return FirstRun::ImportNow(profile, parsed_command_line); | 1689 return FirstRun::ImportNow(profile, parsed_command_line); |
1689 } | 1690 } |
1690 #endif | 1691 #endif |
1691 | 1692 |
1692 #if defined(OS_WIN) | 1693 #if defined(OS_WIN) |
1693 // Do the tasks if chrome has been upgraded while it was last running. | 1694 // Do the tasks if chrome has been upgraded while it was last running. |
1694 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) | 1695 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) |
1695 return ResultCodes::NORMAL_EXIT; | 1696 return content::RESULT_CODE_NORMAL_EXIT; |
1696 #endif | 1697 #endif |
1697 | 1698 |
1698 // Check if there is any machine level Chrome installed on the current | 1699 // Check if there is any machine level Chrome installed on the current |
1699 // machine. If yes and the current Chrome process is user level, we do not | 1700 // machine. If yes and the current Chrome process is user level, we do not |
1700 // allow the user level Chrome to run. So we notify the user and uninstall | 1701 // allow the user level Chrome to run. So we notify the user and uninstall |
1701 // user level Chrome. | 1702 // user level Chrome. |
1702 // Note this check should only happen here, after all the checks above | 1703 // Note this check should only happen here, after all the checks above |
1703 // (uninstall, resource bundle initialization, other chrome browser | 1704 // (uninstall, resource bundle initialization, other chrome browser |
1704 // processes etc). | 1705 // processes etc). |
1705 // Do not allow this to occur for Chrome Frame user-to-system handoffs. | 1706 // Do not allow this to occur for Chrome Frame user-to-system handoffs. |
1706 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && | 1707 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && |
1707 CheckMachineLevelInstall()) | 1708 CheckMachineLevelInstall()) |
1708 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; | 1709 return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; |
1709 | 1710 |
1710 // Create the TranslateManager singleton. | 1711 // Create the TranslateManager singleton. |
1711 TranslateManager* translate_manager = TranslateManager::GetInstance(); | 1712 TranslateManager* translate_manager = TranslateManager::GetInstance(); |
1712 DCHECK(translate_manager != NULL); | 1713 DCHECK(translate_manager != NULL); |
1713 | 1714 |
1714 #if defined(OS_MACOSX) | 1715 #if defined(OS_MACOSX) |
1715 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { | 1716 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { |
1716 // Disk image installation is sort of a first-run task, so it shares the | 1717 // Disk image installation is sort of a first-run task, so it shares the |
1717 // kNoFirstRun switch. | 1718 // kNoFirstRun switch. |
1718 if (MaybeInstallFromDiskImage()) { | 1719 if (MaybeInstallFromDiskImage()) { |
1719 // The application was installed and the installed copy has been | 1720 // The application was installed and the installed copy has been |
1720 // launched. This process is now obsolete. Exit. | 1721 // launched. This process is now obsolete. Exit. |
1721 return ResultCodes::NORMAL_EXIT; | 1722 return content::RESULT_CODE_NORMAL_EXIT; |
1722 } | 1723 } |
1723 } | 1724 } |
1724 #endif | 1725 #endif |
1725 | 1726 |
1726 // Show the First Run UI if this is the first time Chrome has been run on | 1727 // Show the First Run UI if this is the first time Chrome has been run on |
1727 // this computer, or we're being compelled to do so by a command line flag. | 1728 // this computer, or we're being compelled to do so by a command line flag. |
1728 // Note that this be done _after_ the PrefService is initialized and all | 1729 // Note that this be done _after_ the PrefService is initialized and all |
1729 // preferences are registered, since some of the code that the importer | 1730 // preferences are registered, since some of the code that the importer |
1730 // touches reads preferences. | 1731 // touches reads preferences. |
1731 if (is_first_run) { | 1732 if (is_first_run) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1903 // See issue 40144. | 1904 // See issue 40144. |
1904 profile->GetExtensionService()->InitEventRouters(); | 1905 profile->GetExtensionService()->InitEventRouters(); |
1905 } | 1906 } |
1906 | 1907 |
1907 // The extension service may be available at this point. If the command line | 1908 // The extension service may be available at this point. If the command line |
1908 // specifies --uninstall-extension, attempt the uninstall extension startup | 1909 // specifies --uninstall-extension, attempt the uninstall extension startup |
1909 // action. | 1910 // action. |
1910 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { | 1911 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { |
1911 ExtensionsStartupUtil ext_startup_util; | 1912 ExtensionsStartupUtil ext_startup_util; |
1912 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { | 1913 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { |
1913 return ResultCodes::NORMAL_EXIT; | 1914 return content::RESULT_CODE_NORMAL_EXIT; |
1914 } else { | 1915 } else { |
1915 return ResultCodes::UNINSTALL_EXTENSION_ERROR; | 1916 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; |
1916 } | 1917 } |
1917 } | 1918 } |
1918 | 1919 |
1919 #if defined(OS_WIN) | 1920 #if defined(OS_WIN) |
1920 // We check this here because if the profile is OTR (chromeos possibility) | 1921 // We check this here because if the profile is OTR (chromeos possibility) |
1921 // it won't still be accessible after browser is destroyed. | 1922 // it won't still be accessible after browser is destroyed. |
1922 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); | 1923 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); |
1923 #endif | 1924 #endif |
1924 | 1925 |
1925 // ChildProcess:: is a misnomer unless you consider context. Use | 1926 // ChildProcess:: is a misnomer unless you consider context. Use |
(...skipping 24 matching lines...) Expand all Loading... | |
1950 new GpuBlacklistUpdater(); | 1951 new GpuBlacklistUpdater(); |
1951 // Don't start auto update in tests. | 1952 // Don't start auto update in tests. |
1952 if (parsed_command_line.GetSwitchValueASCII(switches::kUseGL) != | 1953 if (parsed_command_line.GetSwitchValueASCII(switches::kUseGL) != |
1953 gfx::kGLImplementationOSMesaName) { | 1954 gfx::kGLImplementationOSMesaName) { |
1954 gpu_blacklist_updater->StartAfterDelay(); | 1955 gpu_blacklist_updater->StartAfterDelay(); |
1955 } | 1956 } |
1956 | 1957 |
1957 // Start watching all browser threads for responsiveness. | 1958 // Start watching all browser threads for responsiveness. |
1958 ThreadWatcherList::StartWatchingAll(parsed_command_line); | 1959 ThreadWatcherList::StartWatchingAll(parsed_command_line); |
1959 | 1960 |
1960 int result_code = ResultCodes::NORMAL_EXIT; | 1961 int result_code = content::RESULT_CODE_NORMAL_EXIT; |
1961 if (parameters.ui_task) { | 1962 if (parameters.ui_task) { |
1962 // We are in test mode. Run one task and enter the main message loop. | 1963 // We are in test mode. Run one task and enter the main message loop. |
1963 if (pool) | 1964 if (pool) |
1964 pool->Recycle(); | 1965 pool->Recycle(); |
1965 parameters.ui_task->Run(); | 1966 parameters.ui_task->Run(); |
1966 delete parameters.ui_task; | 1967 delete parameters.ui_task; |
1967 } else { | 1968 } else { |
1968 // Most general initialization is behind us, but opening a | 1969 // Most general initialization is behind us, but opening a |
1969 // tab and/or session restore and such is still to be done. | 1970 // tab and/or session restore and such is still to be done. |
1970 base::TimeTicks browser_open_start = base::TimeTicks::Now(); | 1971 base::TimeTicks browser_open_start = base::TimeTicks::Now(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2077 #if defined(OS_CHROMEOS) | 2078 #if defined(OS_CHROMEOS) |
2078 // To be precise, logout (browser shutdown) is not yet done, but the | 2079 // To be precise, logout (browser shutdown) is not yet done, but the |
2079 // remaining work is negligible, hence we say LogoutDone here. | 2080 // remaining work is negligible, hence we say LogoutDone here. |
2080 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2081 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
2081 false); | 2082 false); |
2082 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2083 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
2083 #endif | 2084 #endif |
2084 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2085 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
2085 return result_code; | 2086 return result_code; |
2086 } | 2087 } |
OLD | NEW |