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::SetMagnifierEnabled(bool enabled) { |
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()->SetMagnifierEnabled(enabled); |
370 #endif | 379 #endif |
371 } | 380 } |
372 | 381 |
| 382 void ChromeShellDelegate::SetMagnifierType(ash::MagnifierType type) { |
| 383 #if defined(OS_CHROMEOS) |
| 384 DCHECK(chromeos::MagnificationManager::Get()); |
| 385 return chromeos::MagnificationManager::Get()->SetMagnifierType(type); |
| 386 #endif |
| 387 } |
| 388 |
373 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { | 389 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
374 #if defined(OS_CHROMEOS) | 390 #if defined(OS_CHROMEOS) |
375 if (!IsUserLoggedIn()) | 391 if (!IsUserLoggedIn()) |
376 return true; | 392 return true; |
377 | 393 |
378 Profile* profile = ProfileManager::GetDefaultProfile(); | 394 Profile* profile = ProfileManager::GetDefaultProfile(); |
379 if (!profile) | 395 if (!profile) |
380 return false; | 396 return false; |
381 | 397 |
382 PrefService* user_pref_service = profile->GetPrefs(); | 398 PrefService* user_pref_service = profile->GetPrefs(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 ash::Shell::GetInstance()->ShowLauncher(); | 573 ash::Shell::GetInstance()->ShowLauncher(); |
558 break; | 574 break; |
559 default: | 575 default: |
560 NOTREACHED() << "Unexpected notification " << type; | 576 NOTREACHED() << "Unexpected notification " << type; |
561 } | 577 } |
562 #else | 578 #else |
563 // MSVC++ warns about switch statements without any cases. | 579 // MSVC++ warns about switch statements without any cases. |
564 NOTREACHED() << "Unexpected notification " << type; | 580 NOTREACHED() << "Unexpected notification " << type; |
565 #endif | 581 #endif |
566 } | 582 } |
OLD | NEW |