| 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/launcher/chrome_launcher_controller_mus.h" | 30 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" |
| 33 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 31 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 34 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 35 #include "chromeos/accelerometer/accelerometer_reader.h" | 33 #include "chromeos/accelerometer/accelerometer_reader.h" |
| 36 #include "chromeos/chromeos_switches.h" | 34 #include "chromeos/chromeos_switches.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 | 63 |
| 66 ash::ShellInitParams shell_init_params; | 64 ash::ShellInitParams shell_init_params; |
| 67 // Shell takes ownership of ChromeShellDelegate. | 65 // Shell takes ownership of ChromeShellDelegate. |
| 68 shell_init_params.delegate = new ChromeShellDelegate; | 66 shell_init_params.delegate = new ChromeShellDelegate; |
| 69 shell_init_params.context_factory = content::GetContextFactory(); | 67 shell_init_params.context_factory = content::GetContextFactory(); |
| 70 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 68 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
| 71 | 69 |
| 72 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 70 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
| 73 shell->accelerator_controller_delegate()->SetScreenshotDelegate( | 71 shell->accelerator_controller_delegate()->SetScreenshotDelegate( |
| 74 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); | 72 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); |
| 75 shell->autoclick_controller()->SetDelegate( | |
| 76 base::WrapUnique(new chromeos::AutoclickRingHandler())); | |
| 77 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 73 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
| 78 chromeos::AccelerometerReader::GetInstance()->Initialize( | 74 chromeos::AccelerometerReader::GetInstance()->Initialize( |
| 79 content::BrowserThread::GetBlockingPool() | 75 content::BrowserThread::GetBlockingPool() |
| 80 ->GetSequencedTaskRunnerWithShutdownBehavior( | 76 ->GetSequencedTaskRunnerWithShutdownBehavior( |
| 81 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 77 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
| 82 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 78 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 83 ash::WmShell::Get()->accelerator_controller()->SetImeControlDelegate( | 79 ash::WmShell::Get()->accelerator_controller()->SetImeControlDelegate( |
| 84 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); | 80 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); |
| 85 shell->high_contrast_controller()->SetEnabled( | 81 shell->high_contrast_controller()->SetEnabled( |
| 86 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 82 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 108 } | 104 } |
| 109 | 105 |
| 110 void CloseAsh() { | 106 void CloseAsh() { |
| 111 if (ash::Shell::HasInstance()) { | 107 if (ash::Shell::HasInstance()) { |
| 112 ash::Shell::DeleteInstance(); | 108 ash::Shell::DeleteInstance(); |
| 113 ash::ShellContentState::DestroyInstance(); | 109 ash::ShellContentState::DestroyInstance(); |
| 114 } | 110 } |
| 115 } | 111 } |
| 116 | 112 |
| 117 } // namespace chrome | 113 } // namespace chrome |
| OLD | NEW |