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