| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #include "components/rlz/rlz_tracker.h" | 137 #include "components/rlz/rlz_tracker.h" |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 // Exclude X11 dependents for ozone | 140 // Exclude X11 dependents for ozone |
| 141 #if defined(USE_X11) | 141 #if defined(USE_X11) |
| 142 #include "chrome/browser/chromeos/device_uma.h" | 142 #include "chrome/browser/chromeos/device_uma.h" |
| 143 #include "chrome/browser/chromeos/events/system_key_event_listener.h" | 143 #include "chrome/browser/chromeos/events/system_key_event_listener.h" |
| 144 #include "chrome/browser/chromeos/events/xinput_hierarchy_changed_event_listener
.h" | 144 #include "chrome/browser/chromeos/events/xinput_hierarchy_changed_event_listener
.h" |
| 145 #endif | 145 #endif |
| 146 | 146 |
| 147 #if defined(ENABLE_ARC) |
| 148 #include "components/arc/arc_bridge_service.h" |
| 149 #endif |
| 150 |
| 147 namespace chromeos { | 151 namespace chromeos { |
| 148 | 152 |
| 149 namespace { | 153 namespace { |
| 150 | 154 |
| 151 void ChromeOSVersionCallback(const std::string& version) { | 155 void ChromeOSVersionCallback(const std::string& version) { |
| 152 base::SetLinuxDistro(std::string("CrOS ") + version); | 156 base::SetLinuxDistro(std::string("CrOS ") + version); |
| 153 } | 157 } |
| 154 | 158 |
| 155 bool ShouldAutoLaunchKioskApp(const base::CommandLine& command_line) { | 159 bool ShouldAutoLaunchKioskApp(const base::CommandLine& command_line) { |
| 156 KioskAppManager* app_manager = KioskAppManager::Get(); | 160 KioskAppManager* app_manager = KioskAppManager::Get(); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 content::BrowserThread::FILE), | 383 content::BrowserThread::FILE), |
| 380 load_oem_statistics); | 384 load_oem_statistics); |
| 381 | 385 |
| 382 base::FilePath downloads_directory; | 386 base::FilePath downloads_directory; |
| 383 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); | 387 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); |
| 384 | 388 |
| 385 DeviceOAuth2TokenServiceFactory::Initialize(); | 389 DeviceOAuth2TokenServiceFactory::Initialize(); |
| 386 | 390 |
| 387 wake_on_wifi_manager_.reset(new WakeOnWifiManager()); | 391 wake_on_wifi_manager_.reset(new WakeOnWifiManager()); |
| 388 | 392 |
| 393 #if defined(ENABLE_ARC) |
| 394 arc_bridge_service_.reset(new arc::ArcBridgeService( |
| 395 content::BrowserThread::GetMessageLoopProxyForThread( |
| 396 content::BrowserThread::IO), |
| 397 content::BrowserThread::GetMessageLoopProxyForThread( |
| 398 content::BrowserThread::FILE))); |
| 399 arc_bridge_service_->DetectAvailability(); |
| 400 #endif |
| 401 |
| 389 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 402 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
| 390 } | 403 } |
| 391 | 404 |
| 392 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 405 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
| 393 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 406 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 394 // -- immediately before Profile creation(). | 407 // -- immediately before Profile creation(). |
| 395 | 408 |
| 396 // Now that the file thread exists we can record our stats. | 409 // Now that the file thread exists we can record our stats. |
| 397 BootTimesRecorder::Get()->RecordChromeMainStats(); | 410 BootTimesRecorder::Get()->RecordChromeMainStats(); |
| 398 LoginEventRecorder::Get()->SetDelegate(BootTimesRecorder::Get()); | 411 LoginEventRecorder::Get()->SetDelegate(BootTimesRecorder::Get()); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 new EventRewriter(ash::Shell::GetInstance()->sticky_keys_controller()))); | 705 new EventRewriter(ash::Shell::GetInstance()->sticky_keys_controller()))); |
| 693 keyboard_event_rewriters_->Init(); | 706 keyboard_event_rewriters_->Init(); |
| 694 | 707 |
| 695 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 708 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
| 696 } | 709 } |
| 697 | 710 |
| 698 // Shut down services before the browser process, etc are destroyed. | 711 // Shut down services before the browser process, etc are destroyed. |
| 699 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { | 712 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { |
| 700 BootTimesRecorder::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); | 713 BootTimesRecorder::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); |
| 701 | 714 |
| 715 #if defined(ENABLE_ARC) |
| 716 arc_bridge_service_->Shutdown(); |
| 717 #endif |
| 718 |
| 702 // Destroy the application name notifier for Kiosk mode. | 719 // Destroy the application name notifier for Kiosk mode. |
| 703 KioskModeIdleAppNameNotification::Shutdown(); | 720 KioskModeIdleAppNameNotification::Shutdown(); |
| 704 | 721 |
| 705 // Shutdown the upgrade detector for Chrome OS. The upgrade detector | 722 // Shutdown the upgrade detector for Chrome OS. The upgrade detector |
| 706 // stops monitoring changes from the update engine. | 723 // stops monitoring changes from the update engine. |
| 707 if (UpgradeDetectorChromeos::GetInstance()) | 724 if (UpgradeDetectorChromeos::GetInstance()) |
| 708 UpgradeDetectorChromeos::GetInstance()->Shutdown(); | 725 UpgradeDetectorChromeos::GetInstance()->Shutdown(); |
| 709 | 726 |
| 710 // Shutdown the network change notifier for Chrome OS. The network | 727 // Shutdown the network change notifier for Chrome OS. The network |
| 711 // change notifier stops monitoring changes from the power manager and | 728 // change notifier stops monitoring changes from the power manager and |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 // Destroy DBus services immediately after threads are stopped. | 825 // Destroy DBus services immediately after threads are stopped. |
| 809 dbus_services_.reset(); | 826 dbus_services_.reset(); |
| 810 | 827 |
| 811 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 828 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 812 | 829 |
| 813 // Destroy DeviceSettingsService after g_browser_process. | 830 // Destroy DeviceSettingsService after g_browser_process. |
| 814 DeviceSettingsService::Shutdown(); | 831 DeviceSettingsService::Shutdown(); |
| 815 } | 832 } |
| 816 | 833 |
| 817 } // namespace chromeos | 834 } // namespace chromeos |
| OLD | NEW |