Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 54 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 55 #include "chrome/browser/chromeos/login/login_wizard.h" | 55 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 56 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" | 56 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
| 57 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 57 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 58 #include "chrome/browser/chromeos/login/startup_utils.h" | 58 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 59 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 59 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 60 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 60 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 61 #include "chrome/browser/chromeos/login/wizard_controller.h" | 61 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 62 #include "chrome/browser/chromeos/net/network_connect_delegate_chromeos.h" | 62 #include "chrome/browser/chromeos/net/network_connect_delegate_chromeos.h" |
| 63 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" | 63 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" |
| 64 #include "chrome/browser/chromeos/net/network_pref_state_observer.h" | |
| 64 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" | 65 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" |
| 65 #include "chrome/browser/chromeos/options/cert_library.h" | 66 #include "chrome/browser/chromeos/options/cert_library.h" |
| 66 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact ory.h" | 67 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact ory.h" |
| 67 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 68 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 68 #include "chrome/browser/chromeos/policy/device_local_account.h" | 69 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 69 #include "chrome/browser/chromeos/power/freezer_cgroup_process_manager.h" | 70 #include "chrome/browser/chromeos/power/freezer_cgroup_process_manager.h" |
| 70 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" | 71 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" |
| 71 #include "chrome/browser/chromeos/power/login_lock_state_notifier.h" | 72 #include "chrome/browser/chromeos/power/login_lock_state_notifier.h" |
| 72 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 73 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
| 73 #include "chrome/browser/chromeos/power/power_data_collector.h" | 74 #include "chrome/browser/chromeos/power/power_data_collector.h" |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 683 | 684 |
| 684 // 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 |
| 685 // available. | 686 // available. |
| 686 idle_action_warning_observer_ = base::MakeUnique<IdleActionWarningObserver>(); | 687 idle_action_warning_observer_ = base::MakeUnique<IdleActionWarningObserver>(); |
| 687 | 688 |
| 688 // 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 |
| 689 // guest profile. | 690 // guest profile. |
| 690 if (!user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 691 if (!user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
| 691 low_disk_notification_ = base::MakeUnique<LowDiskNotification>(); | 692 low_disk_notification_ = base::MakeUnique<LowDiskNotification>(); |
| 692 | 693 |
| 694 // Initialize a observer to update NetworkHandler's pref based services. | |
| 695 network_pref_state_observer_.reset(new NetworkPrefStateObserver); | |
|
James Cook
2016/11/01 23:02:03
nit: Does this have to be here, or can it live up
stevenjb
2016/11/01 23:55:11
Moved near portal detection which should be fine.
| |
| 696 | |
| 693 ChromeBrowserMainPartsLinux::PostProfileInit(); | 697 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 694 } | 698 } |
| 695 | 699 |
| 696 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { | 700 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { |
| 697 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 701 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 698 // -- just before MetricsService::LogNeedForCleanShutdown(). | 702 // -- just before MetricsService::LogNeedForCleanShutdown(). |
| 699 | 703 |
| 700 // Start the external metrics service, which collects metrics from Chrome OS | 704 // Start the external metrics service, which collects metrics from Chrome OS |
| 701 // and passes them to the browser process. | 705 // and passes them to the browser process. |
| 702 external_metrics_ = new chromeos::ExternalMetrics; | 706 external_metrics_ = new chromeos::ExternalMetrics; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 // shutdown DeviceSettingsService yet, it might still be accessed by | 796 // shutdown DeviceSettingsService yet, it might still be accessed by |
| 793 // BrowserPolicyConnector (owned by g_browser_process). | 797 // BrowserPolicyConnector (owned by g_browser_process). |
| 794 DeviceSettingsService::Get()->UnsetSessionManager(); | 798 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 795 | 799 |
| 796 // We should remove observers attached to D-Bus clients before | 800 // We should remove observers attached to D-Bus clients before |
| 797 // DBusThreadManager is shut down. | 801 // DBusThreadManager is shut down. |
| 798 extension_volume_observer_.reset(); | 802 extension_volume_observer_.reset(); |
| 799 peripheral_battery_observer_.reset(); | 803 peripheral_battery_observer_.reset(); |
| 800 power_prefs_.reset(); | 804 power_prefs_.reset(); |
| 801 renderer_freezer_.reset(); | 805 renderer_freezer_.reset(); |
| 806 network_pref_state_observer_.reset(); | |
|
James Cook
2016/11/01 23:02:03
Could this be reset a few lines earlier, like abov
stevenjb
2016/11/01 23:55:11
Moved.
| |
| 802 wake_on_wifi_manager_.reset(); | 807 wake_on_wifi_manager_.reset(); |
| 803 ScreenLocker::ShutDownClass(); | 808 ScreenLocker::ShutDownClass(); |
| 804 keyboard_event_rewriters_.reset(); | 809 keyboard_event_rewriters_.reset(); |
| 805 low_disk_notification_.reset(); | 810 low_disk_notification_.reset(); |
| 806 #if defined(USE_X11) | 811 #if defined(USE_X11) |
| 807 if (!chrome::IsRunningInMash()) { | 812 if (!chrome::IsRunningInMash()) { |
| 808 // The XInput2 event listener needs to be shut down earlier than when | 813 // The XInput2 event listener needs to be shut down earlier than when |
| 809 // Singletons are finally destroyed in AtExitManager. | 814 // Singletons are finally destroyed in AtExitManager. |
| 810 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 815 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 811 | 816 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 886 // Destroy DBus services immediately after threads are stopped. | 891 // Destroy DBus services immediately after threads are stopped. |
| 887 dbus_services_.reset(); | 892 dbus_services_.reset(); |
| 888 | 893 |
| 889 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 894 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 890 | 895 |
| 891 // Destroy DeviceSettingsService after g_browser_process. | 896 // Destroy DeviceSettingsService after g_browser_process. |
| 892 DeviceSettingsService::Shutdown(); | 897 DeviceSettingsService::Shutdown(); |
| 893 } | 898 } |
| 894 | 899 |
| 895 } // namespace chromeos | 900 } // namespace chromeos |
| OLD | NEW |