| 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 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 682 } |
| 683 | 683 |
| 684 void ChromeBrowserMainParts::RecordBrowserStartupTime() { | 684 void ChromeBrowserMainParts::RecordBrowserStartupTime() { |
| 685 // Don't record any metrics if UI was displayed before this point e.g. | 685 // Don't record any metrics if UI was displayed before this point e.g. |
| 686 // warning dialogs. | 686 // warning dialogs. |
| 687 if (startup_metric_utils::WasNonBrowserUIDisplayed()) | 687 if (startup_metric_utils::WasNonBrowserUIDisplayed()) |
| 688 return; | 688 return; |
| 689 | 689 |
| 690 bool is_first_run = first_run::IsChromeFirstRun(); | 690 bool is_first_run = first_run::IsChromeFirstRun(); |
| 691 | 691 |
| 692 // CurrentProcessInfo::CreationTime() is currently only implemented on Mac and | |
| 693 // Windows. | |
| 694 #if defined(OS_MACOSX) || defined(OS_WIN) | |
| 695 const base::Time* process_creation_time = | 692 const base::Time* process_creation_time = |
| 696 base::CurrentProcessInfo::CreationTime(); | 693 base::CurrentProcessInfo::CreationTime(); |
| 697 | 694 |
| 698 if (!is_first_run && process_creation_time) { | 695 if (!is_first_run && process_creation_time) { |
| 699 RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime", | 696 RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime", |
| 700 base::Time::Now() - *process_creation_time); | 697 base::Time::Now() - *process_creation_time); |
| 701 } | 698 } |
| 702 #endif // defined(OS_MACOSX) || defined(OS_WIN) | |
| 703 | 699 |
| 704 // Record collected startup metrics. | 700 // Record collected startup metrics. |
| 705 startup_metric_utils::OnBrowserStartupComplete(is_first_run); | 701 startup_metric_utils::OnBrowserStartupComplete(is_first_run); |
| 706 | 702 |
| 707 // Deletes self. | 703 // Deletes self. |
| 708 new LoadCompleteListener(); | 704 new LoadCompleteListener(); |
| 709 } | 705 } |
| 710 | 706 |
| 711 // This code is specific to the Windows-only PreReadExperiment field-trial. | 707 // This code is specific to the Windows-only PreReadExperiment field-trial. |
| 712 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name, | 708 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name, |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 chromeos::CrosSettings::Shutdown(); | 1697 chromeos::CrosSettings::Shutdown(); |
| 1702 #endif | 1698 #endif |
| 1703 #endif | 1699 #endif |
| 1704 } | 1700 } |
| 1705 | 1701 |
| 1706 // Public members: | 1702 // Public members: |
| 1707 | 1703 |
| 1708 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1704 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1709 chrome_extra_parts_.push_back(parts); | 1705 chrome_extra_parts_.push_back(parts); |
| 1710 } | 1706 } |
| OLD | NEW |