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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 #endif | 348 #endif |
349 } | 349 } |
350 | 350 |
351 void ChromeShellDelegate::ToggleHighContrast() { | 351 void ChromeShellDelegate::ToggleHighContrast() { |
352 #if defined(OS_CHROMEOS) | 352 #if defined(OS_CHROMEOS) |
353 bool enabled = chromeos::accessibility::IsHighContrastEnabled(); | 353 bool enabled = chromeos::accessibility::IsHighContrastEnabled(); |
354 chromeos::accessibility::EnableHighContrast(!enabled); | 354 chromeos::accessibility::EnableHighContrast(!enabled); |
355 #endif | 355 #endif |
356 } | 356 } |
357 | 357 |
| 358 bool ChromeShellDelegate::IsMagnifierEnabled() const { |
| 359 #if defined(OS_CHROMEOS) |
| 360 DCHECK(chromeos::MagnificationManager::Get()); |
| 361 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
| 362 #else |
| 363 return false; |
| 364 #endif |
| 365 } |
| 366 |
358 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const { | 367 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const { |
359 #if defined(OS_CHROMEOS) | 368 #if defined(OS_CHROMEOS) |
360 DCHECK(chromeos::MagnificationManager::Get()); | 369 DCHECK(chromeos::MagnificationManager::Get()); |
361 return chromeos::MagnificationManager::Get()->GetMagnifierType(); | 370 return chromeos::MagnificationManager::Get()->GetMagnifierType(); |
362 #else | 371 #else |
363 return ash::MAGNIFIER_OFF; | 372 return ash::kDefaultMagnifierType; |
364 #endif | 373 #endif |
365 } | 374 } |
366 | 375 |
367 void ChromeShellDelegate::SetMagnifier(ash::MagnifierType type) { | 376 void ChromeShellDelegate::SetMagnifierEnabled(bool enabled) { |
368 #if defined(OS_CHROMEOS) | 377 #if defined(OS_CHROMEOS) |
369 DCHECK(chromeos::MagnificationManager::Get()); | 378 DCHECK(chromeos::MagnificationManager::Get()); |
370 return chromeos::MagnificationManager::Get()->SetMagnifier(type); | 379 return chromeos::MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
| 380 #endif |
| 381 } |
| 382 |
| 383 void ChromeShellDelegate::SetMagnifierType(ash::MagnifierType type) { |
| 384 #if defined(OS_CHROMEOS) |
| 385 DCHECK(chromeos::MagnificationManager::Get()); |
| 386 return chromeos::MagnificationManager::Get()->SetMagnifierType(type); |
371 #endif | 387 #endif |
372 } | 388 } |
373 | 389 |
374 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { | 390 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
375 #if defined(OS_CHROMEOS) | 391 #if defined(OS_CHROMEOS) |
376 if (!IsUserLoggedIn()) | 392 if (!IsUserLoggedIn()) |
377 return true; | 393 return true; |
378 | 394 |
379 Profile* profile = ProfileManager::GetDefaultProfile(); | 395 Profile* profile = ProfileManager::GetDefaultProfile(); |
380 if (!profile) | 396 if (!profile) |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 ash::Shell::GetInstance()->ShowLauncher(); | 577 ash::Shell::GetInstance()->ShowLauncher(); |
562 break; | 578 break; |
563 default: | 579 default: |
564 NOTREACHED() << "Unexpected notification " << type; | 580 NOTREACHED() << "Unexpected notification " << type; |
565 } | 581 } |
566 #else | 582 #else |
567 // MSVC++ warns about switch statements without any cases. | 583 // MSVC++ warns about switch statements without any cases. |
568 NOTREACHED() << "Unexpected notification " << type; | 584 NOTREACHED() << "Unexpected notification " << type; |
569 #endif | 585 #endif |
570 } | 586 } |
OLD | NEW |