| 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/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/host/root_window_host_factory.h" | 7 #include "ash/host/root_window_host_factory.h" |
| 8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
| 9 #include "ash/magnifier/magnifier_constants.h" | 9 #include "ash/magnifier/magnifier_constants.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 #endif | 347 #endif |
| 348 } | 348 } |
| 349 | 349 |
| 350 void ChromeShellDelegate::ToggleHighContrast() { | 350 void ChromeShellDelegate::ToggleHighContrast() { |
| 351 #if defined(OS_CHROMEOS) | 351 #if defined(OS_CHROMEOS) |
| 352 bool enabled = chromeos::accessibility::IsHighContrastEnabled(); | 352 bool enabled = chromeos::accessibility::IsHighContrastEnabled(); |
| 353 chromeos::accessibility::EnableHighContrast(!enabled); | 353 chromeos::accessibility::EnableHighContrast(!enabled); |
| 354 #endif | 354 #endif |
| 355 } | 355 } |
| 356 | 356 |
| 357 bool ChromeShellDelegate::IsMagnifierEnabled() const { |
| 358 #if defined(OS_CHROMEOS) |
| 359 DCHECK(chromeos::MagnificationManager::Get()); |
| 360 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
| 361 #else |
| 362 return false; |
| 363 #endif |
| 364 } |
| 365 |
| 357 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const { | 366 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const { |
| 358 #if defined(OS_CHROMEOS) | 367 #if defined(OS_CHROMEOS) |
| 359 DCHECK(chromeos::MagnificationManager::Get()); | 368 DCHECK(chromeos::MagnificationManager::Get()); |
| 360 return chromeos::MagnificationManager::Get()->GetMagnifierType(); | 369 return chromeos::MagnificationManager::Get()->GetMagnifierType(); |
| 361 #else | 370 #else |
| 362 return ash::MAGNIFIER_OFF; | 371 return ash::MAGNIFIER_OFF; |
| 363 #endif | 372 #endif |
| 364 } | 373 } |
| 365 | 374 |
| 366 void ChromeShellDelegate::SetMagnifier(ash::MagnifierType type) { | 375 void ChromeShellDelegate::SetMagnifier(bool enabled, ash::MagnifierType type) { |
| 367 #if defined(OS_CHROMEOS) | 376 #if defined(OS_CHROMEOS) |
| 368 DCHECK(chromeos::MagnificationManager::Get()); | 377 DCHECK(chromeos::MagnificationManager::Get()); |
| 369 return chromeos::MagnificationManager::Get()->SetMagnifier(type); | 378 return chromeos::MagnificationManager::Get()->SetMagnifier(enabled, type); |
| 370 #endif | 379 #endif |
| 371 } | 380 } |
| 372 | 381 |
| 373 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { | 382 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
| 374 #if defined(OS_CHROMEOS) | 383 #if defined(OS_CHROMEOS) |
| 375 if (!IsUserLoggedIn()) | 384 if (!IsUserLoggedIn()) |
| 376 return true; | 385 return true; |
| 377 | 386 |
| 378 Profile* profile = ProfileManager::GetDefaultProfile(); | 387 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 379 if (!profile) | 388 if (!profile) |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 ash::Shell::GetInstance()->ShowLauncher(); | 566 ash::Shell::GetInstance()->ShowLauncher(); |
| 558 break; | 567 break; |
| 559 default: | 568 default: |
| 560 NOTREACHED() << "Unexpected notification " << type; | 569 NOTREACHED() << "Unexpected notification " << type; |
| 561 } | 570 } |
| 562 #else | 571 #else |
| 563 // MSVC++ warns about switch statements without any cases. | 572 // MSVC++ warns about switch statements without any cases. |
| 564 NOTREACHED() << "Unexpected notification " << type; | 573 NOTREACHED() << "Unexpected notification " << type; |
| 565 #endif | 574 #endif |
| 566 } | 575 } |
| OLD | NEW |