| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 674 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); |
| 674 | 675 |
| 675 // Tell the window manager observer to monitor window manager changes. To do | 676 // Tell the window manager observer to monitor window manager changes. To do |
| 676 // so, the ash::shell needs to be available (which it is now). | 677 // so, the ash::shell needs to be available (which it is now). |
| 677 if (arc::ArcBridgeService::GetEnabled( | 678 if (arc::ArcBridgeService::GetEnabled( |
| 678 base::CommandLine::ForCurrentProcess())) { | 679 base::CommandLine::ForCurrentProcess())) { |
| 679 DCHECK(arc::ArcServiceManager::Get()); | 680 DCHECK(arc::ArcServiceManager::Get()); |
| 680 arc::ArcServiceManager::Get()->OnAshStarted(); | 681 arc::ArcServiceManager::Get()->OnAshStarted(); |
| 681 } | 682 } |
| 682 | 683 |
| 684 // Start watching for low disk space events to notify the user. |
| 685 low_disk_notification_.reset(new LowDiskNotification()); |
| 686 |
| 683 ChromeBrowserMainPartsLinux::PostProfileInit(); | 687 ChromeBrowserMainPartsLinux::PostProfileInit(); |
| 684 } | 688 } |
| 685 | 689 |
| 686 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { | 690 void ChromeBrowserMainPartsChromeos::PreBrowserStart() { |
| 687 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 691 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 688 // -- just before MetricsService::LogNeedForCleanShutdown(). | 692 // -- just before MetricsService::LogNeedForCleanShutdown(). |
| 689 | 693 |
| 690 // Start the external metrics service, which collects metrics from Chrome OS | 694 // Start the external metrics service, which collects metrics from Chrome OS |
| 691 // and passes them to the browser process. | 695 // and passes them to the browser process. |
| 692 external_metrics_ = new chromeos::ExternalMetrics; | 696 external_metrics_ = new chromeos::ExternalMetrics; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 DeviceSettingsService::Get()->UnsetSessionManager(); | 785 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 782 | 786 |
| 783 // We should remove observers attached to D-Bus clients before | 787 // We should remove observers attached to D-Bus clients before |
| 784 // DBusThreadManager is shut down. | 788 // DBusThreadManager is shut down. |
| 785 peripheral_battery_observer_.reset(); | 789 peripheral_battery_observer_.reset(); |
| 786 power_prefs_.reset(); | 790 power_prefs_.reset(); |
| 787 renderer_freezer_.reset(); | 791 renderer_freezer_.reset(); |
| 788 wake_on_wifi_manager_.reset(); | 792 wake_on_wifi_manager_.reset(); |
| 789 ScreenLocker::ShutDownClass(); | 793 ScreenLocker::ShutDownClass(); |
| 790 keyboard_event_rewriters_.reset(); | 794 keyboard_event_rewriters_.reset(); |
| 795 low_disk_notification_.reset(); |
| 791 #if defined(USE_X11) | 796 #if defined(USE_X11) |
| 792 // The XInput2 event listener needs to be shut down earlier than when | 797 // The XInput2 event listener needs to be shut down earlier than when |
| 793 // Singletons are finally destroyed in AtExitManager. | 798 // Singletons are finally destroyed in AtExitManager. |
| 794 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 799 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 795 | 800 |
| 796 DeviceUMA::GetInstance()->Stop(); | 801 DeviceUMA::GetInstance()->Stop(); |
| 797 | 802 |
| 798 // SystemKeyEventListener::Shutdown() is always safe to call, | 803 // SystemKeyEventListener::Shutdown() is always safe to call, |
| 799 // even if Initialize() wasn't called. | 804 // even if Initialize() wasn't called. |
| 800 SystemKeyEventListener::Shutdown(); | 805 SystemKeyEventListener::Shutdown(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 // Destroy DBus services immediately after threads are stopped. | 875 // Destroy DBus services immediately after threads are stopped. |
| 871 dbus_services_.reset(); | 876 dbus_services_.reset(); |
| 872 | 877 |
| 873 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 878 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 874 | 879 |
| 875 // Destroy DeviceSettingsService after g_browser_process. | 880 // Destroy DeviceSettingsService after g_browser_process. |
| 876 DeviceSettingsService::Shutdown(); | 881 DeviceSettingsService::Shutdown(); |
| 877 } | 882 } |
| 878 | 883 |
| 879 } // namespace chromeos | 884 } // namespace chromeos |
| OLD | NEW |