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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 // user level Chrome. | 1633 // user level Chrome. |
1634 // Note this check should only happen here, after all the checks above | 1634 // Note this check should only happen here, after all the checks above |
1635 // (uninstall, resource bundle initialization, other chrome browser | 1635 // (uninstall, resource bundle initialization, other chrome browser |
1636 // processes etc). | 1636 // processes etc). |
1637 // Do not allow this to occur for Chrome Frame user-to-system handoffs. | 1637 // Do not allow this to occur for Chrome Frame user-to-system handoffs. |
1638 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && | 1638 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && |
1639 CheckMachineLevelInstall()) | 1639 CheckMachineLevelInstall()) |
1640 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; | 1640 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; |
1641 | 1641 |
1642 // Create the TranslateManager singleton. | 1642 // Create the TranslateManager singleton. |
1643 TranslateManager::GetInstance(); | 1643 TranslateManager* translate_manager = TranslateManager::GetInstance(); |
| 1644 DCHECK(translate_manager != NULL); |
| 1645 // If we're running tests (ui_task is non-null), then we don't want to |
| 1646 // call FetchLanguageListFromTranslateServer |
| 1647 if (parameters.ui_task == NULL && translate_manager != NULL) |
| 1648 translate_manager->FetchLanguageListFromTranslateServer(user_prefs); |
1644 | 1649 |
1645 #if defined(OS_MACOSX) | 1650 #if defined(OS_MACOSX) |
1646 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { | 1651 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { |
1647 // Disk image installation is sort of a first-run task, so it shares the | 1652 // Disk image installation is sort of a first-run task, so it shares the |
1648 // kNoFirstRun switch. | 1653 // kNoFirstRun switch. |
1649 if (MaybeInstallFromDiskImage()) { | 1654 if (MaybeInstallFromDiskImage()) { |
1650 // The application was installed and the installed copy has been | 1655 // The application was installed and the installed copy has been |
1651 // launched. This process is now obsolete. Exit. | 1656 // launched. This process is now obsolete. Exit. |
1652 return ResultCodes::NORMAL_EXIT; | 1657 return ResultCodes::NORMAL_EXIT; |
1653 } | 1658 } |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 #if defined(OS_CHROMEOS) | 2008 #if defined(OS_CHROMEOS) |
2004 // To be precise, logout (browser shutdown) is not yet done, but the | 2009 // To be precise, logout (browser shutdown) is not yet done, but the |
2005 // remaining work is negligible, hence we say LogoutDone here. | 2010 // remaining work is negligible, hence we say LogoutDone here. |
2006 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2011 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
2007 false); | 2012 false); |
2008 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2013 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
2009 #endif | 2014 #endif |
2010 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2015 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
2011 return result_code; | 2016 return result_code; |
2012 } | 2017 } |
OLD | NEW |