| 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 19 matching lines...) Expand all Loading... |
| 92 #include "chrome/common/logging_chrome.h" | 93 #include "chrome/common/logging_chrome.h" |
| 93 #include "chrome/common/pref_names.h" | 94 #include "chrome/common/pref_names.h" |
| 94 #include "chromeos/audio/audio_devices_pref_handler.h" | 95 #include "chromeos/audio/audio_devices_pref_handler.h" |
| 95 #include "chromeos/audio/audio_pref_handler.h" | 96 #include "chromeos/audio/audio_pref_handler.h" |
| 96 #include "chromeos/audio/cras_audio_handler.h" | 97 #include "chromeos/audio/cras_audio_handler.h" |
| 97 #include "chromeos/chromeos_paths.h" | 98 #include "chromeos/chromeos_paths.h" |
| 98 #include "chromeos/chromeos_switches.h" | 99 #include "chromeos/chromeos_switches.h" |
| 99 #include "chromeos/cryptohome/async_method_caller.h" | 100 #include "chromeos/cryptohome/async_method_caller.h" |
| 100 #include "chromeos/cryptohome/cryptohome_library.h" | 101 #include "chromeos/cryptohome/cryptohome_library.h" |
| 101 #include "chromeos/dbus/dbus_thread_manager.h" | 102 #include "chromeos/dbus/dbus_thread_manager.h" |
| 103 #include "chromeos/dbus/power_policy_controller.h" |
| 102 #include "chromeos/dbus/session_manager_client.h" | 104 #include "chromeos/dbus/session_manager_client.h" |
| 103 #include "chromeos/disks/disk_mount_manager.h" | 105 #include "chromeos/disks/disk_mount_manager.h" |
| 104 #include "chromeos/ime/input_method_manager.h" | 106 #include "chromeos/ime/input_method_manager.h" |
| 105 #include "chromeos/ime/xkeyboard.h" | 107 #include "chromeos/ime/xkeyboard.h" |
| 106 #include "chromeos/login/login_state.h" | 108 #include "chromeos/login/login_state.h" |
| 107 #include "chromeos/network/network_change_notifier_chromeos.h" | 109 #include "chromeos/network/network_change_notifier_chromeos.h" |
| 108 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 110 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
| 109 #include "chromeos/network/network_handler.h" | 111 #include "chromeos/network/network_handler.h" |
| 110 #include "content/public/browser/browser_thread.h" | 112 #include "content/public/browser/browser_thread.h" |
| 111 #include "content/public/browser/notification_service.h" | 113 #include "content/public/browser/notification_service.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 storage_monitor_.reset(new StorageMonitorCros()); | 583 storage_monitor_.reset(new StorageMonitorCros()); |
| 582 | 584 |
| 583 // Make sure that wallpaper boot transition and other delays in OOBE | 585 // Make sure that wallpaper boot transition and other delays in OOBE |
| 584 // are disabled for tests and kiosk app launch by default. | 586 // are disabled for tests and kiosk app launch by default. |
| 585 // Individual tests may enable them if they want. | 587 // Individual tests may enable them if they want. |
| 586 if (parsed_command_line().HasSwitch(::switches::kTestType) || | 588 if (parsed_command_line().HasSwitch(::switches::kTestType) || |
| 587 ShouldAutoLaunchKioskApp(parsed_command_line())) { | 589 ShouldAutoLaunchKioskApp(parsed_command_line())) { |
| 588 WizardController::SetZeroDelays(); | 590 WizardController::SetZeroDelays(); |
| 589 } | 591 } |
| 590 | 592 |
| 593 power_prefs_.reset(new PowerPrefs( |
| 594 DBusThreadManager::Get()->GetPowerPolicyController())); |
| 595 |
| 591 // In Aura builds this will initialize ash::Shell. | 596 // In Aura builds this will initialize ash::Shell. |
| 592 ChromeBrowserMainPartsLinux::PreProfileInit(); | 597 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 593 } | 598 } |
| 594 | 599 |
| 595 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 600 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
| 596 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 601 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 597 // -- just after CreateProfile(). | 602 // -- just after CreateProfile(). |
| 598 | 603 |
| 599 // Restarting Chrome inside existing user session. Possible cases: | 604 // Restarting Chrome inside existing user session. Possible cases: |
| 600 // 1. Chrome is restarted after crash. | 605 // 1. Chrome is restarted after crash. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 DeviceSettingsService::Get()->UnsetSessionManager(); | 785 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 781 | 786 |
| 782 // We should remove observers attached to D-Bus clients before | 787 // We should remove observers attached to D-Bus clients before |
| 783 // DBusThreadManager is shut down. | 788 // DBusThreadManager is shut down. |
| 784 screen_lock_observer_.reset(); | 789 screen_lock_observer_.reset(); |
| 785 suspend_observer_.reset(); | 790 suspend_observer_.reset(); |
| 786 resume_observer_.reset(); | 791 resume_observer_.reset(); |
| 787 brightness_observer_.reset(); | 792 brightness_observer_.reset(); |
| 788 retail_mode_power_save_blocker_.reset(); | 793 retail_mode_power_save_blocker_.reset(); |
| 789 peripheral_battery_observer_.reset(); | 794 peripheral_battery_observer_.reset(); |
| 795 power_prefs_.reset(); |
| 790 | 796 |
| 791 // 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 |
| 792 // Singletons are finally destroyed in AtExitManager. | 798 // Singletons are finally destroyed in AtExitManager. |
| 793 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 799 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 794 | 800 |
| 795 #if defined(USE_X11) | 801 #if defined(USE_X11) |
| 796 DeviceUMA::GetInstance()->Stop(); | 802 DeviceUMA::GetInstance()->Stop(); |
| 797 #endif | 803 #endif |
| 798 | 804 |
| 799 // SystemKeyEventListener::Shutdown() is always safe to call, | 805 // SystemKeyEventListener::Shutdown() is always safe to call, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 857 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 852 // Destroy DeviceSettingsService after g_browser_process. | 858 // Destroy DeviceSettingsService after g_browser_process. |
| 853 DeviceSettingsService::Shutdown(); | 859 DeviceSettingsService::Shutdown(); |
| 854 } | 860 } |
| 855 | 861 |
| 856 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 862 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
| 857 default_pinned_apps_field_trial::SetupTrial(); | 863 default_pinned_apps_field_trial::SetupTrial(); |
| 858 } | 864 } |
| 859 | 865 |
| 860 } // namespace chromeos | 866 } // namespace chromeos |
| OLD | NEW |