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/accelerators/accelerator_controller_delegate_aura.h" |
8 #include "ash/autoclick/autoclick_controller.h" | 9 #include "ash/autoclick/autoclick_controller.h" |
9 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
10 #include "ash/common/ash_switches.h" | 11 #include "ash/common/ash_switches.h" |
11 #include "ash/high_contrast/high_contrast_controller.h" | 12 #include "ash/high_contrast/high_contrast_controller.h" |
12 #include "ash/magnifier/magnification_controller.h" | 13 #include "ash/magnifier/magnification_controller.h" |
13 #include "ash/magnifier/partial_magnification_controller.h" | 14 #include "ash/magnifier/partial_magnification_controller.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "ash/shell_init_params.h" | 16 #include "ash/shell_init_params.h" |
16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
17 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Balanced by a call to DestroyInstance() in CloseAsh() below. | 65 // Balanced by a call to DestroyInstance() in CloseAsh() below. |
65 ash::ShellContentState::SetInstance(new ChromeShellContentState); | 66 ash::ShellContentState::SetInstance(new ChromeShellContentState); |
66 | 67 |
67 ash::ShellInitParams shell_init_params; | 68 ash::ShellInitParams shell_init_params; |
68 // Shell takes ownership of ChromeShellDelegate. | 69 // Shell takes ownership of ChromeShellDelegate. |
69 shell_init_params.delegate = new ChromeShellDelegate; | 70 shell_init_params.delegate = new ChromeShellDelegate; |
70 shell_init_params.context_factory = content::GetContextFactory(); | 71 shell_init_params.context_factory = content::GetContextFactory(); |
71 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 72 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
72 | 73 |
73 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 74 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
74 shell->accelerator_controller()->SetScreenshotDelegate( | 75 shell->accelerator_controller_delegate()->SetScreenshotDelegate( |
75 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); | 76 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); |
76 shell->autoclick_controller()->SetDelegate( | 77 shell->autoclick_controller()->SetDelegate( |
77 base::WrapUnique(new chromeos::AutoclickRingHandler())); | 78 base::WrapUnique(new chromeos::AutoclickRingHandler())); |
78 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 79 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
79 chromeos::AccelerometerReader::GetInstance()->Initialize( | 80 chromeos::AccelerometerReader::GetInstance()->Initialize( |
80 content::BrowserThread::GetBlockingPool() | 81 content::BrowserThread::GetBlockingPool() |
81 ->GetSequencedTaskRunnerWithShutdownBehavior( | 82 ->GetSequencedTaskRunnerWithShutdownBehavior( |
82 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 83 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
83 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 84 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
84 shell->accelerator_controller()->SetImeControlDelegate( | 85 shell->accelerator_controller()->SetImeControlDelegate( |
(...skipping 26 matching lines...) Expand all Loading... |
111 } | 112 } |
112 | 113 |
113 void CloseAsh() { | 114 void CloseAsh() { |
114 if (ash::Shell::HasInstance()) { | 115 if (ash::Shell::HasInstance()) { |
115 ash::Shell::DeleteInstance(); | 116 ash::Shell::DeleteInstance(); |
116 ash::ShellContentState::DestroyInstance(); | 117 ash::ShellContentState::DestroyInstance(); |
117 } | 118 } |
118 } | 119 } |
119 | 120 |
120 } // namespace chrome | 121 } // namespace chrome |
OLD | NEW |