| 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" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/chromeos/chromeos_version.h" | 14 #include "base/chromeos/chromeos_version.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
| 18 #include "base/linux_util.h" | 18 #include "base/linux_util.h" |
| 19 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
| 22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 24 #include "base/time/default_tick_clock.h" | |
| 25 #include "base/time/tick_clock.h" | |
| 26 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 25 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 27 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 28 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
| 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" | 29 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" |
| 32 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 33 #include "chrome/browser/chromeos/audio/audio_handler.h" | 31 #include "chrome/browser/chromeos/audio/audio_handler.h" |
| 34 #include "chrome/browser/chromeos/boot_times_loader.h" | 32 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 35 #include "chrome/browser/chromeos/contacts/contact_manager.h" | 33 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 65 #include "chrome/browser/chromeos/power/resume_observer.h" | 63 #include "chrome/browser/chromeos/power/resume_observer.h" |
| 66 #include "chrome/browser/chromeos/power/screen_lock_observer.h" | 64 #include "chrome/browser/chromeos/power/screen_lock_observer.h" |
| 67 #include "chrome/browser/chromeos/power/suspend_observer.h" | 65 #include "chrome/browser/chromeos/power/suspend_observer.h" |
| 68 #include "chrome/browser/chromeos/power/user_activity_notifier.h" | 66 #include "chrome/browser/chromeos/power/user_activity_notifier.h" |
| 69 #include "chrome/browser/chromeos/power/video_activity_notifier.h" | 67 #include "chrome/browser/chromeos/power/video_activity_notifier.h" |
| 70 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 68 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 71 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" | 69 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" |
| 72 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 70 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
| 73 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 71 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 74 #include "chrome/browser/chromeos/settings/owner_key_util.h" | 72 #include "chrome/browser/chromeos/settings/owner_key_util.h" |
| 75 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" | |
| 76 #include "chrome/browser/chromeos/system/device_change_handler.h" | 73 #include "chrome/browser/chromeos/system/device_change_handler.h" |
| 77 #include "chrome/browser/chromeos/system/statistics_provider.h" | 74 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 78 #include "chrome/browser/chromeos/system_key_event_listener.h" | 75 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 79 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 76 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
| 80 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 77 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
| 81 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 78 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
| 82 #include "chrome/browser/defaults.h" | 79 #include "chrome/browser/defaults.h" |
| 83 #include "chrome/browser/metrics/metrics_service.h" | 80 #include "chrome/browser/metrics/metrics_service.h" |
| 84 #include "chrome/browser/net/chrome_network_delegate.h" | 81 #include "chrome/browser/net/chrome_network_delegate.h" |
| 85 #include "chrome/browser/policy/browser_policy_connector.h" | 82 #include "chrome/browser/policy/browser_policy_connector.h" |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 #endif | 689 #endif |
| 693 // Enable portal detector if EULA was previously accepted or if | 690 // Enable portal detector if EULA was previously accepted or if |
| 694 // this is an unofficial build. | 691 // this is an unofficial build. |
| 695 if (!is_official_build || StartupUtils::IsEulaAccepted()) | 692 if (!is_official_build || StartupUtils::IsEulaAccepted()) |
| 696 detector->Enable(true); | 693 detector->Enable(true); |
| 697 } | 694 } |
| 698 | 695 |
| 699 display_configuration_observer_.reset( | 696 display_configuration_observer_.reset( |
| 700 new DisplayConfigurationObserver()); | 697 new DisplayConfigurationObserver()); |
| 701 | 698 |
| 702 automatic_reboot_manager_.reset(new system::AutomaticRebootManager( | 699 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); |
| 703 scoped_ptr<base::TickClock>(new base::DefaultTickClock))); | |
| 704 | 700 |
| 705 // This observer cannot be created earlier because it requires the shell to be | 701 // This observer cannot be created earlier because it requires the shell to be |
| 706 // available. | 702 // available. |
| 707 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 703 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); |
| 708 | 704 |
| 709 // Listen to changes in device hierarchy. | 705 // Listen to changes in device hierarchy. |
| 710 device_change_handler_.reset(new system::DeviceChangeHandler()); | 706 device_change_handler_.reset(new system::DeviceChangeHandler()); |
| 711 | 707 |
| 712 ChromeBrowserMainPartsLinux::PostProfileInit(); | 708 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 713 } | 709 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 MagnificationManager::Shutdown(); | 830 MagnificationManager::Shutdown(); |
| 835 AccessibilityManager::Shutdown(); | 831 AccessibilityManager::Shutdown(); |
| 836 | 832 |
| 837 // Let the UserManager and WallpaperManager unregister itself as an observer | 833 // Let the UserManager and WallpaperManager unregister itself as an observer |
| 838 // of the CrosSettings singleton before it is destroyed. | 834 // of the CrosSettings singleton before it is destroyed. |
| 839 UserManager::Get()->Shutdown(); | 835 UserManager::Get()->Shutdown(); |
| 840 WallpaperManager::Get()->Shutdown(); | 836 WallpaperManager::Get()->Shutdown(); |
| 841 | 837 |
| 842 // Let the AutomaticRebootManager unregister itself as an observer of several | 838 // Let the AutomaticRebootManager unregister itself as an observer of several |
| 843 // subsystems. | 839 // subsystems. |
| 844 automatic_reboot_manager_.reset(); | 840 g_browser_process->platform_part()->ShutdownAutomaticRebootManager(); |
| 845 | 841 |
| 846 // Clean up dependency on CrosSettings and stop pending data fetches. | 842 // Clean up dependency on CrosSettings and stop pending data fetches. |
| 847 KioskAppManager::Shutdown(); | 843 KioskAppManager::Shutdown(); |
| 848 | 844 |
| 849 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 845 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 850 | 846 |
| 851 // Destroy the UserManager after ash has been destroyed and | 847 // Destroy the UserManager after ash has been destroyed and |
| 852 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun run. The latter might | 848 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun run. The latter might |
| 853 // trigger MergeSessionThrottle::ShouldShowMergeSessionPage, which requires | 849 // trigger MergeSessionThrottle::ShouldShowMergeSessionPage, which requires |
| 854 // the UserManager to exist. | 850 // the UserManager to exist. |
| 855 UserManager::Destroy(); | 851 UserManager::Destroy(); |
| 856 } | 852 } |
| 857 | 853 |
| 858 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { | 854 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { |
| 859 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 855 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 860 // Destroy DeviceSettingsService after g_browser_process. | 856 // Destroy DeviceSettingsService after g_browser_process. |
| 861 DeviceSettingsService::Shutdown(); | 857 DeviceSettingsService::Shutdown(); |
| 862 } | 858 } |
| 863 | 859 |
| 864 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 860 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
| 865 default_pinned_apps_field_trial::SetupTrial(); | 861 default_pinned_apps_field_trial::SetupTrial(); |
| 866 } | 862 } |
| 867 | 863 |
| 868 } // namespace chromeos | 864 } // namespace chromeos |
| OLD | NEW |