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/accelerometer/accelerometer_controller.h" |
8 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
9 #include "ash/high_contrast/high_contrast_controller.h" | 10 #include "ash/high_contrast/high_contrast_controller.h" |
10 #include "ash/magnifier/magnification_controller.h" | 11 #include "ash/magnifier/magnification_controller.h" |
11 #include "ash/magnifier/partial_magnification_controller.h" | 12 #include "ash/magnifier/partial_magnification_controller.h" |
12 #include "ash/shell.h" | 13 #include "ash/shell.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/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
16 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 17 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
17 #include "chrome/browser/ui/ash/screenshot_taker.h" | 18 #include "chrome/browser/ui/ash/screenshot_taker.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "content/public/browser/browser_thread.h" |
19 #include "ui/aura/env.h" | 21 #include "ui/aura/env.h" |
20 #include "ui/aura/window_tree_host.h" | 22 #include "ui/aura/window_tree_host.h" |
21 | 23 |
22 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
23 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
24 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
25 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 27 #include "chrome/browser/chromeos/accessibility/magnification_manager.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 22 matching lines...) Expand all Loading... |
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); |
59 shell->accelerator_controller()->SetScreenshotDelegate( | 61 shell->accelerator_controller()->SetScreenshotDelegate( |
60 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 62 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 63 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
| 64 shell->accelerometer_controller()->Initialize( |
| 65 content::BrowserThread::GetBlockingPool()-> |
| 66 GetTaskRunnerWithShutdownBehavior( |
| 67 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
61 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) |
62 shell->accelerator_controller()->SetImeControlDelegate( | 69 shell->accelerator_controller()->SetImeControlDelegate( |
63 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 70 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
64 shell->high_contrast_controller()->SetEnabled( | 71 shell->high_contrast_controller()->SetEnabled( |
65 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 72 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
66 | 73 |
67 DCHECK(chromeos::MagnificationManager::Get()); | 74 DCHECK(chromeos::MagnificationManager::Get()); |
68 bool magnifier_enabled = | 75 bool magnifier_enabled = |
69 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 76 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
70 ash::MagnifierType magnifier_type = | 77 ash::MagnifierType magnifier_type = |
(...skipping 10 matching lines...) Expand all Loading... |
81 #endif | 88 #endif |
82 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 89 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
83 } | 90 } |
84 | 91 |
85 void CloseAsh() { | 92 void CloseAsh() { |
86 if (ash::Shell::HasInstance()) | 93 if (ash::Shell::HasInstance()) |
87 ash::Shell::DeleteInstance(); | 94 ash::Shell::DeleteInstance(); |
88 } | 95 } |
89 | 96 |
90 } // namespace chrome | 97 } // namespace chrome |
OLD | NEW |