| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "chrome/browser/service/service_process_control.h" | 71 #include "chrome/browser/service/service_process_control.h" |
| 72 #include "chrome/browser/shell_integration.h" | 72 #include "chrome/browser/shell_integration.h" |
| 73 #include "chrome/browser/translate/translate_manager.h" | 73 #include "chrome/browser/translate/translate_manager.h" |
| 74 #include "chrome/browser/ui/browser.h" | 74 #include "chrome/browser/ui/browser.h" |
| 75 #include "chrome/browser/ui/browser_init.h" | 75 #include "chrome/browser/ui/browser_init.h" |
| 76 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 76 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 77 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" | 77 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" |
| 78 #include "chrome/common/chrome_constants.h" | 78 #include "chrome/common/chrome_constants.h" |
| 79 #include "chrome/common/chrome_paths.h" | 79 #include "chrome/common/chrome_paths.h" |
| 80 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
| 81 #include "chrome/common/chrome_version_info.h" |
| 81 #include "chrome/common/env_vars.h" | 82 #include "chrome/common/env_vars.h" |
| 82 #include "chrome/common/json_pref_store.h" | 83 #include "chrome/common/json_pref_store.h" |
| 83 #include "chrome/common/jstemplate_builder.h" | 84 #include "chrome/common/jstemplate_builder.h" |
| 84 #include "chrome/common/logging_chrome.h" | 85 #include "chrome/common/logging_chrome.h" |
| 85 #include "chrome/common/net/net_resource_provider.h" | 86 #include "chrome/common/net/net_resource_provider.h" |
| 86 #include "chrome/common/pref_names.h" | 87 #include "chrome/common/pref_names.h" |
| 87 #include "chrome/common/profiling.h" | 88 #include "chrome/common/profiling.h" |
| 88 #include "chrome/installer/util/google_update_settings.h" | 89 #include "chrome/installer/util/google_update_settings.h" |
| 89 #include "content/browser/browser_thread.h" | 90 #include "content/browser/browser_thread.h" |
| 90 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 91 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 #include "chrome/browser/chromeos/login/authenticator.h" | 142 #include "chrome/browser/chromeos/login/authenticator.h" |
| 142 #include "chrome/browser/chromeos/login/login_utils.h" | 143 #include "chrome/browser/chromeos/login/login_utils.h" |
| 143 #include "chrome/browser/chromeos/login/ownership_service.h" | 144 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 144 #include "chrome/browser/chromeos/login/screen_locker.h" | 145 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 145 #include "chrome/browser/chromeos/login/user_manager.h" | 146 #include "chrome/browser/chromeos/login/user_manager.h" |
| 146 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" | 147 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" |
| 147 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 148 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 148 #include "chrome/browser/chromeos/system_key_event_listener.h" | 149 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 149 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 150 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
| 150 #include "chrome/browser/oom_priority_manager.h" | 151 #include "chrome/browser/oom_priority_manager.h" |
| 151 #include "chrome/browser/platform_util.h" | |
| 152 #include "chrome/browser/ui/views/browser_dialogs.h" | 152 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 153 #endif | 153 #endif |
| 154 | 154 |
| 155 // TODO(port): several win-only methods have been pulled out of this, but | 155 // TODO(port): several win-only methods have been pulled out of this, but |
| 156 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 156 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
| 157 // other platforms. For now, it's just a stub. This is a serious work in | 157 // other platforms. For now, it's just a stub. This is a serious work in |
| 158 // progress and should not be taken as an indication of a real refactoring. | 158 // progress and should not be taken as an indication of a real refactoring. |
| 159 | 159 |
| 160 #if defined(OS_WIN) | 160 #if defined(OS_WIN) |
| 161 #include <commctrl.h> | 161 #include <commctrl.h> |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 // Check whether we should initialize the crash reporter. It may be disabled | 1167 // Check whether we should initialize the crash reporter. It may be disabled |
| 1168 // through configuration policy or user preference. It must be disabled for | 1168 // through configuration policy or user preference. It must be disabled for |
| 1169 // Guest mode on Chrome OS in Stable channel. | 1169 // Guest mode on Chrome OS in Stable channel. |
| 1170 // The kHeadless environment variable overrides the decision, but only if the | 1170 // The kHeadless environment variable overrides the decision, but only if the |
| 1171 // crash service is under control of the user. It is used by QA testing | 1171 // crash service is under control of the user. It is used by QA testing |
| 1172 // infrastructure to switch on generation of crash reports. | 1172 // infrastructure to switch on generation of crash reports. |
| 1173 #if defined(OS_CHROMEOS) | 1173 #if defined(OS_CHROMEOS) |
| 1174 bool is_guest_session = | 1174 bool is_guest_session = |
| 1175 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); | 1175 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); |
| 1176 bool is_stable_channel = | 1176 bool is_stable_channel = |
| 1177 platform_util::GetChannel() == platform_util::CHANNEL_STABLE; | 1177 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE; |
| 1178 bool breakpad_enabled = | 1178 bool breakpad_enabled = |
| 1179 !(is_guest_session && is_stable_channel) && | 1179 !(is_guest_session && is_stable_channel) && |
| 1180 chromeos::MetricsCrosSettingsProvider::GetMetricsStatus(); | 1180 chromeos::MetricsCrosSettingsProvider::GetMetricsStatus(); |
| 1181 if (!breakpad_enabled) | 1181 if (!breakpad_enabled) |
| 1182 breakpad_enabled = getenv(env_vars::kHeadless) != NULL; | 1182 breakpad_enabled = getenv(env_vars::kHeadless) != NULL; |
| 1183 #else | 1183 #else |
| 1184 const PrefService::Preference* metrics_reporting_enabled = | 1184 const PrefService::Preference* metrics_reporting_enabled = |
| 1185 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1185 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
| 1186 CHECK(metrics_reporting_enabled); | 1186 CHECK(metrics_reporting_enabled); |
| 1187 bool breakpad_enabled = | 1187 bool breakpad_enabled = |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 #if defined(OS_CHROMEOS) | 1985 #if defined(OS_CHROMEOS) |
| 1986 // To be precise, logout (browser shutdown) is not yet done, but the | 1986 // To be precise, logout (browser shutdown) is not yet done, but the |
| 1987 // remaining work is negligible, hence we say LogoutDone here. | 1987 // remaining work is negligible, hence we say LogoutDone here. |
| 1988 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1988 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 1989 false); | 1989 false); |
| 1990 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1990 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 1991 #endif | 1991 #endif |
| 1992 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 1992 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
| 1993 return result_code; | 1993 return result_code; |
| 1994 } | 1994 } |
| OLD | NEW |