OLD | NEW |
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" | |
14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
15 #include "chrome/browser/browser_shutdown.h" | 14 #include "chrome/browser/browser_shutdown.h" |
16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 15 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
18 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
20 #include "chrome/browser/ui/ash/event_rewriter.h" | |
21 #include "chrome/browser/ui/ash/screenshot_taker.h" | 19 #include "chrome/browser/ui/ash/screenshot_taker.h" |
22 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
23 #include "ui/aura/env.h" | 21 #include "ui/aura/env.h" |
24 #include "ui/aura/root_window.h" | 22 #include "ui/aura/root_window.h" |
25 | 23 |
26 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
27 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 26 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
29 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 27 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
30 #include "chromeos/chromeos_switches.h" | 28 #include "chromeos/chromeos_switches.h" |
(...skipping 20 matching lines...) Expand all Loading... |
51 ui::HideHostCursor(); | 49 ui::HideHostCursor(); |
52 } | 50 } |
53 | 51 |
54 // Hide the mouse cursor completely at boot. | 52 // Hide the mouse cursor completely at boot. |
55 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 53 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
56 ash::Shell::set_initially_hide_cursor(true); | 54 ash::Shell::set_initially_hide_cursor(true); |
57 #endif | 55 #endif |
58 | 56 |
59 // Shell takes ownership of ChromeShellDelegate. | 57 // Shell takes ownership of ChromeShellDelegate. |
60 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 58 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
61 shell->event_rewriter_filter()->SetEventRewriterDelegate( | |
62 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | |
63 shell->accelerator_controller()->SetScreenshotDelegate( | 59 shell->accelerator_controller()->SetScreenshotDelegate( |
64 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 60 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
65 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
66 shell->accelerator_controller()->SetImeControlDelegate( | 62 shell->accelerator_controller()->SetImeControlDelegate( |
67 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 63 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
68 shell->high_contrast_controller()->SetEnabled( | 64 shell->high_contrast_controller()->SetEnabled( |
69 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 65 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
70 | 66 |
71 DCHECK(chromeos::MagnificationManager::Get()); | 67 DCHECK(chromeos::MagnificationManager::Get()); |
72 bool magnifier_enabled = | 68 bool magnifier_enabled = |
(...skipping 16 matching lines...) Expand all Loading... |
89 void CloseAsh() { | 85 void CloseAsh() { |
90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 86 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
91 // try to cleanup resources. | 87 // try to cleanup resources. |
92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 88 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
93 ash::Shell::HasInstance()) { | 89 ash::Shell::HasInstance()) { |
94 ash::Shell::DeleteInstance(); | 90 ash::Shell::DeleteInstance(); |
95 } | 91 } |
96 } | 92 } |
97 | 93 |
98 } // namespace chrome | 94 } // namespace chrome |
OLD | NEW |