| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 #if defined(ENABLE_WEBRTC) | 251 #if defined(ENABLE_WEBRTC) |
| 252 #include "chrome/browser/media/webrtc_log_util.h" | 252 #include "chrome/browser/media/webrtc_log_util.h" |
| 253 #endif // defined(ENABLE_WEBRTC) | 253 #endif // defined(ENABLE_WEBRTC) |
| 254 | 254 |
| 255 #if defined(USE_AURA) | 255 #if defined(USE_AURA) |
| 256 #include "ui/aura/env.h" | 256 #include "ui/aura/env.h" |
| 257 #endif // defined(USE_AURA) | 257 #endif // defined(USE_AURA) |
| 258 | 258 |
| 259 #if !defined(OS_ANDROID) | 259 #if !defined(OS_ANDROID) |
| 260 #include "chrome/browser/chrome_webusb_browser_client.h" | 260 #include "chrome/browser/usb/web_usb_detector.h" |
| 261 #include "components/webusb/webusb_detector.h" | |
| 262 #endif | 261 #endif |
| 263 | 262 |
| 264 #if defined(MOJO_SHELL_CLIENT) | 263 #if defined(MOJO_SHELL_CLIENT) |
| 265 #include "chrome/browser/lifetime/application_lifetime.h" | 264 #include "chrome/browser/lifetime/application_lifetime.h" |
| 266 #include "content/public/common/mojo_shell_connection.h" | 265 #include "content/public/common/mojo_shell_connection.h" |
| 267 #include "services/shell/runner/common/client_util.h" | 266 #include "services/shell/runner/common/client_util.h" |
| 268 #endif | 267 #endif |
| 269 | 268 |
| 270 using content::BrowserThread; | 269 using content::BrowserThread; |
| 271 | 270 |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 base::TimeDelta::FromMinutes(1)); | 1358 base::TimeDelta::FromMinutes(1)); |
| 1360 #endif // defined(ENABLE_WEBRTC) | 1359 #endif // defined(ENABLE_WEBRTC) |
| 1361 | 1360 |
| 1362 #if !defined(OS_ANDROID) | 1361 #if !defined(OS_ANDROID) |
| 1363 // WebUSB is an experimental web API. The sites these notifications will link | 1362 // WebUSB is an experimental web API. The sites these notifications will link |
| 1364 // to will only work if the experiment is enabled and WebUSB feature is | 1363 // to will only work if the experiment is enabled and WebUSB feature is |
| 1365 // enabled. | 1364 // enabled. |
| 1366 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1365 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1367 switches::kEnableExperimentalWebPlatformFeatures) && | 1366 switches::kEnableExperimentalWebPlatformFeatures) && |
| 1368 base::FeatureList::IsEnabled(features::kWebUsb)) { | 1367 base::FeatureList::IsEnabled(features::kWebUsb)) { |
| 1369 webusb_browser_client_.reset(new ChromeWebUsbBrowserClient()); | 1368 web_usb_detector_.reset(new WebUsbDetector()); |
| 1370 webusb_detector_.reset( | |
| 1371 new webusb::WebUsbDetector(webusb_browser_client_.get())); | |
| 1372 } | 1369 } |
| 1373 #endif | 1370 #endif |
| 1374 | 1371 |
| 1375 // At this point, StartupBrowserCreator::Start has run creating initial | 1372 // At this point, StartupBrowserCreator::Start has run creating initial |
| 1376 // browser windows and tabs, but no progress has been made in loading | 1373 // browser windows and tabs, but no progress has been made in loading |
| 1377 // content as the main message loop hasn't started processing tasks yet. | 1374 // content as the main message loop hasn't started processing tasks yet. |
| 1378 // We setup to observe to the initial page load here to defer running | 1375 // We setup to observe to the initial page load here to defer running |
| 1379 // task posted via PostAfterStartupTask until its complete. | 1376 // task posted via PostAfterStartupTask until its complete. |
| 1380 AfterStartupTaskUtils::StartMonitoringStartup(); | 1377 AfterStartupTaskUtils::StartMonitoringStartup(); |
| 1381 } | 1378 } |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 g_browser_process->local_state()); | 1961 g_browser_process->local_state()); |
| 1965 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); | 1962 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); |
| 1966 | 1963 |
| 1967 // Disarm the startup hang detector time bomb if it is still Arm'ed. | 1964 // Disarm the startup hang detector time bomb if it is still Arm'ed. |
| 1968 startup_watcher_->Disarm(); | 1965 startup_watcher_->Disarm(); |
| 1969 | 1966 |
| 1970 // Remove observers attached to D-Bus clients before DbusThreadManager is | 1967 // Remove observers attached to D-Bus clients before DbusThreadManager is |
| 1971 // shut down. | 1968 // shut down. |
| 1972 process_power_collector_.reset(); | 1969 process_power_collector_.reset(); |
| 1973 | 1970 |
| 1974 webusb_detector_.reset(); | 1971 web_usb_detector_.reset(); |
| 1975 webusb_browser_client_.reset(); | |
| 1976 | 1972 |
| 1977 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 1973 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
| 1978 chrome_extra_parts_[i]->PostMainMessageLoopRun(); | 1974 chrome_extra_parts_[i]->PostMainMessageLoopRun(); |
| 1979 | 1975 |
| 1980 // Some tests don't set parameters.ui_task, so they started translate | 1976 // Some tests don't set parameters.ui_task, so they started translate |
| 1981 // language fetch that was never completed so we need to cleanup here | 1977 // language fetch that was never completed so we need to cleanup here |
| 1982 // otherwise it will be done by the destructor in a wrong thread. | 1978 // otherwise it will be done by the destructor in a wrong thread. |
| 1983 TranslateService::Shutdown(parameters().ui_task == NULL); | 1979 TranslateService::Shutdown(parameters().ui_task == NULL); |
| 1984 | 1980 |
| 1985 if (notify_result_ == ProcessSingleton::PROCESS_NONE) | 1981 if (notify_result_ == ProcessSingleton::PROCESS_NONE) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 chromeos::CrosSettings::Shutdown(); | 2034 chromeos::CrosSettings::Shutdown(); |
| 2039 #endif // defined(OS_CHROMEOS) | 2035 #endif // defined(OS_CHROMEOS) |
| 2040 #endif // defined(OS_ANDROID) | 2036 #endif // defined(OS_ANDROID) |
| 2041 } | 2037 } |
| 2042 | 2038 |
| 2043 // Public members: | 2039 // Public members: |
| 2044 | 2040 |
| 2045 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2041 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2046 chrome_extra_parts_.push_back(parts); | 2042 chrome_extra_parts_.push_back(parts); |
| 2047 } | 2043 } |
| OLD | NEW |