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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 #endif | 139 #endif |
140 | 140 |
141 // Exclude X11 dependents for ozone | 141 // Exclude X11 dependents for ozone |
142 #if defined(USE_X11) | 142 #if defined(USE_X11) |
143 #include "chrome/browser/chromeos/device_uma.h" | 143 #include "chrome/browser/chromeos/device_uma.h" |
144 #include "chrome/browser/chromeos/events/system_key_event_listener.h" | 144 #include "chrome/browser/chromeos/events/system_key_event_listener.h" |
145 #include "chrome/browser/chromeos/events/xinput_hierarchy_changed_event_listener
.h" | 145 #include "chrome/browser/chromeos/events/xinput_hierarchy_changed_event_listener
.h" |
146 #endif | 146 #endif |
147 | 147 |
148 #include "components/arc/arc_bridge_service.h" | 148 #include "components/arc/arc_bridge_service.h" |
| 149 #include "components/arc/arc_service_manager.h" |
149 | 150 |
150 namespace chromeos { | 151 namespace chromeos { |
151 | 152 |
152 namespace { | 153 namespace { |
153 | 154 |
154 void ChromeOSVersionCallback(const std::string& version) { | 155 void ChromeOSVersionCallback(const std::string& version) { |
155 base::SetLinuxDistro(std::string("CrOS ") + version); | 156 base::SetLinuxDistro(std::string("CrOS ") + version); |
156 } | 157 } |
157 | 158 |
158 bool ShouldAutoLaunchKioskApp(const base::CommandLine& command_line) { | 159 bool ShouldAutoLaunchKioskApp(const base::CommandLine& command_line) { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 content::BrowserThread::FILE), | 383 content::BrowserThread::FILE), |
383 load_oem_statistics); | 384 load_oem_statistics); |
384 | 385 |
385 base::FilePath downloads_directory; | 386 base::FilePath downloads_directory; |
386 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); | 387 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); |
387 | 388 |
388 DeviceOAuth2TokenServiceFactory::Initialize(); | 389 DeviceOAuth2TokenServiceFactory::Initialize(); |
389 | 390 |
390 wake_on_wifi_manager_.reset(new WakeOnWifiManager()); | 391 wake_on_wifi_manager_.reset(new WakeOnWifiManager()); |
391 | 392 |
392 arc_bridge_service_ = arc::ArcBridgeService::Create( | 393 arc_service_manager_.reset(new arc::ArcServiceManager( |
393 content::BrowserThread::GetMessageLoopProxyForThread( | 394 content::BrowserThread::GetMessageLoopProxyForThread( |
394 content::BrowserThread::IO), | 395 content::BrowserThread::IO), |
395 content::BrowserThread::GetMessageLoopProxyForThread( | 396 content::BrowserThread::GetMessageLoopProxyForThread( |
396 content::BrowserThread::FILE)); | 397 content::BrowserThread::FILE))); |
397 arc_bridge_service_->DetectAvailability(); | 398 arc_service_manager_->arc_bridge_service()->DetectAvailability(); |
398 | 399 |
399 chromeos::ResourceReporter::GetInstance()->StartMonitoring(); | 400 chromeos::ResourceReporter::GetInstance()->StartMonitoring(); |
400 | 401 |
401 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 402 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
402 } | 403 } |
403 | 404 |
404 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 405 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
405 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 406 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
406 // -- immediately before Profile creation(). | 407 // -- immediately before Profile creation(). |
407 | 408 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 | 707 |
707 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 708 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
708 } | 709 } |
709 | 710 |
710 // Shut down services before the browser process, etc are destroyed. | 711 // Shut down services before the browser process, etc are destroyed. |
711 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { | 712 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { |
712 chromeos::ResourceReporter::GetInstance()->StopMonitoring(); | 713 chromeos::ResourceReporter::GetInstance()->StopMonitoring(); |
713 | 714 |
714 BootTimesRecorder::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); | 715 BootTimesRecorder::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); |
715 | 716 |
716 arc_bridge_service_->Shutdown(); | 717 arc_service_manager_->arc_bridge_service()->Shutdown(); |
717 | 718 |
718 // Destroy the application name notifier for Kiosk mode. | 719 // Destroy the application name notifier for Kiosk mode. |
719 KioskModeIdleAppNameNotification::Shutdown(); | 720 KioskModeIdleAppNameNotification::Shutdown(); |
720 | 721 |
721 // Shutdown the upgrade detector for Chrome OS. The upgrade detector | 722 // Shutdown the upgrade detector for Chrome OS. The upgrade detector |
722 // stops monitoring changes from the update engine. | 723 // stops monitoring changes from the update engine. |
723 if (UpgradeDetectorChromeos::GetInstance()) | 724 if (UpgradeDetectorChromeos::GetInstance()) |
724 UpgradeDetectorChromeos::GetInstance()->Shutdown(); | 725 UpgradeDetectorChromeos::GetInstance()->Shutdown(); |
725 | 726 |
726 // Shutdown the network change notifier for Chrome OS. The network | 727 // Shutdown the network change notifier for Chrome OS. The network |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 // Destroy DBus services immediately after threads are stopped. | 825 // Destroy DBus services immediately after threads are stopped. |
825 dbus_services_.reset(); | 826 dbus_services_.reset(); |
826 | 827 |
827 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 828 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
828 | 829 |
829 // Destroy DeviceSettingsService after g_browser_process. | 830 // Destroy DeviceSettingsService after g_browser_process. |
830 DeviceSettingsService::Shutdown(); | 831 DeviceSettingsService::Shutdown(); |
831 } | 832 } |
832 | 833 |
833 } // namespace chromeos | 834 } // namespace chromeos |
OLD | NEW |