| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 #endif // defined(ENABLE_RLZ) | 227 #endif // defined(ENABLE_RLZ) |
| 228 | 228 |
| 229 #if defined(ENABLE_WEBRTC) | 229 #if defined(ENABLE_WEBRTC) |
| 230 #include "chrome/browser/media/webrtc_log_util.h" | 230 #include "chrome/browser/media/webrtc_log_util.h" |
| 231 #endif // defined(ENABLE_WEBRTC) | 231 #endif // defined(ENABLE_WEBRTC) |
| 232 | 232 |
| 233 #if defined(USE_AURA) | 233 #if defined(USE_AURA) |
| 234 #include "ui/aura/env.h" | 234 #include "ui/aura/env.h" |
| 235 #endif // defined(USE_AURA) | 235 #endif // defined(USE_AURA) |
| 236 | 236 |
| 237 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 238 #include "components/webusb/webusb_detector.h" |
| 239 #endif |
| 240 |
| 237 using content::BrowserThread; | 241 using content::BrowserThread; |
| 238 | 242 |
| 239 namespace { | 243 namespace { |
| 240 | 244 |
| 241 // This function provides some ways to test crash and assertion handling | 245 // This function provides some ways to test crash and assertion handling |
| 242 // behavior of the program. | 246 // behavior of the program. |
| 243 void HandleTestParameters(const base::CommandLine& command_line) { | 247 void HandleTestParameters(const base::CommandLine& command_line) { |
| 244 // This parameter causes a null pointer crash (crash reporter trigger). | 248 // This parameter causes a null pointer crash (crash reporter trigger). |
| 245 if (command_line.HasSwitch(switches::kBrowserCrashTest)) { | 249 if (command_line.HasSwitch(switches::kBrowserCrashTest)) { |
| 246 int* bad_pointer = NULL; | 250 int* bad_pointer = NULL; |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 #if defined(ENABLE_WEBRTC) | 1147 #if defined(ENABLE_WEBRTC) |
| 1144 // Set up a task to delete old WebRTC log files for all profiles. Use a delay | 1148 // Set up a task to delete old WebRTC log files for all profiles. Use a delay |
| 1145 // to reduce the impact on startup time. | 1149 // to reduce the impact on startup time. |
| 1146 BrowserThread::PostDelayedTask( | 1150 BrowserThread::PostDelayedTask( |
| 1147 BrowserThread::UI, | 1151 BrowserThread::UI, |
| 1148 FROM_HERE, | 1152 FROM_HERE, |
| 1149 base::Bind(&WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles), | 1153 base::Bind(&WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles), |
| 1150 base::TimeDelta::FromMinutes(1)); | 1154 base::TimeDelta::FromMinutes(1)); |
| 1151 #endif // defined(ENABLE_WEBRTC) | 1155 #endif // defined(ENABLE_WEBRTC) |
| 1152 | 1156 |
| 1157 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 1158 webusb::WebUsbDetector::GetInstance(); |
| 1159 #endif |
| 1160 |
| 1153 // At this point, StartupBrowserCreator::Start has run creating initial | 1161 // At this point, StartupBrowserCreator::Start has run creating initial |
| 1154 // browser windows and tabs, but no progress has been made in loading | 1162 // browser windows and tabs, but no progress has been made in loading |
| 1155 // content as the main message loop hasn't started processing tasks yet. | 1163 // content as the main message loop hasn't started processing tasks yet. |
| 1156 // We setup to observe to the initial page load here to defer running | 1164 // We setup to observe to the initial page load here to defer running |
| 1157 // task posted via PostAfterStartupTask until its complete. | 1165 // task posted via PostAfterStartupTask until its complete. |
| 1158 AfterStartupTaskUtils::StartMonitoringStartup(); | 1166 AfterStartupTaskUtils::StartMonitoringStartup(); |
| 1159 } | 1167 } |
| 1160 | 1168 |
| 1161 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { | 1169 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| 1162 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1170 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 chromeos::CrosSettings::Shutdown(); | 1810 chromeos::CrosSettings::Shutdown(); |
| 1803 #endif // defined(OS_CHROMEOS) | 1811 #endif // defined(OS_CHROMEOS) |
| 1804 #endif // defined(OS_ANDROID) | 1812 #endif // defined(OS_ANDROID) |
| 1805 } | 1813 } |
| 1806 | 1814 |
| 1807 // Public members: | 1815 // Public members: |
| 1808 | 1816 |
| 1809 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1817 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1810 chrome_extra_parts_.push_back(parts); | 1818 chrome_extra_parts_.push_back(parts); |
| 1811 } | 1819 } |
| OLD | NEW |