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 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 24 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
27 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 27 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
28 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 28 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
29 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 29 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
30 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" | 30 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" |
31 #include "chrome/browser/chromeos/boot_times_loader.h" | 31 #include "chrome/browser/chromeos/boot_times_loader.h" |
32 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 32 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 33 #include "chrome/browser/chromeos/events/event_rewriter_controller.h" |
| 34 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" |
33 #include "chrome/browser/chromeos/extensions/default_app_order.h" | 35 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
34 #include "chrome/browser/chromeos/extensions/extension_system_event_observer.h" | 36 #include "chrome/browser/chromeos/extensions/extension_system_event_observer.h" |
35 #include "chrome/browser/chromeos/external_metrics.h" | 37 #include "chrome/browser/chromeos/external_metrics.h" |
36 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 38 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
37 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 39 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
38 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 40 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
39 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 41 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
40 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 42 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
41 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
42 #include "chrome/browser/chromeos/language_preferences.h" | 44 #include "chrome/browser/chromeos/language_preferences.h" |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // Listen for XI_HierarchyChanged events. Note: if this is moved to | 697 // Listen for XI_HierarchyChanged events. Note: if this is moved to |
696 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown | 698 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown |
697 // reasons, see http://crosbug.com/24833. | 699 // reasons, see http://crosbug.com/24833. |
698 XInputHierarchyChangedEventListener::GetInstance(); | 700 XInputHierarchyChangedEventListener::GetInstance(); |
699 | 701 |
700 // Start the CrOS input device UMA watcher | 702 // Start the CrOS input device UMA watcher |
701 DeviceUMA::GetInstance(); | 703 DeviceUMA::GetInstance(); |
702 | 704 |
703 event_rewriter_.reset(new EventRewriter()); | 705 event_rewriter_.reset(new EventRewriter()); |
704 #endif | 706 #endif |
| 707 keyboard_event_rewriters_.reset(new EventRewriterController()); |
| 708 keyboard_event_rewriters_->AddEventRewriter( |
| 709 scoped_ptr<ui::EventRewriter>(new KeyboardDrivenEventRewriter())); |
705 | 710 |
706 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 711 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
707 // -- immediately after ChildProcess::WaitForDebugger(). | 712 // -- immediately after ChildProcess::WaitForDebugger(). |
708 | 713 |
709 // Start the out-of-memory priority manager here so that we give the most | 714 // Start the out-of-memory priority manager here so that we give the most |
710 // amount of time for the other services to start up before we start | 715 // amount of time for the other services to start up before we start |
711 // adjusting the oom priority. | 716 // adjusting the oom priority. |
712 g_browser_process->platform_part()->oom_priority_manager()->Start(); | 717 g_browser_process->platform_part()->oom_priority_manager()->Start(); |
713 | 718 |
714 if (ui::ShouldDefaultToNaturalScroll()) { | 719 if (ui::ShouldDefaultToNaturalScroll()) { |
715 CommandLine::ForCurrentProcess()->AppendSwitch( | 720 CommandLine::ForCurrentProcess()->AppendSwitch( |
716 chromeos::switches::kNaturalScrollDefault); | 721 chromeos::switches::kNaturalScrollDefault); |
717 system::InputDeviceSettings::Get()->SetTapToClick(true); | 722 system::InputDeviceSettings::Get()->SetTapToClick(true); |
718 } | 723 } |
719 | 724 |
720 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 725 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
721 } | 726 } |
722 | 727 |
723 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 728 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
724 // These are dependent on the ash::Shell singleton already having been | 729 // These are dependent on the ash::Shell singleton already having been |
725 // initialized. | 730 // initialized. |
726 power_button_observer_.reset(new PowerButtonObserver); | 731 power_button_observer_.reset(new PowerButtonObserver); |
727 data_promo_notification_.reset(new DataPromoNotification()), | 732 data_promo_notification_.reset(new DataPromoNotification()), |
| 733 keyboard_event_rewriters_->Init(); |
728 | 734 |
729 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 735 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
730 } | 736 } |
731 | 737 |
732 // Shut down services before the browser process, etc are destroyed. | 738 // Shut down services before the browser process, etc are destroyed. |
733 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { | 739 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { |
734 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); | 740 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); |
735 | 741 |
736 g_browser_process->platform_part()->oom_priority_manager()->Stop(); | 742 g_browser_process->platform_part()->oom_priority_manager()->Stop(); |
737 | 743 |
(...skipping 25 matching lines...) Expand all Loading... |
763 extension_system_event_observer_.reset(); | 769 extension_system_event_observer_.reset(); |
764 retail_mode_power_save_blocker_.reset(); | 770 retail_mode_power_save_blocker_.reset(); |
765 peripheral_battery_observer_.reset(); | 771 peripheral_battery_observer_.reset(); |
766 power_prefs_.reset(); | 772 power_prefs_.reset(); |
767 | 773 |
768 // Let the ScreenLocker unregister itself from SessionManagerClient before | 774 // Let the ScreenLocker unregister itself from SessionManagerClient before |
769 // DBusThreadManager is shut down. | 775 // DBusThreadManager is shut down. |
770 if (!KioskModeSettings::Get()->IsKioskModeEnabled()) | 776 if (!KioskModeSettings::Get()->IsKioskModeEnabled()) |
771 ScreenLocker::ShutDownClass(); | 777 ScreenLocker::ShutDownClass(); |
772 | 778 |
| 779 keyboard_event_rewriters_.reset(); |
773 #if defined(USE_X11) | 780 #if defined(USE_X11) |
774 event_rewriter_.reset(); | 781 event_rewriter_.reset(); |
775 | 782 |
776 // The XInput2 event listener needs to be shut down earlier than when | 783 // The XInput2 event listener needs to be shut down earlier than when |
777 // Singletons are finally destroyed in AtExitManager. | 784 // Singletons are finally destroyed in AtExitManager. |
778 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 785 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
779 | 786 |
780 DeviceUMA::GetInstance()->Stop(); | 787 DeviceUMA::GetInstance()->Stop(); |
781 | 788 |
782 // SystemKeyEventListener::Shutdown() is always safe to call, | 789 // SystemKeyEventListener::Shutdown() is always safe to call, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // Destroy DBus services immediately after threads are stopped. | 839 // Destroy DBus services immediately after threads are stopped. |
833 dbus_services_.reset(); | 840 dbus_services_.reset(); |
834 | 841 |
835 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 842 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
836 | 843 |
837 // Destroy DeviceSettingsService after g_browser_process. | 844 // Destroy DeviceSettingsService after g_browser_process. |
838 DeviceSettingsService::Shutdown(); | 845 DeviceSettingsService::Shutdown(); |
839 } | 846 } |
840 | 847 |
841 } // namespace chromeos | 848 } // namespace chromeos |
OLD | NEW |