| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "chrome/browser/chromeos/power/power_button_observer.h" | 70 #include "chrome/browser/chromeos/power/power_button_observer.h" |
| 71 #include "chrome/browser/chromeos/power/power_data_collector.h" | 71 #include "chrome/browser/chromeos/power/power_data_collector.h" |
| 72 #include "chrome/browser/chromeos/power/power_prefs.h" | 72 #include "chrome/browser/chromeos/power/power_prefs.h" |
| 73 #include "chrome/browser/chromeos/power/renderer_freezer.h" | 73 #include "chrome/browser/chromeos/power/renderer_freezer.h" |
| 74 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 74 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 75 #include "chrome/browser/chromeos/resource_reporter/resource_reporter.h" | 75 #include "chrome/browser/chromeos/resource_reporter/resource_reporter.h" |
| 76 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 76 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
| 77 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 77 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 78 #include "chrome/browser/chromeos/status/data_promo_notification.h" | 78 #include "chrome/browser/chromeos/status/data_promo_notification.h" |
| 79 #include "chrome/browser/chromeos/system/input_device_settings.h" | 79 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 80 #include "chrome/browser/chromeos/ui/low_disk_notification.h" |
| 80 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 81 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
| 81 #include "chrome/browser/defaults.h" | 82 #include "chrome/browser/defaults.h" |
| 82 #include "chrome/browser/lifetime/application_lifetime.h" | 83 #include "chrome/browser/lifetime/application_lifetime.h" |
| 83 #include "chrome/browser/net/chrome_network_delegate.h" | 84 #include "chrome/browser/net/chrome_network_delegate.h" |
| 84 #include "chrome/browser/profiles/profile.h" | 85 #include "chrome/browser/profiles/profile.h" |
| 85 #include "chrome/browser/profiles/profile_manager.h" | 86 #include "chrome/browser/profiles/profile_manager.h" |
| 86 #include "chrome/browser/ui/ash/ash_util.h" | 87 #include "chrome/browser/ui/ash/ash_util.h" |
| 87 #include "chrome/browser/ui/ash/network_connect_delegate_chromeos.h" | 88 #include "chrome/browser/ui/ash/network_connect_delegate_chromeos.h" |
| 88 #include "chrome/common/channel_info.h" | 89 #include "chrome/common/channel_info.h" |
| 89 #include "chrome/common/chrome_constants.h" | 90 #include "chrome/common/chrome_constants.h" |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 679 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); |
| 679 | 680 |
| 680 // Tell the window manager observer to monitor window manager changes. To do | 681 // Tell the window manager observer to monitor window manager changes. To do |
| 681 // so, the ash::shell needs to be available (which it is now). | 682 // so, the ash::shell needs to be available (which it is now). |
| 682 if (arc::ArcBridgeService::GetEnabled( | 683 if (arc::ArcBridgeService::GetEnabled( |
| 683 base::CommandLine::ForCurrentProcess())) { | 684 base::CommandLine::ForCurrentProcess())) { |
| 684 DCHECK(arc::ArcServiceManager::Get()); | 685 DCHECK(arc::ArcServiceManager::Get()); |
| 685 arc::ArcServiceManager::Get()->OnAshStarted(); | 686 arc::ArcServiceManager::Get()->OnAshStarted(); |
| 686 } | 687 } |
| 687 | 688 |
| 689 // Start watching for low disk space events to notify the user. |
| 690 low_disk_notification_.reset(new LowDiskNotification()); |
| 691 |
| 688 ChromeBrowserMainPartsLinux::PostProfileInit(); | 692 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 689 } | 693 } |
| 690 | 694 |
| 691 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { | 695 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { |
| 692 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 696 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 693 // -- just before MetricsService::LogNeedForCleanShutdown(). | 697 // -- just before MetricsService::LogNeedForCleanShutdown(). |
| 694 | 698 |
| 695 // Start the external metrics service, which collects metrics from Chrome OS | 699 // Start the external metrics service, which collects metrics from Chrome OS |
| 696 // and passes them to the browser process. | 700 // and passes them to the browser process. |
| 697 external_metrics_ = new chromeos::ExternalMetrics; | 701 external_metrics_ = new chromeos::ExternalMetrics; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 DeviceSettingsService::Get()->UnsetSessionManager(); | 790 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 787 | 791 |
| 788 // We should remove observers attached to D-Bus clients before | 792 // We should remove observers attached to D-Bus clients before |
| 789 // DBusThreadManager is shut down. | 793 // DBusThreadManager is shut down. |
| 790 peripheral_battery_observer_.reset(); | 794 peripheral_battery_observer_.reset(); |
| 791 power_prefs_.reset(); | 795 power_prefs_.reset(); |
| 792 renderer_freezer_.reset(); | 796 renderer_freezer_.reset(); |
| 793 wake_on_wifi_manager_.reset(); | 797 wake_on_wifi_manager_.reset(); |
| 794 ScreenLocker::ShutDownClass(); | 798 ScreenLocker::ShutDownClass(); |
| 795 keyboard_event_rewriters_.reset(); | 799 keyboard_event_rewriters_.reset(); |
| 800 low_disk_notification_.reset(); |
| 796 #if defined(USE_X11) | 801 #if defined(USE_X11) |
| 797 // The XInput2 event listener needs to be shut down earlier than when | 802 // The XInput2 event listener needs to be shut down earlier than when |
| 798 // Singletons are finally destroyed in AtExitManager. | 803 // Singletons are finally destroyed in AtExitManager. |
| 799 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 804 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 800 | 805 |
| 801 DeviceUMA::GetInstance()->Stop(); | 806 DeviceUMA::GetInstance()->Stop(); |
| 802 | 807 |
| 803 // SystemKeyEventListener::Shutdown() is always safe to call, | 808 // SystemKeyEventListener::Shutdown() is always safe to call, |
| 804 // even if Initialize() wasn't called. | 809 // even if Initialize() wasn't called. |
| 805 SystemKeyEventListener::Shutdown(); | 810 SystemKeyEventListener::Shutdown(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // Destroy DBus services immediately after threads are stopped. | 880 // Destroy DBus services immediately after threads are stopped. |
| 876 dbus_services_.reset(); | 881 dbus_services_.reset(); |
| 877 | 882 |
| 878 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 883 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 879 | 884 |
| 880 // Destroy DeviceSettingsService after g_browser_process. | 885 // Destroy DeviceSettingsService after g_browser_process. |
| 881 DeviceSettingsService::Shutdown(); | 886 DeviceSettingsService::Shutdown(); |
| 882 } | 887 } |
| 883 | 888 |
| 884 } // namespace chromeos | 889 } // namespace chromeos |
| OLD | NEW |