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