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

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

Issue 11642014: Re-introduce the partial magnifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the build failure on win_aura Created 7 years, 11 months 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 | Annotate | Revision Log
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/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
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);
371 #endif 380 #endif
372 } 381 }
373 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
388 }
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)
381 return false; 397 return false;
382 398
383 PrefService* user_pref_service = profile->GetPrefs(); 399 PrefService* user_pref_service = profile->GetPrefs();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698