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/accelerators/accelerator_controller_delegate_aura.h" |
9 #include "ash/accessibility_types.h" | 9 #include "ash/accessibility_types.h" |
10 #include "ash/aura/shell_port_classic.h" | 10 #include "ash/aura/shell_port_classic.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
26 #include "chrome/browser/browser_process_platform_part.h" | 26 #include "chrome/browser/browser_process_platform_part.h" |
27 #include "chrome/browser/browser_shutdown.h" | 27 #include "chrome/browser/browser_shutdown.h" |
28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
30 #include "chrome/browser/chromeos/ash_config.h" | 30 #include "chrome/browser/chromeos/ash_config.h" |
31 #include "chrome/browser/lifetime/application_lifetime.h" | 31 #include "chrome/browser/lifetime/application_lifetime.h" |
32 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" | 32 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" |
33 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" | 33 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" |
34 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 34 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 35 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
35 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
36 #include "chromeos/accelerometer/accelerometer_reader.h" | 37 #include "chromeos/accelerometer/accelerometer_reader.h" |
37 #include "chromeos/chromeos_switches.h" | 38 #include "chromeos/chromeos_switches.h" |
38 #include "chromeos/login/login_state.h" | 39 #include "chromeos/login/login_state.h" |
39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/context_factory.h" | 41 #include "content/public/browser/context_factory.h" |
41 #include "content/public/common/service_manager_connection.h" | 42 #include "content/public/common/service_manager_connection.h" |
42 #include "ui/aura/env.h" | 43 #include "ui/aura/env.h" |
43 #include "ui/aura/mus/window_tree_client.h" | 44 #include "ui/aura/mus/window_tree_client.h" |
44 #include "ui/aura/window_tree_host.h" | 45 #include "ui/aura/window_tree_host.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate = | 129 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate = |
129 base::MakeUnique<ChromeScreenshotGrabber>(); | 130 base::MakeUnique<ChromeScreenshotGrabber>(); |
130 accelerator_controller_delegate->SetScreenshotDelegate( | 131 accelerator_controller_delegate->SetScreenshotDelegate( |
131 std::move(screenshot_delegate)); | 132 std::move(screenshot_delegate)); |
132 } | 133 } |
133 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 134 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
134 chromeos::AccelerometerReader::GetInstance()->Initialize( | 135 chromeos::AccelerometerReader::GetInstance()->Initialize( |
135 base::CreateSequencedTaskRunnerWithTraits( | 136 base::CreateSequencedTaskRunnerWithTraits( |
136 {base::MayBlock(), base::TaskPriority::BACKGROUND, | 137 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
137 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); | 138 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); |
| 139 shell->accelerator_controller()->SetImeControlDelegate( |
| 140 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); |
138 shell->high_contrast_controller()->SetEnabled( | 141 shell->high_contrast_controller()->SetEnabled( |
139 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 142 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
140 | 143 |
141 DCHECK(chromeos::MagnificationManager::Get()); | 144 DCHECK(chromeos::MagnificationManager::Get()); |
142 bool magnifier_enabled = | 145 bool magnifier_enabled = |
143 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 146 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
144 ash::MagnifierType magnifier_type = | 147 ash::MagnifierType magnifier_type = |
145 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 148 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
146 shell->magnification_controller()->SetEnabled( | 149 shell->magnification_controller()->SetEnabled( |
147 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); | 150 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); |
148 shell->partial_magnification_controller()->SetEnabled( | 151 shell->partial_magnification_controller()->SetEnabled( |
149 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); | 152 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); |
150 | 153 |
151 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 154 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
152 switches::kDisableZeroBrowsersOpenForTests)) { | 155 switches::kDisableZeroBrowsersOpenForTests)) { |
153 g_browser_process->platform_part()->RegisterKeepAlive(); | 156 g_browser_process->platform_part()->RegisterKeepAlive(); |
154 } | 157 } |
155 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 158 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
156 } | 159 } |
157 | 160 |
158 AshInit::~AshInit() { | 161 AshInit::~AshInit() { |
159 // |window_manager_| deletes the Shell. | 162 // |window_manager_| deletes the Shell. |
160 if (!window_manager_ && ash::Shell::HasInstance()) { | 163 if (!window_manager_ && ash::Shell::HasInstance()) { |
161 ash::Shell::DeleteInstance(); | 164 ash::Shell::DeleteInstance(); |
162 ash::ShellContentState::DestroyInstance(); | 165 ash::ShellContentState::DestroyInstance(); |
163 } | 166 } |
164 } | 167 } |
OLD | NEW |