Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 11415025: A11y: Introduce High Contrast Mode and Screen Magnifier to ubar tray. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review fix (comment #10) Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/launcher/launcher_types.h" 7 #include "ash/launcher/launcher_types.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/wm/stacking_controller.h" 9 #include "ash/wm/stacking_controller.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 334
335 bool ChromeShellDelegate::IsSpokenFeedbackEnabled() const { 335 bool ChromeShellDelegate::IsSpokenFeedbackEnabled() const {
336 #if defined(OS_CHROMEOS) 336 #if defined(OS_CHROMEOS)
337 return chromeos::accessibility::IsSpokenFeedbackEnabled(); 337 return chromeos::accessibility::IsSpokenFeedbackEnabled();
338 #else 338 #else
339 return false; 339 return false;
340 #endif 340 #endif
341 } 341 }
342 342
343 bool ChromeShellDelegate::IsHighContrastEnabled() const {
344 #if defined(OS_CHROMEOS)
345 return chromeos::accessibility::IsHighContrastEnabled();
346 #else
347 return false;
348 #endif
349 }
350
351 void ChromeShellDelegate::ToggleHighContrast() {
352 #if defined(OS_CHROMEOS)
353 bool enabled = chromeos::accessibility::IsHighContrastEnabled();
354 chromeos::accessibility::EnableHighContrast(!enabled);
355 #endif
356 }
357
358 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const {
359 #if defined(OS_CHROMEOS)
360 return chromeos::accessibility::GetMagnifierType();
361 #else
362 return ash::MAGNIFIER_NONE;
363 #endif
364 }
365
366 void ChromeShellDelegate::SetScreenMagnifier(ash::MagnifierType type) {
367 #if defined(OS_CHROMEOS)
368 chromeos::accessibility::SetScreenMagnifier(type);
369 #endif
370 }
371
372 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const {
373 #if defined(OS_CHROMEOS)
374 // TODO(yoshiki): Add the checkbox on chrome://settings. crbug.com/158287
375 return false;
376 #else
377 return false;
378 #endif
379 }
380
343 app_list::AppListViewDelegate* 381 app_list::AppListViewDelegate*
344 ChromeShellDelegate::CreateAppListViewDelegate() { 382 ChromeShellDelegate::CreateAppListViewDelegate() {
345 DCHECK(ash::Shell::HasInstance()); 383 DCHECK(ash::Shell::HasInstance());
346 // Shell will own the created delegate, and the delegate will own 384 // Shell will own the created delegate, and the delegate will own
347 // the controller. 385 // the controller.
348 return new AppListViewDelegate(new AppListControllerDelegateAsh()); 386 return new AppListViewDelegate(new AppListControllerDelegateAsh());
349 } 387 }
350 388
351 ash::LauncherDelegate* ChromeShellDelegate::CreateLauncherDelegate( 389 ash::LauncherDelegate* ChromeShellDelegate::CreateLauncherDelegate(
352 ash::LauncherModel* model) { 390 ash::LauncherModel* model) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 ash::Shell::GetInstance()->ShowLauncher(); 540 ash::Shell::GetInstance()->ShowLauncher();
503 break; 541 break;
504 default: 542 default:
505 NOTREACHED() << "Unexpected notification " << type; 543 NOTREACHED() << "Unexpected notification " << type;
506 } 544 }
507 #else 545 #else
508 // MSVC++ warns about switch statements without any cases. 546 // MSVC++ warns about switch statements without any cases.
509 NOTREACHED() << "Unexpected notification " << type; 547 NOTREACHED() << "Unexpected notification " << type;
510 #endif 548 #endif
511 } 549 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698