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

Side by Side Diff: trunk/src/chrome/browser/ui/ash/ash_init.cc

Issue 167273003: Revert 251382 "event-rewrite: Clean up how events are rewritten." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/ash/ash_init.h" 5 #include "chrome/browser/ui/ash/ash_init.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/high_contrast/high_contrast_controller.h" 9 #include "ash/high_contrast/high_contrast_controller.h"
10 #include "ash/magnifier/magnification_controller.h" 10 #include "ash/magnifier/magnification_controller.h"
11 #include "ash/magnifier/partial_magnification_controller.h" 11 #include "ash/magnifier/partial_magnification_controller.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "ash/wm/event_rewriter_event_filter.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "chrome/browser/browser_shutdown.h" 15 #include "chrome/browser/browser_shutdown.h"
15 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 18 #include "chrome/browser/lifetime/application_lifetime.h"
18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
20 #include "chrome/browser/ui/ash/event_rewriter.h"
19 #include "chrome/browser/ui/ash/screenshot_taker.h" 21 #include "chrome/browser/ui/ash/screenshot_taker.h"
20 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
21 #include "ui/aura/env.h" 23 #include "ui/aura/env.h"
22 #include "ui/aura/root_window.h" 24 #include "ui/aura/root_window.h"
23 25
24 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
25 #include "base/sys_info.h" 27 #include "base/sys_info.h"
26 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" 28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h"
27 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 29 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
28 #include "chromeos/chromeos_switches.h" 30 #include "chromeos/chromeos_switches.h"
(...skipping 20 matching lines...) Expand all
49 ui::HideHostCursor(); 51 ui::HideHostCursor();
50 } 52 }
51 53
52 // Hide the mouse cursor completely at boot. 54 // Hide the mouse cursor completely at boot.
53 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) 55 if (!chromeos::LoginState::Get()->IsUserLoggedIn())
54 ash::Shell::set_initially_hide_cursor(true); 56 ash::Shell::set_initially_hide_cursor(true);
55 #endif 57 #endif
56 58
57 // Shell takes ownership of ChromeShellDelegate. 59 // Shell takes ownership of ChromeShellDelegate.
58 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); 60 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate);
61 shell->event_rewriter_filter()->SetEventRewriterDelegate(
62 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass());
59 shell->accelerator_controller()->SetScreenshotDelegate( 63 shell->accelerator_controller()->SetScreenshotDelegate(
60 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); 64 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass());
61 #if defined(OS_CHROMEOS) 65 #if defined(OS_CHROMEOS)
62 shell->accelerator_controller()->SetImeControlDelegate( 66 shell->accelerator_controller()->SetImeControlDelegate(
63 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); 67 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass());
64 shell->high_contrast_controller()->SetEnabled( 68 shell->high_contrast_controller()->SetEnabled(
65 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); 69 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled());
66 70
67 DCHECK(chromeos::MagnificationManager::Get()); 71 DCHECK(chromeos::MagnificationManager::Get());
68 bool magnifier_enabled = 72 bool magnifier_enabled =
(...skipping 16 matching lines...) Expand all
85 void CloseAsh() { 89 void CloseAsh() {
86 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't
87 // try to cleanup resources. 91 // try to cleanup resources.
88 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
89 ash::Shell::HasInstance()) { 93 ash::Shell::HasInstance()) {
90 ash::Shell::DeleteInstance(); 94 ash::Shell::DeleteInstance();
91 } 95 }
92 } 96 }
93 97
94 } // namespace chrome 98 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698