| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 #if defined(USE_X11) | 700 #if defined(USE_X11) |
| 701 // Listen for system key events so that the user will be able to adjust the | 701 // Listen for system key events so that the user will be able to adjust the |
| 702 // volume on the login screen, if Chrome is running on Chrome OS | 702 // volume on the login screen, if Chrome is running on Chrome OS |
| 703 // (i.e. not Linux desktop), and in non-test mode. | 703 // (i.e. not Linux desktop), and in non-test mode. |
| 704 // Note: SystemKeyEventListener depends on the DBus thread. | 704 // Note: SystemKeyEventListener depends on the DBus thread. |
| 705 if (base::SysInfo::IsRunningOnChromeOS() && | 705 if (base::SysInfo::IsRunningOnChromeOS() && |
| 706 !parameters().ui_task) { // ui_task is non-NULL when running tests. | 706 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
| 707 SystemKeyEventListener::Initialize(); | 707 SystemKeyEventListener::Initialize(); |
| 708 } | 708 } |
| 709 | 709 |
| 710 // Listen for XI_HierarchyChanged events. Note: if this is moved to | 710 if (!chrome::IsRunningInMash()) { |
| 711 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown | 711 // Listen for XI_HierarchyChanged events. Note: if this is moved to |
| 712 // reasons, see http://crosbug.com/24833. | 712 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown |
| 713 XInputHierarchyChangedEventListener::GetInstance(); | 713 // reasons, see http://crosbug.com/24833. |
| 714 XInputHierarchyChangedEventListener::GetInstance(); |
| 714 | 715 |
| 715 // Start the CrOS input device UMA watcher | 716 // Start the CrOS input device UMA watcher |
| 716 DeviceUMA::GetInstance(); | 717 DeviceUMA::GetInstance(); |
| 718 } |
| 717 #endif | 719 #endif |
| 718 | 720 |
| 719 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 721 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 720 // -- immediately after ChildProcess::WaitForDebugger(). | 722 // -- immediately after ChildProcess::WaitForDebugger(). |
| 721 | 723 |
| 722 if (ui::ShouldDefaultToNaturalScroll()) { | 724 if (ui::ShouldDefaultToNaturalScroll()) { |
| 723 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 725 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 724 chromeos::switches::kNaturalScrollDefault); | 726 chromeos::switches::kNaturalScrollDefault); |
| 725 system::InputDeviceSettings::Get()->SetTapToClick(true); | 727 system::InputDeviceSettings::Get()->SetTapToClick(true); |
| 726 } | 728 } |
| 727 | 729 |
| 728 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 730 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
| 729 } | 731 } |
| 730 | 732 |
| 731 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 733 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
| 732 system::InputDeviceSettings::Get()->InitTouchDevicesStatusFromLocalPrefs(); | 734 if (!chrome::IsRunningInMash()) { |
| 735 system::InputDeviceSettings::Get()->InitTouchDevicesStatusFromLocalPrefs(); |
| 733 | 736 |
| 734 if (!chrome::IsRunningInMash()) { | |
| 735 // These are dependent on the ash::Shell singleton already having been | 737 // These are dependent on the ash::Shell singleton already having been |
| 736 // initialized. Consequently, these cannot be used when running as a mus | 738 // initialized. Consequently, these cannot be used when running as a mus |
| 737 // client. | 739 // client. |
| 738 // TODO(oshima): Remove ash dependency in PowerButtonObserver. | 740 // TODO(oshima): Remove ash dependency in PowerButtonObserver. |
| 739 // crbug.com/408832. | 741 // crbug.com/408832. |
| 740 power_button_observer_.reset(new PowerButtonObserver); | 742 power_button_observer_.reset(new PowerButtonObserver); |
| 741 data_promo_notification_.reset(new DataPromoNotification()); | 743 data_promo_notification_.reset(new DataPromoNotification()); |
| 742 | 744 |
| 743 keyboard_event_rewriters_.reset(new EventRewriterController()); | 745 keyboard_event_rewriters_.reset(new EventRewriterController()); |
| 744 keyboard_event_rewriters_->AddEventRewriter( | 746 keyboard_event_rewriters_->AddEventRewriter( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 789 |
| 788 // We should remove observers attached to D-Bus clients before | 790 // We should remove observers attached to D-Bus clients before |
| 789 // DBusThreadManager is shut down. | 791 // DBusThreadManager is shut down. |
| 790 peripheral_battery_observer_.reset(); | 792 peripheral_battery_observer_.reset(); |
| 791 power_prefs_.reset(); | 793 power_prefs_.reset(); |
| 792 renderer_freezer_.reset(); | 794 renderer_freezer_.reset(); |
| 793 wake_on_wifi_manager_.reset(); | 795 wake_on_wifi_manager_.reset(); |
| 794 ScreenLocker::ShutDownClass(); | 796 ScreenLocker::ShutDownClass(); |
| 795 keyboard_event_rewriters_.reset(); | 797 keyboard_event_rewriters_.reset(); |
| 796 #if defined(USE_X11) | 798 #if defined(USE_X11) |
| 797 // The XInput2 event listener needs to be shut down earlier than when | 799 if (!chrome::IsRunningInMash()) { |
| 798 // Singletons are finally destroyed in AtExitManager. | 800 // The XInput2 event listener needs to be shut down earlier than when |
| 799 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 801 // Singletons are finally destroyed in AtExitManager. |
| 802 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 800 | 803 |
| 801 DeviceUMA::GetInstance()->Stop(); | 804 DeviceUMA::GetInstance()->Stop(); |
| 805 } |
| 802 | 806 |
| 803 // SystemKeyEventListener::Shutdown() is always safe to call, | 807 // SystemKeyEventListener::Shutdown() is always safe to call, |
| 804 // even if Initialize() wasn't called. | 808 // even if Initialize() wasn't called. |
| 805 SystemKeyEventListener::Shutdown(); | 809 SystemKeyEventListener::Shutdown(); |
| 806 #endif | 810 #endif |
| 807 | 811 |
| 808 // Detach D-Bus clients before DBusThreadManager is shut down. | 812 // Detach D-Bus clients before DBusThreadManager is shut down. |
| 809 power_button_observer_.reset(); | 813 power_button_observer_.reset(); |
| 810 idle_action_warning_observer_.reset(); | 814 idle_action_warning_observer_.reset(); |
| 811 | 815 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // Destroy DBus services immediately after threads are stopped. | 879 // Destroy DBus services immediately after threads are stopped. |
| 876 dbus_services_.reset(); | 880 dbus_services_.reset(); |
| 877 | 881 |
| 878 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 882 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 879 | 883 |
| 880 // Destroy DeviceSettingsService after g_browser_process. | 884 // Destroy DeviceSettingsService after g_browser_process. |
| 881 DeviceSettingsService::Shutdown(); | 885 DeviceSettingsService::Shutdown(); |
| 882 } | 886 } |
| 883 | 887 |
| 884 } // namespace chromeos | 888 } // namespace chromeos |
| OLD | NEW |