| 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/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
| 10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
| 90 shell->accelerator_controller()->SetBrightnessControlDelegate( | 90 shell->accelerator_controller()->SetBrightnessControlDelegate( |
| 91 scoped_ptr<ash::BrightnessControlDelegate>( | 91 scoped_ptr<ash::BrightnessControlDelegate>( |
| 92 new BrightnessController).Pass()); | 92 new BrightnessController).Pass()); |
| 93 shell->accelerator_controller()->SetImeControlDelegate( | 93 shell->accelerator_controller()->SetImeControlDelegate( |
| 94 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 94 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
| 95 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 95 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
| 96 chromeos::accessibility::IsHighContrastEnabled()); | 96 chromeos::accessibility::IsHighContrastEnabled()); |
| 97 | 97 |
| 98 DCHECK(chromeos::MagnificationManager::Get()); | 98 DCHECK(chromeos::MagnificationManager::Get()); |
| 99 bool magnifier_enabled = | |
| 100 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | |
| 101 ash::MagnifierType magnifier_type = | 99 ash::MagnifierType magnifier_type = |
| 102 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 100 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
| 103 ash::Shell::GetInstance()->magnification_controller()-> | 101 ash::Shell::GetInstance()->magnification_controller()->SetEnabled( |
| 104 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); | 102 magnifier_type == ash::MAGNIFIER_FULL); |
| 105 ash::Shell::GetInstance()->partial_magnification_controller()-> | 103 ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled( |
| 106 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); | 104 magnifier_type == ash::MAGNIFIER_PARTIAL); |
| 107 | 105 |
| 108 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 106 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 109 switches::kDisableZeroBrowsersOpenForTests)) { | 107 switches::kDisableZeroBrowsersOpenForTests)) { |
| 110 browser::StartKeepAlive(); | 108 browser::StartKeepAlive(); |
| 111 } | 109 } |
| 112 #endif | 110 #endif |
| 113 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 111 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
| 114 } | 112 } |
| 115 | 113 |
| 116 void CloseAsh() { | 114 void CloseAsh() { |
| 117 if (ash::Shell::HasInstance()) | 115 if (ash::Shell::HasInstance()) |
| 118 ash::Shell::DeleteInstance(); | 116 ash::Shell::DeleteInstance(); |
| 119 } | 117 } |
| 120 | 118 |
| 121 } // namespace chrome | 119 } // namespace chrome |
| OLD | NEW |