| 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 #endif | 681 #endif |
| 685 // Enable portal detector if EULA was previously accepted or if | 682 // Enable portal detector if EULA was previously accepted or if |
| 686 // this is an unofficial build. | 683 // this is an unofficial build. |
| 687 if (!is_official_build || StartupUtils::IsEulaAccepted()) | 684 if (!is_official_build || StartupUtils::IsEulaAccepted()) |
| 688 detector->Enable(true); | 685 detector->Enable(true); |
| 689 } | 686 } |
| 690 | 687 |
| 691 display_configuration_observer_.reset( | 688 display_configuration_observer_.reset( |
| 692 new DisplayConfigurationObserver()); | 689 new DisplayConfigurationObserver()); |
| 693 | 690 |
| 694 automatic_reboot_manager_.reset(new system::AutomaticRebootManager( | 691 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); |
| 695 scoped_ptr<base::TickClock>(new base::DefaultTickClock))); | |
| 696 | 692 |
| 697 // This observer cannot be created earlier because it requires the shell to be | 693 // This observer cannot be created earlier because it requires the shell to be |
| 698 // available. | 694 // available. |
| 699 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 695 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); |
| 700 | 696 |
| 701 // Listen to changes in device hierarchy. | 697 // Listen to changes in device hierarchy. |
| 702 device_change_handler_.reset(new system::DeviceChangeHandler()); | 698 device_change_handler_.reset(new system::DeviceChangeHandler()); |
| 703 | 699 |
| 704 ChromeBrowserMainPartsLinux::PostProfileInit(); | 700 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 705 } | 701 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 MagnificationManager::Shutdown(); | 812 MagnificationManager::Shutdown(); |
| 817 AccessibilityManager::Shutdown(); | 813 AccessibilityManager::Shutdown(); |
| 818 | 814 |
| 819 // Let the UserManager and WallpaperManager unregister itself as an observer | 815 // Let the UserManager and WallpaperManager unregister itself as an observer |
| 820 // of the CrosSettings singleton before it is destroyed. | 816 // of the CrosSettings singleton before it is destroyed. |
| 821 UserManager::Get()->Shutdown(); | 817 UserManager::Get()->Shutdown(); |
| 822 WallpaperManager::Get()->Shutdown(); | 818 WallpaperManager::Get()->Shutdown(); |
| 823 | 819 |
| 824 // Let the AutomaticRebootManager unregister itself as an observer of several | 820 // Let the AutomaticRebootManager unregister itself as an observer of several |
| 825 // subsystems. | 821 // subsystems. |
| 826 automatic_reboot_manager_.reset(); | 822 g_browser_process->platform_part()->ShutdownAutomaticRebootManager(); |
| 827 | 823 |
| 828 // Clean up dependency on CrosSettings and stop pending data fetches. | 824 // Clean up dependency on CrosSettings and stop pending data fetches. |
| 829 KioskAppManager::Shutdown(); | 825 KioskAppManager::Shutdown(); |
| 830 | 826 |
| 831 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 827 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 832 | 828 |
| 833 // Destroy the UserManager after ash has been destroyed and | 829 // Destroy the UserManager after ash has been destroyed and |
| 834 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun run. The latter might | 830 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun run. The latter might |
| 835 // trigger MergeSessionThrottle::ShouldShowMergeSessionPage, which requires | 831 // trigger MergeSessionThrottle::ShouldShowMergeSessionPage, which requires |
| 836 // the UserManager to exist. | 832 // the UserManager to exist. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 882 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
| 887 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 883 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
| 888 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 884 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
| 889 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 885 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
| 890 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 886 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
| 891 // This is necessary to start the experiment as a side effect. | 887 // This is necessary to start the experiment as a side effect. |
| 892 trial->group(); | 888 trial->group(); |
| 893 } | 889 } |
| 894 | 890 |
| 895 } // namespace chromeos | 891 } // namespace chromeos |
| OLD | NEW |