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/autoclick/autoclick_controller.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 "ash/shell_init_params.h" | 14 #include "ash/shell_init_params.h" |
14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
15 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/browser_process_platform_part.h" | 19 #include "chrome/browser/browser_process_platform_part.h" |
19 #include "chrome/browser/browser_shutdown.h" | 20 #include "chrome/browser/browser_shutdown.h" |
20 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 22 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 23 #include "chrome/browser/chromeos/ui/autoclick_ring_handler.h" |
22 #include "chrome/browser/lifetime/application_lifetime.h" | 24 #include "chrome/browser/lifetime/application_lifetime.h" |
23 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" | 25 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" |
24 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" | 26 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" |
25 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 27 #include "chrome/browser/ui/ash/chrome_shell_delegate.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 "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
29 #include "chromeos/accelerometer/accelerometer_reader.h" | 31 #include "chromeos/accelerometer/accelerometer_reader.h" |
30 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
31 #include "chromeos/login/login_state.h" | 33 #include "chromeos/login/login_state.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 65 |
64 ash::ShellInitParams shell_init_params; | 66 ash::ShellInitParams shell_init_params; |
65 // Shell takes ownership of ChromeShellDelegate. | 67 // Shell takes ownership of ChromeShellDelegate. |
66 shell_init_params.delegate = new ChromeShellDelegate; | 68 shell_init_params.delegate = new ChromeShellDelegate; |
67 shell_init_params.context_factory = content::GetContextFactory(); | 69 shell_init_params.context_factory = content::GetContextFactory(); |
68 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 70 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
69 | 71 |
70 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 72 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
71 shell->accelerator_controller()->SetScreenshotDelegate( | 73 shell->accelerator_controller()->SetScreenshotDelegate( |
72 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); | 74 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); |
| 75 shell->autoclick_controller()->SetAutoclickgestureDelegate( |
| 76 std::unique_ptr<ash::AutoclickgestureDelegate>( |
| 77 new chromeos::LongPressAutoclickRingHandler)); |
73 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 78 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
74 chromeos::AccelerometerReader::GetInstance()->Initialize( | 79 chromeos::AccelerometerReader::GetInstance()->Initialize( |
75 content::BrowserThread::GetBlockingPool() | 80 content::BrowserThread::GetBlockingPool() |
76 ->GetSequencedTaskRunnerWithShutdownBehavior( | 81 ->GetSequencedTaskRunnerWithShutdownBehavior( |
77 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 82 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
78 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 83 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
79 shell->accelerator_controller()->SetImeControlDelegate( | 84 shell->accelerator_controller()->SetImeControlDelegate( |
80 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); | 85 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); |
81 shell->high_contrast_controller()->SetEnabled( | 86 shell->high_contrast_controller()->SetEnabled( |
82 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 87 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
(...skipping 23 matching lines...) Expand all Loading... |
106 } | 111 } |
107 | 112 |
108 void CloseAsh() { | 113 void CloseAsh() { |
109 if (ash::Shell::HasInstance()) { | 114 if (ash::Shell::HasInstance()) { |
110 ash::Shell::DeleteInstance(); | 115 ash::Shell::DeleteInstance(); |
111 ash::ShellContentState::DestroyInstance(); | 116 ash::ShellContentState::DestroyInstance(); |
112 } | 117 } |
113 } | 118 } |
114 | 119 |
115 } // namespace chrome | 120 } // namespace chrome |
OLD | NEW |