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 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.
h" | 38 #include "chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.
h" |
39 #include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_del
egate.h" | 39 #include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_del
egate.h" |
40 #include "chrome/browser/chromeos/dbus/chrome_proxy_resolver_delegate.h" | 40 #include "chrome/browser/chromeos/dbus/chrome_proxy_resolver_delegate.h" |
41 #include "chrome/browser/chromeos/dbus/kiosk_info_service_provider.h" | 41 #include "chrome/browser/chromeos/dbus/kiosk_info_service_provider.h" |
42 #include "chrome/browser/chromeos/dbus/screen_lock_service_provider.h" | 42 #include "chrome/browser/chromeos/dbus/screen_lock_service_provider.h" |
43 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" | 43 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" |
44 #include "chrome/browser/chromeos/events/event_rewriter.h" | 44 #include "chrome/browser/chromeos/events/event_rewriter.h" |
45 #include "chrome/browser/chromeos/events/event_rewriter_controller.h" | 45 #include "chrome/browser/chromeos/events/event_rewriter_controller.h" |
46 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" | 46 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" |
47 #include "chrome/browser/chromeos/extensions/default_app_order.h" | 47 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
| 48 #include "chrome/browser/chromeos/extensions/extension_volume_observer.h" |
48 #include "chrome/browser/chromeos/external_metrics.h" | 49 #include "chrome/browser/chromeos/external_metrics.h" |
49 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 50 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
50 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 51 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
51 #include "chrome/browser/chromeos/language_preferences.h" | 52 #include "chrome/browser/chromeos/language_preferences.h" |
52 #include "chrome/browser/chromeos/login/helper.h" | 53 #include "chrome/browser/chromeos/login/helper.h" |
53 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 54 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
54 #include "chrome/browser/chromeos/login/login_wizard.h" | 55 #include "chrome/browser/chromeos/login/login_wizard.h" |
55 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" | 56 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" |
56 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" | 57 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" |
57 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 58 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 bool is_running_test = parameters().ui_task != nullptr; | 664 bool is_running_test = parameters().ui_task != nullptr; |
664 g_browser_process->platform_part()->InitializeSessionManager( | 665 g_browser_process->platform_part()->InitializeSessionManager( |
665 parsed_command_line(), profile(), is_running_test); | 666 parsed_command_line(), profile(), is_running_test); |
666 g_browser_process->platform_part()->SessionManager()->Start(); | 667 g_browser_process->platform_part()->SessionManager()->Start(); |
667 | 668 |
668 // Guest user profile is never initialized with locale settings, | 669 // Guest user profile is never initialized with locale settings, |
669 // so we need special handling for Guest session. | 670 // so we need special handling for Guest session. |
670 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 671 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
671 SetGuestLocale(profile()); | 672 SetGuestLocale(profile()); |
672 | 673 |
673 peripheral_battery_observer_.reset(new PeripheralBatteryObserver()); | 674 // This observer uses the intialized profile to dispatch extension events. |
| 675 extension_volume_observer_ = base::MakeUnique<ExtensionVolumeObserver>(); |
674 | 676 |
675 renderer_freezer_.reset( | 677 peripheral_battery_observer_ = base::MakeUnique<PeripheralBatteryObserver>(); |
676 new RendererFreezer(std::unique_ptr<RendererFreezer::Delegate>( | 678 |
677 new FreezerCgroupProcessManager()))); | 679 renderer_freezer_ = base::MakeUnique<RendererFreezer>( |
| 680 base::MakeUnique<FreezerCgroupProcessManager>()); |
678 | 681 |
679 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); | 682 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); |
680 g_browser_process->platform_part()->InitializeDeviceDisablingManager(); | 683 g_browser_process->platform_part()->InitializeDeviceDisablingManager(); |
681 | 684 |
682 // This observer cannot be created earlier because it requires the shell to be | 685 // This observer cannot be created earlier because it requires the shell to be |
683 // available. | 686 // available. |
684 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 687 idle_action_warning_observer_ = base::MakeUnique<IdleActionWarningObserver>(); |
685 | 688 |
686 // Start watching for low disk space events to notify the user if it is not a | 689 // Start watching for low disk space events to notify the user if it is not a |
687 // guest profile. | 690 // guest profile. |
688 if (!user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 691 if (!user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
689 low_disk_notification_.reset(new LowDiskNotification()); | 692 low_disk_notification_ = base::MakeUnique<LowDiskNotification>(); |
690 | 693 |
691 // Authenticate the user for PIN quick unlock. | 694 // Authenticate the user for PIN quick unlock. |
692 PinStorage* pin_storage = PinStorageFactory::GetForProfile(profile()); | 695 PinStorage* pin_storage = PinStorageFactory::GetForProfile(profile()); |
693 if (pin_storage) | 696 if (pin_storage) |
694 pin_storage->MarkStrongAuth(); | 697 pin_storage->MarkStrongAuth(); |
695 | 698 |
696 ChromeBrowserMainPartsLinux::PostProfileInit(); | 699 ChromeBrowserMainPartsLinux::PostProfileInit(); |
697 } | 700 } |
698 | 701 |
699 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { | 702 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 // depend on. | 794 // depend on. |
792 data_promo_notification_.reset(); | 795 data_promo_notification_.reset(); |
793 | 796 |
794 // Tell DeviceSettingsService to stop talking to session_manager. Do not | 797 // Tell DeviceSettingsService to stop talking to session_manager. Do not |
795 // shutdown DeviceSettingsService yet, it might still be accessed by | 798 // shutdown DeviceSettingsService yet, it might still be accessed by |
796 // BrowserPolicyConnector (owned by g_browser_process). | 799 // BrowserPolicyConnector (owned by g_browser_process). |
797 DeviceSettingsService::Get()->UnsetSessionManager(); | 800 DeviceSettingsService::Get()->UnsetSessionManager(); |
798 | 801 |
799 // We should remove observers attached to D-Bus clients before | 802 // We should remove observers attached to D-Bus clients before |
800 // DBusThreadManager is shut down. | 803 // DBusThreadManager is shut down. |
| 804 extension_volume_observer_.reset(); |
801 peripheral_battery_observer_.reset(); | 805 peripheral_battery_observer_.reset(); |
802 power_prefs_.reset(); | 806 power_prefs_.reset(); |
803 renderer_freezer_.reset(); | 807 renderer_freezer_.reset(); |
804 wake_on_wifi_manager_.reset(); | 808 wake_on_wifi_manager_.reset(); |
805 ScreenLocker::ShutDownClass(); | 809 ScreenLocker::ShutDownClass(); |
806 keyboard_event_rewriters_.reset(); | 810 keyboard_event_rewriters_.reset(); |
807 low_disk_notification_.reset(); | 811 low_disk_notification_.reset(); |
808 #if defined(USE_X11) | 812 #if defined(USE_X11) |
809 if (!chrome::IsRunningInMash()) { | 813 if (!chrome::IsRunningInMash()) { |
810 // The XInput2 event listener needs to be shut down earlier than when | 814 // The XInput2 event listener needs to be shut down earlier than when |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 // Destroy DBus services immediately after threads are stopped. | 893 // Destroy DBus services immediately after threads are stopped. |
890 dbus_services_.reset(); | 894 dbus_services_.reset(); |
891 | 895 |
892 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 896 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
893 | 897 |
894 // Destroy DeviceSettingsService after g_browser_process. | 898 // Destroy DeviceSettingsService after g_browser_process. |
895 DeviceSettingsService::Shutdown(); | 899 DeviceSettingsService::Shutdown(); |
896 } | 900 } |
897 | 901 |
898 } // namespace chromeos | 902 } // namespace chromeos |
OLD | NEW |