Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 return chromeos::MagnificationManager::Get() | 275 return chromeos::MagnificationManager::Get() |
| 276 ->GetSavedScreenMagnifierScale(); | 276 ->GetSavedScreenMagnifierScale(); |
| 277 } | 277 } |
| 278 return std::numeric_limits<double>::min(); | 278 return std::numeric_limits<double>::min(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void TriggerAccessibilityAlert(ash::AccessibilityAlert alert) override { | 281 void TriggerAccessibilityAlert(ash::AccessibilityAlert alert) override { |
| 282 Profile* profile = ProfileManager::GetActiveUserProfile(); | 282 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 283 if (profile) { | 283 if (profile) { |
| 284 switch (alert) { | 284 switch (alert) { |
| 285 case ash::A11Y_ALERT_WINDOW_NEEDED: { | 285 case ash::A11Y_ALERT_CAPS_ON: { |
|
dmazzoni
2016/11/10 22:15:18
How about refactoring this as a concise switch tha
oshima
2016/11/10 22:41:40
+1
David Tseng
2016/11/10 23:46:04
Done.
| |
| 286 AutomationManagerAura::GetInstance()->HandleAlert( | 286 AutomationManagerAura::GetInstance()->HandleAlert( |
| 287 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); | 287 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_CAPS_ON)); |
| 288 break; | 288 break; |
| 289 } | 289 } |
| 290 case ash::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { | 290 case ash::A11Y_ALERT_CAPS_OFF: { |
| 291 AutomationManagerAura::GetInstance()->HandleAlert( | 291 AutomationManagerAura::GetInstance()->HandleAlert( |
| 292 profile, l10n_util::GetStringUTF8( | 292 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_CAPS_OFF)); |
| 293 IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); | 293 break; |
| 294 break; | 294 } |
| 295 } | 295 case ash::A11Y_ALERT_WINDOW_NEEDED: { |
| 296 case ash::A11Y_ALERT_NONE: | 296 AutomationManagerAura::GetInstance()->HandleAlert( |
| 297 break; | 297 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); |
| 298 break; | |
| 299 } | |
| 300 case ash::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { | |
| 301 AutomationManagerAura::GetInstance()->HandleAlert( | |
| 302 profile, l10n_util::GetStringUTF8( | |
| 303 IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); | |
| 304 break; | |
| 305 } | |
| 306 case ash::A11Y_ALERT_NONE: | |
| 307 break; | |
| 298 } | 308 } |
| 299 } | 309 } |
| 300 } | 310 } |
| 301 | 311 |
| 302 ash::AccessibilityAlert GetLastAccessibilityAlert() override { | 312 ash::AccessibilityAlert GetLastAccessibilityAlert() override { |
| 303 return ash::A11Y_ALERT_NONE; | 313 return ash::A11Y_ALERT_NONE; |
| 304 } | 314 } |
| 305 | 315 |
| 306 void PlayEarcon(int sound_key) override { | 316 void PlayEarcon(int sound_key) override { |
| 307 DCHECK(AccessibilityManager::Get()); | 317 DCHECK(AccessibilityManager::Get()); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 NOTREACHED() << "Unexpected notification " << type; | 557 NOTREACHED() << "Unexpected notification " << type; |
| 548 } | 558 } |
| 549 } | 559 } |
| 550 | 560 |
| 551 void ChromeShellDelegate::PlatformInit() { | 561 void ChromeShellDelegate::PlatformInit() { |
| 552 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 562 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 553 content::NotificationService::AllSources()); | 563 content::NotificationService::AllSources()); |
| 554 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 564 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 555 content::NotificationService::AllSources()); | 565 content::NotificationService::AllSources()); |
| 556 } | 566 } |
| OLD | NEW |