| 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" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "chrome/browser/chromeos/login/wizard_controller.h" | 53 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 54 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 54 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
| 55 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" | 55 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
| 56 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 56 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
| 57 #include "chrome/browser/chromeos/net/network_change_notifier_network_library.h" | 57 #include "chrome/browser/chromeos/net/network_change_notifier_network_library.h" |
| 58 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 58 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 59 #include "chrome/browser/chromeos/power/brightness_observer.h" | 59 #include "chrome/browser/chromeos/power/brightness_observer.h" |
| 60 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" | 60 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" |
| 61 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 61 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
| 62 #include "chrome/browser/chromeos/power/power_button_observer.h" | 62 #include "chrome/browser/chromeos/power/power_button_observer.h" |
| 63 #include "chrome/browser/chromeos/power/power_prefs.h" |
| 63 #include "chrome/browser/chromeos/power/resume_observer.h" | 64 #include "chrome/browser/chromeos/power/resume_observer.h" |
| 64 #include "chrome/browser/chromeos/power/screen_lock_observer.h" | 65 #include "chrome/browser/chromeos/power/screen_lock_observer.h" |
| 65 #include "chrome/browser/chromeos/power/suspend_observer.h" | 66 #include "chrome/browser/chromeos/power/suspend_observer.h" |
| 66 #include "chrome/browser/chromeos/power/user_activity_notifier.h" | 67 #include "chrome/browser/chromeos/power/user_activity_notifier.h" |
| 67 #include "chrome/browser/chromeos/power/video_activity_notifier.h" | 68 #include "chrome/browser/chromeos/power/video_activity_notifier.h" |
| 68 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 69 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 69 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" | 70 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" |
| 70 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" | 71 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
| 71 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 72 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 72 #include "chrome/browser/chromeos/settings/owner_key_util.h" | 73 #include "chrome/browser/chromeos/settings/owner_key_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 91 #include "chrome/common/logging_chrome.h" | 92 #include "chrome/common/logging_chrome.h" |
| 92 #include "chrome/common/pref_names.h" | 93 #include "chrome/common/pref_names.h" |
| 93 #include "chromeos/audio/audio_devices_pref_handler.h" | 94 #include "chromeos/audio/audio_devices_pref_handler.h" |
| 94 #include "chromeos/audio/audio_pref_handler.h" | 95 #include "chromeos/audio/audio_pref_handler.h" |
| 95 #include "chromeos/audio/cras_audio_handler.h" | 96 #include "chromeos/audio/cras_audio_handler.h" |
| 96 #include "chromeos/chromeos_paths.h" | 97 #include "chromeos/chromeos_paths.h" |
| 97 #include "chromeos/chromeos_switches.h" | 98 #include "chromeos/chromeos_switches.h" |
| 98 #include "chromeos/cryptohome/async_method_caller.h" | 99 #include "chromeos/cryptohome/async_method_caller.h" |
| 99 #include "chromeos/cryptohome/cryptohome_library.h" | 100 #include "chromeos/cryptohome/cryptohome_library.h" |
| 100 #include "chromeos/dbus/dbus_thread_manager.h" | 101 #include "chromeos/dbus/dbus_thread_manager.h" |
| 102 #include "chromeos/dbus/power_policy_controller.h" |
| 101 #include "chromeos/dbus/session_manager_client.h" | 103 #include "chromeos/dbus/session_manager_client.h" |
| 102 #include "chromeos/disks/disk_mount_manager.h" | 104 #include "chromeos/disks/disk_mount_manager.h" |
| 103 #include "chromeos/ime/input_method_manager.h" | 105 #include "chromeos/ime/input_method_manager.h" |
| 104 #include "chromeos/ime/xkeyboard.h" | 106 #include "chromeos/ime/xkeyboard.h" |
| 105 #include "chromeos/login/login_state.h" | 107 #include "chromeos/login/login_state.h" |
| 106 #include "chromeos/network/network_change_notifier_chromeos.h" | 108 #include "chromeos/network/network_change_notifier_chromeos.h" |
| 107 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 109 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
| 108 #include "chromeos/network/network_handler.h" | 110 #include "chromeos/network/network_handler.h" |
| 109 #include "content/public/browser/browser_thread.h" | 111 #include "content/public/browser/browser_thread.h" |
| 110 #include "content/public/browser/notification_service.h" | 112 #include "content/public/browser/notification_service.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 storage_monitor_.reset(new StorageMonitorCros()); | 582 storage_monitor_.reset(new StorageMonitorCros()); |
| 581 | 583 |
| 582 // Make sure that wallpaper boot transition and other delays in OOBE | 584 // Make sure that wallpaper boot transition and other delays in OOBE |
| 583 // are disabled for tests and kiosk app launch by default. | 585 // are disabled for tests and kiosk app launch by default. |
| 584 // Individual tests may enable them if they want. | 586 // Individual tests may enable them if they want. |
| 585 if (parsed_command_line().HasSwitch(::switches::kTestType) || | 587 if (parsed_command_line().HasSwitch(::switches::kTestType) || |
| 586 ShouldAutoLaunchKioskApp(parsed_command_line())) { | 588 ShouldAutoLaunchKioskApp(parsed_command_line())) { |
| 587 WizardController::SetZeroDelays(); | 589 WizardController::SetZeroDelays(); |
| 588 } | 590 } |
| 589 | 591 |
| 592 power_prefs_.reset(new PowerPrefs( |
| 593 DBusThreadManager::Get()->GetPowerPolicyController())); |
| 594 |
| 590 // In Aura builds this will initialize ash::Shell. | 595 // In Aura builds this will initialize ash::Shell. |
| 591 ChromeBrowserMainPartsLinux::PreProfileInit(); | 596 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 592 } | 597 } |
| 593 | 598 |
| 594 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 599 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
| 595 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 600 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 596 // -- just after CreateProfile(). | 601 // -- just after CreateProfile(). |
| 597 | 602 |
| 598 // Restarting Chrome inside existing user session. Possible cases: | 603 // Restarting Chrome inside existing user session. Possible cases: |
| 599 // 1. Chrome is restarted after crash. | 604 // 1. Chrome is restarted after crash. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 DeviceSettingsService::Get()->UnsetSessionManager(); | 778 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 774 | 779 |
| 775 // We should remove observers attached to D-Bus clients before | 780 // We should remove observers attached to D-Bus clients before |
| 776 // DBusThreadManager is shut down. | 781 // DBusThreadManager is shut down. |
| 777 screen_lock_observer_.reset(); | 782 screen_lock_observer_.reset(); |
| 778 suspend_observer_.reset(); | 783 suspend_observer_.reset(); |
| 779 resume_observer_.reset(); | 784 resume_observer_.reset(); |
| 780 brightness_observer_.reset(); | 785 brightness_observer_.reset(); |
| 781 retail_mode_power_save_blocker_.reset(); | 786 retail_mode_power_save_blocker_.reset(); |
| 782 peripheral_battery_observer_.reset(); | 787 peripheral_battery_observer_.reset(); |
| 788 power_prefs_.reset(); |
| 783 | 789 |
| 784 // The XInput2 event listener needs to be shut down earlier than when | 790 // The XInput2 event listener needs to be shut down earlier than when |
| 785 // Singletons are finally destroyed in AtExitManager. | 791 // Singletons are finally destroyed in AtExitManager. |
| 786 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 792 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 787 | 793 |
| 788 #if defined(USE_X11) | 794 #if defined(USE_X11) |
| 789 DeviceUMA::GetInstance()->Stop(); | 795 DeviceUMA::GetInstance()->Stop(); |
| 790 #endif | 796 #endif |
| 791 | 797 |
| 792 // SystemKeyEventListener::Shutdown() is always safe to call, | 798 // SystemKeyEventListener::Shutdown() is always safe to call, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 850 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 845 // Destroy DeviceSettingsService after g_browser_process. | 851 // Destroy DeviceSettingsService after g_browser_process. |
| 846 DeviceSettingsService::Shutdown(); | 852 DeviceSettingsService::Shutdown(); |
| 847 } | 853 } |
| 848 | 854 |
| 849 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 855 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
| 850 default_pinned_apps_field_trial::SetupTrial(); | 856 default_pinned_apps_field_trial::SetupTrial(); |
| 851 } | 857 } |
| 852 | 858 |
| 853 } // namespace chromeos | 859 } // namespace chromeos |
| OLD | NEW |