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/content_support/inject.h" | |
10 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
11 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
12 #include "ash/magnifier/partial_magnification_controller.h" | 11 #include "ash/magnifier/partial_magnification_controller.h" |
13 #include "ash/shell.h" | 12 #include "ash/shell.h" |
14 #include "ash/wm/event_rewriter_event_filter.h" | 13 #include "ash/wm/event_rewriter_event_filter.h" |
15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
16 #include "chrome/browser/browser_shutdown.h" | 15 #include "chrome/browser/browser_shutdown.h" |
17 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
19 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ui::HideHostCursor(); | 51 ui::HideHostCursor(); |
53 } | 52 } |
54 | 53 |
55 // Hide the mouse cursor completely at boot. | 54 // Hide the mouse cursor completely at boot. |
56 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 55 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
57 ash::Shell::set_initially_hide_cursor(true); | 56 ash::Shell::set_initially_hide_cursor(true); |
58 #endif | 57 #endif |
59 | 58 |
60 // Shell takes ownership of ChromeShellDelegate. | 59 // Shell takes ownership of ChromeShellDelegate. |
61 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 60 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
62 ash::InitContentSupport(); | |
63 shell->event_rewriter_filter()->SetEventRewriterDelegate( | 61 shell->event_rewriter_filter()->SetEventRewriterDelegate( |
64 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 62 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
65 shell->accelerator_controller()->SetScreenshotDelegate( | 63 shell->accelerator_controller()->SetScreenshotDelegate( |
66 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 64 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
67 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
68 shell->accelerator_controller()->SetImeControlDelegate( | 66 shell->accelerator_controller()->SetImeControlDelegate( |
69 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 67 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
70 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 68 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
71 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 69 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
72 | 70 |
(...skipping 18 matching lines...) Expand all Loading... |
91 void CloseAsh() { | 89 void CloseAsh() { |
92 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
93 // try to cleanup resources. | 91 // try to cleanup resources. |
94 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
95 ash::Shell::HasInstance()) { | 93 ash::Shell::HasInstance()) { |
96 ash::Shell::DeleteInstance(); | 94 ash::Shell::DeleteInstance(); |
97 } | 95 } |
98 } | 96 } |
99 | 97 |
100 } // namespace chrome | 98 } // namespace chrome |
OLD | NEW |