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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 } | 723 } |
724 | 724 |
725 // Listen for XI_HierarchyChanged events. Note: if this is moved to | 725 // Listen for XI_HierarchyChanged events. Note: if this is moved to |
726 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown | 726 // PreMainMessageLoopRun() then desktopui_PageCyclerTests fail for unknown |
727 // reasons, see http://crosbug.com/24833. | 727 // reasons, see http://crosbug.com/24833. |
728 XInputHierarchyChangedEventListener::GetInstance(); | 728 XInputHierarchyChangedEventListener::GetInstance(); |
729 | 729 |
730 // Start the CrOS input device UMA watcher | 730 // Start the CrOS input device UMA watcher |
731 DeviceUMA::GetInstance(); | 731 DeviceUMA::GetInstance(); |
732 #endif | 732 #endif |
733 keyboard_event_rewriters_.reset(new EventRewriterController()); | |
734 keyboard_event_rewriters_->AddEventRewriter( | |
735 scoped_ptr<ui::EventRewriter>(new KeyboardDrivenEventRewriter())); | |
736 keyboard_event_rewriters_->AddEventRewriter( | |
737 scoped_ptr<ui::EventRewriter>(new EventRewriter())); | |
738 | 733 |
739 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 734 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
740 // -- immediately after ChildProcess::WaitForDebugger(). | 735 // -- immediately after ChildProcess::WaitForDebugger(). |
741 | 736 |
742 // Start the out-of-memory priority manager here so that we give the most | 737 // Start the out-of-memory priority manager here so that we give the most |
743 // amount of time for the other services to start up before we start | 738 // amount of time for the other services to start up before we start |
744 // adjusting the oom priority. | 739 // adjusting the oom priority. |
745 g_browser_process->platform_part()->oom_priority_manager()->Start(); | 740 g_browser_process->platform_part()->oom_priority_manager()->Start(); |
746 | 741 |
747 if (ui::ShouldDefaultToNaturalScroll()) { | 742 if (ui::ShouldDefaultToNaturalScroll()) { |
748 CommandLine::ForCurrentProcess()->AppendSwitch( | 743 CommandLine::ForCurrentProcess()->AppendSwitch( |
749 chromeos::switches::kNaturalScrollDefault); | 744 chromeos::switches::kNaturalScrollDefault); |
750 system::InputDeviceSettings::Get()->SetTapToClick(true); | 745 system::InputDeviceSettings::Get()->SetTapToClick(true); |
751 } | 746 } |
752 | 747 |
753 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 748 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
754 } | 749 } |
755 | 750 |
756 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 751 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
757 // These are dependent on the ash::Shell singleton already having been | 752 // These are dependent on the ash::Shell singleton already having been |
758 // initialized. | 753 // initialized. |
759 power_button_observer_.reset(new PowerButtonObserver); | 754 power_button_observer_.reset(new PowerButtonObserver); |
760 data_promo_notification_.reset(new DataPromoNotification()), | 755 data_promo_notification_.reset(new DataPromoNotification()); |
| 756 |
| 757 keyboard_event_rewriters_.reset(new EventRewriterController()); |
| 758 keyboard_event_rewriters_->AddEventRewriter( |
| 759 scoped_ptr<ui::EventRewriter>(new KeyboardDrivenEventRewriter())); |
| 760 keyboard_event_rewriters_->AddEventRewriter(scoped_ptr<ui::EventRewriter>( |
| 761 new EventRewriter(ash::Shell::GetInstance()->sticky_keys_controller()))); |
761 keyboard_event_rewriters_->Init(); | 762 keyboard_event_rewriters_->Init(); |
762 | 763 |
763 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 764 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
764 } | 765 } |
765 | 766 |
766 // Shut down services before the browser process, etc are destroyed. | 767 // Shut down services before the browser process, etc are destroyed. |
767 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { | 768 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { |
768 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); | 769 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); |
769 | 770 |
770 g_browser_process->platform_part()->oom_priority_manager()->Stop(); | 771 g_browser_process->platform_part()->oom_priority_manager()->Stop(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 // Destroy DBus services immediately after threads are stopped. | 866 // Destroy DBus services immediately after threads are stopped. |
866 dbus_services_.reset(); | 867 dbus_services_.reset(); |
867 | 868 |
868 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 869 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
869 | 870 |
870 // Destroy DeviceSettingsService after g_browser_process. | 871 // Destroy DeviceSettingsService after g_browser_process. |
871 DeviceSettingsService::Shutdown(); | 872 DeviceSettingsService::Shutdown(); |
872 } | 873 } |
873 | 874 |
874 } // namespace chromeos | 875 } // namespace chromeos |
OLD | NEW |