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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #include "chrome/browser/translate/translate_service.h" | 88 #include "chrome/browser/translate/translate_service.h" |
89 #include "chrome/browser/ui/app_list/app_list_service.h" | 89 #include "chrome/browser/ui/app_list/app_list_service.h" |
90 #include "chrome/browser/ui/browser.h" | 90 #include "chrome/browser/ui/browser.h" |
91 #include "chrome/browser/ui/browser_finder.h" | 91 #include "chrome/browser/ui/browser_finder.h" |
92 #include "chrome/browser/ui/host_desktop.h" | 92 #include "chrome/browser/ui/host_desktop.h" |
93 #include "chrome/browser/ui/startup/bad_flags_prompt.h" | 93 #include "chrome/browser/ui/startup/bad_flags_prompt.h" |
94 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 94 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
95 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 95 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
96 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 96 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
97 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 97 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 98 #include "chrome/common/channel_info.h" |
98 #include "chrome/common/chrome_constants.h" | 99 #include "chrome/common/chrome_constants.h" |
99 #include "chrome/common/chrome_paths.h" | 100 #include "chrome/common/chrome_paths.h" |
100 #include "chrome/common/chrome_result_codes.h" | 101 #include "chrome/common/chrome_result_codes.h" |
101 #include "chrome/common/chrome_switches.h" | 102 #include "chrome/common/chrome_switches.h" |
102 #include "chrome/common/chrome_version_info.h" | |
103 #include "chrome/common/crash_keys.h" | 103 #include "chrome/common/crash_keys.h" |
104 #include "chrome/common/env_vars.h" | 104 #include "chrome/common/env_vars.h" |
105 #include "chrome/common/logging_chrome.h" | 105 #include "chrome/common/logging_chrome.h" |
106 #include "chrome/common/net/net_resource_provider.h" | 106 #include "chrome/common/net/net_resource_provider.h" |
107 #include "chrome/common/pref_names.h" | 107 #include "chrome/common/pref_names.h" |
108 #include "chrome/common/profiling.h" | 108 #include "chrome/common/profiling.h" |
109 #include "chrome/common/variations/variations_util.h" | 109 #include "chrome/common/variations/variations_util.h" |
110 #include "chrome/grit/generated_resources.h" | 110 #include "chrome/grit/generated_resources.h" |
111 #include "chrome/installer/util/google_update_settings.h" | 111 #include "chrome/installer/util/google_update_settings.h" |
112 #include "components/component_updater/component_updater_service.h" | 112 #include "components/component_updater/component_updater_service.h" |
113 #include "components/device_event_log/device_event_log.h" | 113 #include "components/device_event_log/device_event_log.h" |
114 #include "components/google/core/browser/google_util.h" | 114 #include "components/google/core/browser/google_util.h" |
115 #include "components/language_usage_metrics/language_usage_metrics.h" | 115 #include "components/language_usage_metrics/language_usage_metrics.h" |
116 #include "components/metrics/call_stack_profile_metrics_provider.h" | 116 #include "components/metrics/call_stack_profile_metrics_provider.h" |
117 #include "components/metrics/metrics_service.h" | 117 #include "components/metrics/metrics_service.h" |
118 #include "components/metrics/profiler/tracking_synchronizer.h" | 118 #include "components/metrics/profiler/tracking_synchronizer.h" |
119 #include "components/nacl/browser/nacl_browser.h" | 119 #include "components/nacl/browser/nacl_browser.h" |
120 #include "components/rappor/rappor_service.h" | 120 #include "components/rappor/rappor_service.h" |
121 #include "components/signin/core/common/profile_management_switches.h" | 121 #include "components/signin/core/common/profile_management_switches.h" |
122 #include "components/startup_metric_utils/startup_metric_utils.h" | 122 #include "components/startup_metric_utils/startup_metric_utils.h" |
123 #include "components/translate/content/browser/browser_cld_utils.h" | 123 #include "components/translate/content/browser/browser_cld_utils.h" |
124 #include "components/translate/content/common/cld_data_source.h" | 124 #include "components/translate/content/common/cld_data_source.h" |
125 #include "components/translate/core/browser/translate_download_manager.h" | 125 #include "components/translate/core/browser/translate_download_manager.h" |
126 #include "components/variations/net/variations_http_header_provider.h" | 126 #include "components/variations/net/variations_http_header_provider.h" |
127 #include "components/variations/variations_associated_data.h" | 127 #include "components/variations/variations_associated_data.h" |
| 128 #include "components/version_info/version_info.h" |
128 #include "content/public/browser/browser_thread.h" | 129 #include "content/public/browser/browser_thread.h" |
129 #include "content/public/browser/notification_observer.h" | 130 #include "content/public/browser/notification_observer.h" |
130 #include "content/public/browser/notification_registrar.h" | 131 #include "content/public/browser/notification_registrar.h" |
131 #include "content/public/browser/notification_service.h" | 132 #include "content/public/browser/notification_service.h" |
132 #include "content/public/browser/notification_types.h" | 133 #include "content/public/browser/notification_types.h" |
133 #include "content/public/browser/power_usage_monitor.h" | 134 #include "content/public/browser/power_usage_monitor.h" |
134 #include "content/public/browser/site_instance.h" | 135 #include "content/public/browser/site_instance.h" |
135 #include "content/public/common/content_client.h" | 136 #include "content/public/common/content_client.h" |
136 #include "content/public/common/content_switches.h" | 137 #include "content/public/common/content_switches.h" |
137 #include "content/public/common/main_function_params.h" | 138 #include "content/public/common/main_function_params.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 668 |
668 // Initialize FieldTrialSynchronizer system. This is a singleton and is used | 669 // Initialize FieldTrialSynchronizer system. This is a singleton and is used |
669 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 670 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
670 // Even though base::Bind does AddRef and Release, the object will not be | 671 // Even though base::Bind does AddRef and Release, the object will not be |
671 // deleted after the Task is executed. | 672 // deleted after the Task is executed. |
672 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 673 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
673 | 674 |
674 // Now that field trials have been created, initializes metrics recording. | 675 // Now that field trials have been created, initializes metrics recording. |
675 metrics->InitializeMetricsRecordingState(); | 676 metrics->InitializeMetricsRecordingState(); |
676 | 677 |
677 const version_info::Channel channel = | 678 const version_info::Channel channel = chrome::GetChannel(); |
678 chrome::VersionInfo::GetChannel(); | |
679 | 679 |
680 // TODO(dalecurtis): Remove these checks and enable for all channels once we | 680 // TODO(dalecurtis): Remove these checks and enable for all channels once we |
681 // track down the root causes of crbug.com/422522 and crbug.com/478932. | 681 // track down the root causes of crbug.com/422522 and crbug.com/478932. |
682 if (channel == version_info::Channel::UNKNOWN || | 682 if (channel == version_info::Channel::UNKNOWN || |
683 channel == version_info::Channel::CANARY || | 683 channel == version_info::Channel::CANARY || |
684 channel == version_info::Channel::DEV) { | 684 channel == version_info::Channel::DEV) { |
685 media::AudioManager::EnableHangMonitor(); | 685 media::AudioManager::EnableHangMonitor(); |
686 } | 686 } |
687 | 687 |
688 // Enable profiler instrumentation depending on the channel. | 688 // Enable profiler instrumentation depending on the channel. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 #if defined(OS_WIN) | 1006 #if defined(OS_WIN) |
1007 if (!master_prefs_->welcome_page_on_os_upgrade_enabled) | 1007 if (!master_prefs_->welcome_page_on_os_upgrade_enabled) |
1008 local_state_->SetBoolean(prefs::kWelcomePageOnOSUpgradeEnabled, false); | 1008 local_state_->SetBoolean(prefs::kWelcomePageOnOSUpgradeEnabled, false); |
1009 #endif | 1009 #endif |
1010 } | 1010 } |
1011 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1011 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
1012 | 1012 |
1013 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) | 1013 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) |
1014 // Set the product channel for crash reports. | 1014 // Set the product channel for crash reports. |
1015 base::debug::SetCrashKeyValue(crash_keys::kChannel, | 1015 base::debug::SetCrashKeyValue(crash_keys::kChannel, |
1016 chrome::VersionInfo::GetVersionStringModifier()); | 1016 chrome::GetChannelString()); |
1017 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) | 1017 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) |
1018 | 1018 |
1019 // Initialize tracking synchronizer system. | 1019 // Initialize tracking synchronizer system. |
1020 tracking_synchronizer_ = new metrics::TrackingSynchronizer( | 1020 tracking_synchronizer_ = new metrics::TrackingSynchronizer( |
1021 make_scoped_ptr(new base::DefaultTickClock())); | 1021 make_scoped_ptr(new base::DefaultTickClock())); |
1022 | 1022 |
1023 #if defined(OS_MACOSX) | 1023 #if defined(OS_MACOSX) |
1024 // Get the Keychain API to register for distributed notifications on the main | 1024 // Get the Keychain API to register for distributed notifications on the main |
1025 // thread, which has a proper CFRunloop, instead of later on the I/O thread, | 1025 // thread, which has a proper CFRunloop, instead of later on the I/O thread, |
1026 // which doesn't. This ensures those notifications will get delivered | 1026 // which doesn't. This ensures those notifications will get delivered |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 chromeos::CrosSettings::Shutdown(); | 1798 chromeos::CrosSettings::Shutdown(); |
1799 #endif // defined(OS_CHROMEOS) | 1799 #endif // defined(OS_CHROMEOS) |
1800 #endif // defined(OS_ANDROID) | 1800 #endif // defined(OS_ANDROID) |
1801 } | 1801 } |
1802 | 1802 |
1803 // Public members: | 1803 // Public members: |
1804 | 1804 |
1805 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1805 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1806 chrome_extra_parts_.push_back(parts); | 1806 chrome_extra_parts_.push_back(parts); |
1807 } | 1807 } |
OLD | NEW |