Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: trunk/src/chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 341923006: Revert 278342 "Convert sticky keys to a chromeos::EventRewriter ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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()));
733 738
734 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 739 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
735 // -- immediately after ChildProcess::WaitForDebugger(). 740 // -- immediately after ChildProcess::WaitForDebugger().
736 741
737 // Start the out-of-memory priority manager here so that we give the most 742 // Start the out-of-memory priority manager here so that we give the most
738 // amount of time for the other services to start up before we start 743 // amount of time for the other services to start up before we start
739 // adjusting the oom priority. 744 // adjusting the oom priority.
740 g_browser_process->platform_part()->oom_priority_manager()->Start(); 745 g_browser_process->platform_part()->oom_priority_manager()->Start();
741 746
742 if (ui::ShouldDefaultToNaturalScroll()) { 747 if (ui::ShouldDefaultToNaturalScroll()) {
743 CommandLine::ForCurrentProcess()->AppendSwitch( 748 CommandLine::ForCurrentProcess()->AppendSwitch(
744 chromeos::switches::kNaturalScrollDefault); 749 chromeos::switches::kNaturalScrollDefault);
745 system::InputDeviceSettings::Get()->SetTapToClick(true); 750 system::InputDeviceSettings::Get()->SetTapToClick(true);
746 } 751 }
747 752
748 ChromeBrowserMainPartsLinux::PreBrowserStart(); 753 ChromeBrowserMainPartsLinux::PreBrowserStart();
749 } 754 }
750 755
751 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { 756 void ChromeBrowserMainPartsChromeos::PostBrowserStart() {
752 // These are dependent on the ash::Shell singleton already having been 757 // These are dependent on the ash::Shell singleton already having been
753 // initialized. 758 // initialized.
754 power_button_observer_.reset(new PowerButtonObserver); 759 power_button_observer_.reset(new PowerButtonObserver);
755 data_promo_notification_.reset(new DataPromoNotification()); 760 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())));
762 keyboard_event_rewriters_->Init(); 761 keyboard_event_rewriters_->Init();
763 762
764 ChromeBrowserMainPartsLinux::PostBrowserStart(); 763 ChromeBrowserMainPartsLinux::PostBrowserStart();
765 } 764 }
766 765
767 // Shut down services before the browser process, etc are destroyed. 766 // Shut down services before the browser process, etc are destroyed.
768 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { 767 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
769 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); 768 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true);
770 769
771 g_browser_process->platform_part()->oom_priority_manager()->Stop(); 770 g_browser_process->platform_part()->oom_priority_manager()->Stop();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 // Destroy DBus services immediately after threads are stopped. 865 // Destroy DBus services immediately after threads are stopped.
867 dbus_services_.reset(); 866 dbus_services_.reset();
868 867
869 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 868 ChromeBrowserMainPartsLinux::PostDestroyThreads();
870 869
871 // Destroy DeviceSettingsService after g_browser_process. 870 // Destroy DeviceSettingsService after g_browser_process.
872 DeviceSettingsService::Shutdown(); 871 DeviceSettingsService::Shutdown();
873 } 872 }
874 873
875 } // namespace chromeos 874 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/ash/sticky_keys/sticky_keys_unittest.cc ('k') | trunk/src/chrome/browser/chromeos/events/event_rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698