OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1647 // will be initialized when the app enters foreground mode. | 1647 // will be initialized when the app enters foreground mode. |
1648 variations_service->set_policy_pref_service(profile_->GetPrefs()); | 1648 variations_service->set_policy_pref_service(profile_->GetPrefs()); |
1649 } | 1649 } |
1650 translate::TranslateDownloadManager::RequestLanguageList( | 1650 translate::TranslateDownloadManager::RequestLanguageList( |
1651 profile_->GetPrefs()); | 1651 profile_->GetPrefs()); |
1652 | 1652 |
1653 #else | 1653 #else |
1654 // Most general initialization is behind us, but opening a | 1654 // Most general initialization is behind us, but opening a |
1655 // tab and/or session restore and such is still to be done. | 1655 // tab and/or session restore and such is still to be done. |
1656 base::TimeTicks browser_open_start = base::TimeTicks::Now(); | 1656 base::TimeTicks browser_open_start = base::TimeTicks::Now(); |
1657 TRACE_EVENT_BEGIN0("startup", "Startup.BrowserOpenTabs"); | |
1657 | 1658 |
1658 // We are in regular browser boot sequence. Open initial tabs and enter the | 1659 // We are in regular browser boot sequence. Open initial tabs and enter the |
1659 // main message loop. | 1660 // main message loop. |
1660 std::vector<Profile*> last_opened_profiles; | 1661 std::vector<Profile*> last_opened_profiles; |
1661 #if !defined(OS_CHROMEOS) | 1662 #if !defined(OS_CHROMEOS) |
1662 // On ChromeOS multiple profiles doesn't apply, and will break if we load | 1663 // On ChromeOS multiple profiles doesn't apply, and will break if we load |
1663 // them this early as the cryptohome hasn't yet been mounted (which happens | 1664 // them this early as the cryptohome hasn't yet been mounted (which happens |
1664 // only once we log in). | 1665 // only once we log in). |
1665 last_opened_profiles = | 1666 last_opened_profiles = |
1666 g_browser_process->profile_manager()->GetLastOpenedProfiles(); | 1667 g_browser_process->profile_manager()->GetLastOpenedProfiles(); |
(...skipping 30 matching lines...) Expand all Loading... | |
1697 #if defined(OS_MACOSX) | 1698 #if defined(OS_MACOSX) |
1698 // Call Recycle() here as late as possible, before going into the loop | 1699 // Call Recycle() here as late as possible, before going into the loop |
1699 // because Start() will add things to it while creating the main window. | 1700 // because Start() will add things to it while creating the main window. |
1700 if (parameters().autorelease_pool) | 1701 if (parameters().autorelease_pool) |
1701 parameters().autorelease_pool->Recycle(); | 1702 parameters().autorelease_pool->Recycle(); |
1702 #endif // defined(OS_MACOSX) | 1703 #endif // defined(OS_MACOSX) |
1703 | 1704 |
1704 const base::TimeDelta delta = base::TimeTicks::Now() - browser_open_start; | 1705 const base::TimeDelta delta = base::TimeTicks::Now() - browser_open_start; |
1705 startup_metric_utils::RecordBrowserOpenTabsDelta(delta); | 1706 startup_metric_utils::RecordBrowserOpenTabsDelta(delta); |
1706 | 1707 |
1708 TRACE_EVENT_END0("startup", "Startup.BrowserOpenTabs"); | |
gab
2015/11/10 19:30:53
I like these, except I'm not convinced they belong
gabadie
2015/11/12 08:57:20
Done.
| |
1709 | |
1707 // If we're running tests (ui_task is non-null), then we don't want to | 1710 // If we're running tests (ui_task is non-null), then we don't want to |
1708 // call RequestLanguageList or StartRepeatedVariationsSeedFetch or | 1711 // call RequestLanguageList or StartRepeatedVariationsSeedFetch or |
1709 // RequestLanguageList | 1712 // RequestLanguageList |
1710 if (parameters().ui_task == NULL) { | 1713 if (parameters().ui_task == NULL) { |
1711 // Request new variations seed information from server. | 1714 // Request new variations seed information from server. |
1712 variations::VariationsService* variations_service = | 1715 variations::VariationsService* variations_service = |
1713 browser_process_->variations_service(); | 1716 browser_process_->variations_service(); |
1714 if (variations_service) | 1717 if (variations_service) |
1715 variations_service->PerformPreMainMessageLoopStartup(); | 1718 variations_service->PerformPreMainMessageLoopStartup(); |
1716 | 1719 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1862 chromeos::CrosSettings::Shutdown(); | 1865 chromeos::CrosSettings::Shutdown(); |
1863 #endif // defined(OS_CHROMEOS) | 1866 #endif // defined(OS_CHROMEOS) |
1864 #endif // defined(OS_ANDROID) | 1867 #endif // defined(OS_ANDROID) |
1865 } | 1868 } |
1866 | 1869 |
1867 // Public members: | 1870 // Public members: |
1868 | 1871 |
1869 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1872 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1870 chrome_extra_parts_.push_back(parts); | 1873 chrome_extra_parts_.push_back(parts); |
1871 } | 1874 } |
OLD | NEW |