Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h " | 55 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h " |
| 56 #include "chrome/browser/component_updater/swiftshader_component_installer.h" | 56 #include "chrome/browser/component_updater/swiftshader_component_installer.h" |
| 57 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" | 57 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" |
| 58 #include "chrome/browser/defaults.h" | 58 #include "chrome/browser/defaults.h" |
| 59 #include "chrome/browser/first_run/first_run.h" | 59 #include "chrome/browser/first_run/first_run.h" |
| 60 #include "chrome/browser/gpu/gl_string_manager.h" | 60 #include "chrome/browser/gpu/gl_string_manager.h" |
| 61 #include "chrome/browser/gpu/three_d_api_observer.h" | 61 #include "chrome/browser/gpu/three_d_api_observer.h" |
| 62 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 62 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 63 #include "chrome/browser/memory/tab_manager.h" | 63 #include "chrome/browser/memory/tab_manager.h" |
| 64 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 64 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 65 #include "chrome/browser/metrics/metrics_reporting_state.h" | |
| 65 #include "chrome/browser/metrics/thread_watcher.h" | 66 #include "chrome/browser/metrics/thread_watcher.h" |
| 66 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" | 67 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
| 67 #include "chrome/browser/net/crl_set_fetcher.h" | 68 #include "chrome/browser/net/crl_set_fetcher.h" |
| 68 #include "chrome/browser/performance_monitor/performance_monitor.h" | 69 #include "chrome/browser/performance_monitor/performance_monitor.h" |
| 69 #include "chrome/browser/plugins/plugin_prefs.h" | 70 #include "chrome/browser/plugins/plugin_prefs.h" |
| 70 #include "chrome/browser/power/process_power_collector.h" | 71 #include "chrome/browser/power/process_power_collector.h" |
| 71 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 72 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 72 #include "chrome/browser/prefs/command_line_pref_store.h" | 73 #include "chrome/browser/prefs/command_line_pref_store.h" |
| 73 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 74 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 74 #include "chrome/browser/prefs/pref_metrics_service.h" | 75 #include "chrome/browser/prefs/pref_metrics_service.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 725 case version_info::Channel::DEV: | 726 case version_info::Channel::DEV: |
| 726 case version_info::Channel::BETA: | 727 case version_info::Channel::BETA: |
| 727 case version_info::Channel::STABLE: | 728 case version_info::Channel::STABLE: |
| 728 // Don't enable instrumentation. | 729 // Don't enable instrumentation. |
| 729 break; | 730 break; |
| 730 } | 731 } |
| 731 | 732 |
| 732 // Register a synthetic field trial for the sampling profiler configuration | 733 // Register a synthetic field trial for the sampling profiler configuration |
| 733 // that was already chosen. | 734 // that was already chosen. |
| 734 sampling_profiler_config_.RegisterSyntheticFieldTrial(); | 735 sampling_profiler_config_.RegisterSyntheticFieldTrial(); |
| 736 | |
| 737 #if defined(OS_CHROMEOS) | |
| 738 // Set kMetricsReportingEnabled based on kStatsReportingPref device setting as | |
| 739 // it is more reliable for Chrome OS. | |
|
Mattias Nissler (ping if slow)
2015/10/28 09:51:15
suggestion: s/it is more reliable for Chrome OS/it
gayane -on leave until 09-2017
2015/10/28 15:00:07
Done.
| |
| 740 bool enable_metrics = false; | |
| 741 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, | |
| 742 &enable_metrics); | |
|
Mattias Nissler (ping if slow)
2015/10/28 09:51:15
I'd expect an observer to be installed here to re-
gayane -on leave until 09-2017
2015/10/28 15:00:06
you mean besides initialization? My understanding
Mattias Nissler (ping if slow)
2015/10/29 10:06:14
I guess you're referring to the CrosSettings::SetB
Alexei Svitkine (slow)
2015/10/29 17:04:14
Can the observer change be done in a later CL? I t
Mattias Nissler (ping if slow)
2015/11/02 11:09:58
Note that the old code does handle device settings
| |
| 743 InitiateMetricsReportingChange(enable_metrics, | |
| 744 OnMetricsReportingCallbackType()); | |
| 745 #endif | |
| 735 } | 746 } |
| 736 | 747 |
| 737 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- | 748 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- |
| 738 | 749 |
| 739 void ChromeBrowserMainParts::StartMetricsRecording() { | 750 void ChromeBrowserMainParts::StartMetricsRecording() { |
| 740 TRACE_EVENT0("startup", "ChromeBrowserMainParts::StartMetricsRecording"); | 751 TRACE_EVENT0("startup", "ChromeBrowserMainParts::StartMetricsRecording"); |
| 741 | 752 |
| 742 g_browser_process->metrics_service()->CheckForClonedInstall( | 753 g_browser_process->metrics_service()->CheckForClonedInstall( |
| 743 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 754 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
| 744 | 755 |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1848 chromeos::CrosSettings::Shutdown(); | 1859 chromeos::CrosSettings::Shutdown(); |
| 1849 #endif // defined(OS_CHROMEOS) | 1860 #endif // defined(OS_CHROMEOS) |
| 1850 #endif // defined(OS_ANDROID) | 1861 #endif // defined(OS_ANDROID) |
| 1851 } | 1862 } |
| 1852 | 1863 |
| 1853 // Public members: | 1864 // Public members: |
| 1854 | 1865 |
| 1855 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1866 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1856 chrome_extra_parts_.push_back(parts); | 1867 chrome_extra_parts_.push_back(parts); |
| 1857 } | 1868 } |
| OLD | NEW |