| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if (chromeos::MagnificationManager::Get()) { | 274 if (chromeos::MagnificationManager::Get()) { |
| 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 int msg = 0; |
| 284 switch (alert) { | 285 switch (alert) { |
| 285 case ash::A11Y_ALERT_WINDOW_NEEDED: { | 286 case ash::A11Y_ALERT_CAPS_ON: |
| 286 AutomationManagerAura::GetInstance()->HandleAlert( | 287 msg = IDS_A11Y_ALERT_CAPS_ON; |
| 287 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); | |
| 288 break; | 288 break; |
| 289 } | 289 case ash::A11Y_ALERT_CAPS_OFF: |
| 290 case ash::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { | 290 msg = IDS_A11Y_ALERT_CAPS_OFF; |
| 291 AutomationManagerAura::GetInstance()->HandleAlert( | |
| 292 profile, l10n_util::GetStringUTF8( | |
| 293 IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); | |
| 294 break; | 291 break; |
| 295 } | 292 case ash::A11Y_ALERT_WINDOW_NEEDED: |
| 293 msg = IDS_A11Y_ALERT_WINDOW_NEEDED; |
| 294 break; |
| 295 case ash::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: |
| 296 msg = IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED; |
| 297 break; |
| 296 case ash::A11Y_ALERT_NONE: | 298 case ash::A11Y_ALERT_NONE: |
| 299 msg = 0; |
| 297 break; | 300 break; |
| 298 } | 301 } |
| 302 |
| 303 if (msg) { |
| 304 AutomationManagerAura::GetInstance()->HandleAlert( |
| 305 profile, l10n_util::GetStringUTF8(msg)); |
| 306 } |
| 299 } | 307 } |
| 300 } | 308 } |
| 301 | 309 |
| 302 ash::AccessibilityAlert GetLastAccessibilityAlert() override { | 310 ash::AccessibilityAlert GetLastAccessibilityAlert() override { |
| 303 return ash::A11Y_ALERT_NONE; | 311 return ash::A11Y_ALERT_NONE; |
| 304 } | 312 } |
| 305 | 313 |
| 306 void PlaySpokenFeedbackToggleCountdown(int tick_count) override { | 314 void PlaySpokenFeedbackToggleCountdown(int tick_count) override { |
| 307 DCHECK(AccessibilityManager::Get()); | 315 DCHECK(AccessibilityManager::Get()); |
| 308 AccessibilityManager::Get()->PlaySpokenFeedbackToggleCountdown(tick_count); | 316 AccessibilityManager::Get()->PlaySpokenFeedbackToggleCountdown(tick_count); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 NOTREACHED() << "Unexpected notification " << type; | 560 NOTREACHED() << "Unexpected notification " << type; |
| 553 } | 561 } |
| 554 } | 562 } |
| 555 | 563 |
| 556 void ChromeShellDelegate::PlatformInit() { | 564 void ChromeShellDelegate::PlatformInit() { |
| 557 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 565 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 558 content::NotificationService::AllSources()); | 566 content::NotificationService::AllSources()); |
| 559 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 567 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 560 content::NotificationService::AllSources()); | 568 content::NotificationService::AllSources()); |
| 561 } | 569 } |
| OLD | NEW |