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/common/accessibility_types.h" |
8 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.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" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 78 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
78 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 79 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
79 shell->accelerator_controller()->SetImeControlDelegate( | 80 shell->accelerator_controller()->SetImeControlDelegate( |
80 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); | 81 std::unique_ptr<ash::ImeControlDelegate>(new ImeController)); |
81 shell->high_contrast_controller()->SetEnabled( | 82 shell->high_contrast_controller()->SetEnabled( |
82 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 83 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
83 | 84 |
84 DCHECK(chromeos::MagnificationManager::Get()); | 85 DCHECK(chromeos::MagnificationManager::Get()); |
85 bool magnifier_enabled = | 86 bool magnifier_enabled = |
86 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 87 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
87 ui::MagnifierType magnifier_type = | 88 ash::MagnifierType magnifier_type = |
88 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 89 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
89 shell->magnification_controller()-> | 90 shell->magnification_controller()->SetEnabled( |
90 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_FULL); | 91 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); |
91 shell->partial_magnification_controller()-> | 92 shell->partial_magnification_controller()->SetEnabled( |
92 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_PARTIAL); | 93 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); |
93 | 94 |
94 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 95 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
95 switches::kDisableZeroBrowsersOpenForTests)) { | 96 switches::kDisableZeroBrowsersOpenForTests)) { |
96 g_browser_process->platform_part()->RegisterKeepAlive(); | 97 g_browser_process->platform_part()->RegisterKeepAlive(); |
97 } | 98 } |
98 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 99 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
99 } | 100 } |
100 | 101 |
101 void InitializeMash() { | 102 void InitializeMash() { |
102 #if defined(MOJO_SHELL_CLIENT) | 103 #if defined(MOJO_SHELL_CLIENT) |
103 DCHECK(!ash::Shell::HasInstance()); | 104 DCHECK(!ash::Shell::HasInstance()); |
104 ChromeLauncherControllerMus::CreateInstance()->Init(); | 105 ChromeLauncherControllerMus::CreateInstance()->Init(); |
105 #endif | 106 #endif |
106 } | 107 } |
107 | 108 |
108 void CloseAsh() { | 109 void CloseAsh() { |
109 if (ash::Shell::HasInstance()) { | 110 if (ash::Shell::HasInstance()) { |
110 ash::Shell::DeleteInstance(); | 111 ash::Shell::DeleteInstance(); |
111 ash::ShellContentState::DestroyInstance(); | 112 ash::ShellContentState::DestroyInstance(); |
112 } | 113 } |
113 } | 114 } |
114 | 115 |
115 } // namespace chrome | 116 } // namespace chrome |
OLD | NEW |