OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 #include "components/ownership/owner_key_util.h" | 134 #include "components/ownership/owner_key_util.h" |
135 #include "components/prefs/pref_service.h" | 135 #include "components/prefs/pref_service.h" |
136 #include "components/session_manager/core/session_manager.h" | 136 #include "components/session_manager/core/session_manager.h" |
137 #include "components/signin/core/account_id/account_id.h" | 137 #include "components/signin/core/account_id/account_id.h" |
138 #include "components/user_manager/user.h" | 138 #include "components/user_manager/user.h" |
139 #include "components/user_manager/user_manager.h" | 139 #include "components/user_manager/user_manager.h" |
140 #include "components/user_manager/user_names.h" | 140 #include "components/user_manager/user_names.h" |
141 #include "components/version_info/version_info.h" | 141 #include "components/version_info/version_info.h" |
142 #include "components/wallpaper/wallpaper_manager_base.h" | 142 #include "components/wallpaper/wallpaper_manager_base.h" |
143 #include "content/public/browser/browser_thread.h" | 143 #include "content/public/browser/browser_thread.h" |
| 144 #include "content/public/browser/media_capture_devices.h" |
144 #include "content/public/browser/notification_service.h" | 145 #include "content/public/browser/notification_service.h" |
145 #include "content/public/common/content_switches.h" | 146 #include "content/public/common/content_switches.h" |
146 #include "content/public/common/main_function_params.h" | 147 #include "content/public/common/main_function_params.h" |
147 #include "device/bluetooth/bluetooth_adapter_factory.h" | 148 #include "device/bluetooth/bluetooth_adapter_factory.h" |
148 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 149 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
149 #include "media/audio/sounds/sounds_manager.h" | 150 #include "media/audio/sounds/sounds_manager.h" |
150 #include "net/base/network_change_notifier.h" | 151 #include "net/base/network_change_notifier.h" |
151 #include "net/url_request/url_request.h" | 152 #include "net/url_request/url_request.h" |
152 #include "net/url_request/url_request_context_getter.h" | 153 #include "net/url_request/url_request_context_getter.h" |
153 #include "printing/backend/print_backend.h" | 154 #include "printing/backend/print_backend.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. | 412 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. |
412 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 413 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
413 // Set the crypto thread after the IO thread has been created/started. | 414 // Set the crypto thread after the IO thread has been created/started. |
414 TPMTokenLoader::Get()->SetCryptoTaskRunner( | 415 TPMTokenLoader::Get()->SetCryptoTaskRunner( |
415 content::BrowserThread::GetTaskRunnerForThread( | 416 content::BrowserThread::GetTaskRunnerForThread( |
416 content::BrowserThread::IO)); | 417 content::BrowserThread::IO)); |
417 | 418 |
418 CrasAudioHandler::Initialize( | 419 CrasAudioHandler::Initialize( |
419 new AudioDevicesPrefHandlerImpl(g_browser_process->local_state())); | 420 new AudioDevicesPrefHandlerImpl(g_browser_process->local_state())); |
420 | 421 |
| 422 content::MediaCaptureDevices::GetInstance()->AddVideoCaptureObserver( |
| 423 CrasAudioHandler::Get()); |
| 424 |
421 quirks::QuirksManager::Initialize( | 425 quirks::QuirksManager::Initialize( |
422 std::unique_ptr<quirks::QuirksManager::Delegate>( | 426 std::unique_ptr<quirks::QuirksManager::Delegate>( |
423 new quirks::QuirksManagerDelegateImpl()), | 427 new quirks::QuirksManagerDelegateImpl()), |
424 content::BrowserThread::GetBlockingPool(), | 428 content::BrowserThread::GetBlockingPool(), |
425 g_browser_process->local_state(), | 429 g_browser_process->local_state(), |
426 g_browser_process->system_request_context()); | 430 g_browser_process->system_request_context()); |
427 | 431 |
428 // Start loading machine statistics here. StatisticsProvider::Shutdown() | 432 // Start loading machine statistics here. StatisticsProvider::Shutdown() |
429 // will ensure that loading is aborted on early exit. | 433 // will ensure that loading is aborted on early exit. |
430 bool load_oem_statistics = !StartupUtils::IsOobeCompleted(); | 434 bool load_oem_statistics = !StartupUtils::IsOobeCompleted(); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 arc_kiosk_app_manager_.reset(); | 916 arc_kiosk_app_manager_.reset(); |
913 | 917 |
914 if (!chrome::IsRunningInMash()) | 918 if (!chrome::IsRunningInMash()) |
915 AccessibilityManager::Shutdown(); | 919 AccessibilityManager::Shutdown(); |
916 | 920 |
917 input_method::Shutdown(); | 921 input_method::Shutdown(); |
918 | 922 |
919 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. | 923 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. |
920 DeviceOAuth2TokenServiceFactory::Shutdown(); | 924 DeviceOAuth2TokenServiceFactory::Shutdown(); |
921 | 925 |
| 926 content::MediaCaptureDevices::GetInstance()->RemoveAllVideoCaptureObservers(); |
| 927 |
922 // Shutdown after PostMainMessageLoopRun() which should destroy all observers. | 928 // Shutdown after PostMainMessageLoopRun() which should destroy all observers. |
923 CrasAudioHandler::Shutdown(); | 929 CrasAudioHandler::Shutdown(); |
924 | 930 |
925 quirks::QuirksManager::Shutdown(); | 931 quirks::QuirksManager::Shutdown(); |
926 | 932 |
927 // Called after | 933 // Called after |
928 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be | 934 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be |
929 // executed after execution of chrome::CloseAsh(), because some | 935 // executed after execution of chrome::CloseAsh(), because some |
930 // parts of WebUI depends on NetworkPortalDetector. | 936 // parts of WebUI depends on NetworkPortalDetector. |
931 network_portal_detector::Shutdown(); | 937 network_portal_detector::Shutdown(); |
932 | 938 |
933 g_browser_process->platform_part()->ShutdownSessionManager(); | 939 g_browser_process->platform_part()->ShutdownSessionManager(); |
934 g_browser_process->platform_part()->DestroyChromeUserManager(); | 940 g_browser_process->platform_part()->DestroyChromeUserManager(); |
935 } | 941 } |
936 | 942 |
937 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { | 943 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { |
938 // Destroy DBus services immediately after threads are stopped. | 944 // Destroy DBus services immediately after threads are stopped. |
939 dbus_services_.reset(); | 945 dbus_services_.reset(); |
940 | 946 |
941 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 947 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
942 | 948 |
943 // Destroy DeviceSettingsService after g_browser_process. | 949 // Destroy DeviceSettingsService after g_browser_process. |
944 DeviceSettingsService::Shutdown(); | 950 DeviceSettingsService::Shutdown(); |
945 | 951 |
946 chromeos::ShutdownCloseTracking(); | 952 chromeos::ShutdownCloseTracking(); |
947 } | 953 } |
948 | 954 |
949 } // namespace chromeos | 955 } // namespace chromeos |
OLD | NEW |