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