| 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 "ash/accelerators/magnifier_key_scroller.h" | 9 #include "ash/accelerators/magnifier_key_scroller.h" |
| 10 #include "ash/accelerators/spoken_feedback_toggler.h" | 10 #include "ash/accelerators/spoken_feedback_toggler.h" |
| 11 #include "ash/aura/wm_window_aura.h" | 11 #include "ash/aura/wm_window_aura.h" |
| 12 #include "ash/common/accessibility_delegate.h" | 12 #include "ash/common/accessibility_delegate.h" |
| 13 #include "ash/common/accessibility_types.h" |
| 13 #include "ash/common/session/session_state_delegate.h" | 14 #include "ash/common/session/session_state_delegate.h" |
| 14 #include "ash/common/wm/mru_window_tracker.h" | 15 #include "ash/common/wm/mru_window_tracker.h" |
| 15 #include "ash/common/wm/window_state.h" | 16 #include "ash/common/wm/window_state.h" |
| 16 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 17 #include "ash/container_delegate_aura.h" | 18 #include "ash/container_delegate_aura.h" |
| 18 #include "ash/content/gpu_support_impl.h" | 19 #include "ash/content/gpu_support_impl.h" |
| 19 #include "ash/pointer_watcher_delegate_aura.h" | 20 #include "ash/pointer_watcher_delegate_aura.h" |
| 20 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 21 #include "ash/wm/window_util.h" | 22 #include "ash/wm/window_util.h" |
| 22 #include "base/command_line.h" | 23 #include "base/command_line.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 chromeos::AccessibilityManager::Get()->EnableHighContrast( | 116 chromeos::AccessibilityManager::Get()->EnableHighContrast( |
| 116 !chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 117 !chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
| 117 } | 118 } |
| 118 | 119 |
| 119 bool IsSpokenFeedbackEnabled() const override { | 120 bool IsSpokenFeedbackEnabled() const override { |
| 120 DCHECK(chromeos::AccessibilityManager::Get()); | 121 DCHECK(chromeos::AccessibilityManager::Get()); |
| 121 return chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled(); | 122 return chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled(); |
| 122 } | 123 } |
| 123 | 124 |
| 124 void ToggleSpokenFeedback( | 125 void ToggleSpokenFeedback( |
| 125 ui::AccessibilityNotificationVisibility notify) override { | 126 ash::AccessibilityNotificationVisibility notify) override { |
| 126 DCHECK(chromeos::AccessibilityManager::Get()); | 127 DCHECK(chromeos::AccessibilityManager::Get()); |
| 127 chromeos::AccessibilityManager::Get()->ToggleSpokenFeedback(notify); | 128 chromeos::AccessibilityManager::Get()->ToggleSpokenFeedback(notify); |
| 128 } | 129 } |
| 129 | 130 |
| 130 bool IsHighContrastEnabled() const override { | 131 bool IsHighContrastEnabled() const override { |
| 131 DCHECK(chromeos::AccessibilityManager::Get()); | 132 DCHECK(chromeos::AccessibilityManager::Get()); |
| 132 return chromeos::AccessibilityManager::Get()->IsHighContrastEnabled(); | 133 return chromeos::AccessibilityManager::Get()->IsHighContrastEnabled(); |
| 133 } | 134 } |
| 134 | 135 |
| 135 void SetMagnifierEnabled(bool enabled) override { | 136 void SetMagnifierEnabled(bool enabled) override { |
| 136 DCHECK(chromeos::MagnificationManager::Get()); | 137 DCHECK(chromeos::MagnificationManager::Get()); |
| 137 return chromeos::MagnificationManager::Get()->SetMagnifierEnabled(enabled); | 138 return chromeos::MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
| 138 } | 139 } |
| 139 | 140 |
| 140 void SetMagnifierType(ui::MagnifierType type) override { | 141 void SetMagnifierType(ash::MagnifierType type) override { |
| 141 DCHECK(chromeos::MagnificationManager::Get()); | 142 DCHECK(chromeos::MagnificationManager::Get()); |
| 142 return chromeos::MagnificationManager::Get()->SetMagnifierType(type); | 143 return chromeos::MagnificationManager::Get()->SetMagnifierType(type); |
| 143 } | 144 } |
| 144 | 145 |
| 145 bool IsMagnifierEnabled() const override { | 146 bool IsMagnifierEnabled() const override { |
| 146 DCHECK(chromeos::MagnificationManager::Get()); | 147 DCHECK(chromeos::MagnificationManager::Get()); |
| 147 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 148 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
| 148 } | 149 } |
| 149 | 150 |
| 150 ui::MagnifierType GetMagnifierType() const override { | 151 ash::MagnifierType GetMagnifierType() const override { |
| 151 DCHECK(chromeos::MagnificationManager::Get()); | 152 DCHECK(chromeos::MagnificationManager::Get()); |
| 152 return chromeos::MagnificationManager::Get()->GetMagnifierType(); | 153 return chromeos::MagnificationManager::Get()->GetMagnifierType(); |
| 153 } | 154 } |
| 154 | 155 |
| 155 void SetLargeCursorEnabled(bool enabled) override { | 156 void SetLargeCursorEnabled(bool enabled) override { |
| 156 DCHECK(chromeos::AccessibilityManager::Get()); | 157 DCHECK(chromeos::AccessibilityManager::Get()); |
| 157 return chromeos::AccessibilityManager::Get()->EnableLargeCursor(enabled); | 158 return chromeos::AccessibilityManager::Get()->EnableLargeCursor(enabled); |
| 158 } | 159 } |
| 159 | 160 |
| 160 bool IsLargeCursorEnabled() const override { | 161 bool IsLargeCursorEnabled() const override { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 264 } |
| 264 | 265 |
| 265 double GetSavedScreenMagnifierScale() override { | 266 double GetSavedScreenMagnifierScale() override { |
| 266 if (chromeos::MagnificationManager::Get()) { | 267 if (chromeos::MagnificationManager::Get()) { |
| 267 return chromeos::MagnificationManager::Get() | 268 return chromeos::MagnificationManager::Get() |
| 268 ->GetSavedScreenMagnifierScale(); | 269 ->GetSavedScreenMagnifierScale(); |
| 269 } | 270 } |
| 270 return std::numeric_limits<double>::min(); | 271 return std::numeric_limits<double>::min(); |
| 271 } | 272 } |
| 272 | 273 |
| 273 void TriggerAccessibilityAlert(ui::AccessibilityAlert alert) override { | 274 void TriggerAccessibilityAlert(ash::AccessibilityAlert alert) override { |
| 274 Profile* profile = ProfileManager::GetActiveUserProfile(); | 275 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 275 if (profile) { | 276 if (profile) { |
| 276 switch (alert) { | 277 switch (alert) { |
| 277 case ui::A11Y_ALERT_WINDOW_NEEDED: { | 278 case ash::A11Y_ALERT_WINDOW_NEEDED: { |
| 278 AutomationManagerAura::GetInstance()->HandleAlert( | 279 AutomationManagerAura::GetInstance()->HandleAlert( |
| 279 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); | 280 profile, l10n_util::GetStringUTF8(IDS_A11Y_ALERT_WINDOW_NEEDED)); |
| 280 break; | 281 break; |
| 281 } | 282 } |
| 282 case ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { | 283 case ash::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED: { |
| 283 AutomationManagerAura::GetInstance()->HandleAlert( | 284 AutomationManagerAura::GetInstance()->HandleAlert( |
| 284 profile, l10n_util::GetStringUTF8( | 285 profile, l10n_util::GetStringUTF8( |
| 285 IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); | 286 IDS_A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED)); |
| 286 break; | 287 break; |
| 287 } | 288 } |
| 288 case ui::A11Y_ALERT_NONE: | 289 case ash::A11Y_ALERT_NONE: |
| 289 break; | 290 break; |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 } | 293 } |
| 293 | 294 |
| 294 ui::AccessibilityAlert GetLastAccessibilityAlert() override { | 295 ash::AccessibilityAlert GetLastAccessibilityAlert() override { |
| 295 return ui::A11Y_ALERT_NONE; | 296 return ash::A11Y_ALERT_NONE; |
| 296 } | 297 } |
| 297 | 298 |
| 298 void PlayEarcon(int sound_key) override { | 299 void PlayEarcon(int sound_key) override { |
| 299 DCHECK(chromeos::AccessibilityManager::Get()); | 300 DCHECK(chromeos::AccessibilityManager::Get()); |
| 300 return chromeos::AccessibilityManager::Get()->PlayEarcon(sound_key); | 301 return chromeos::AccessibilityManager::Get()->PlayEarcon(sound_key); |
| 301 } | 302 } |
| 302 | 303 |
| 303 base::TimeDelta PlayShutdownSound() const override { | 304 base::TimeDelta PlayShutdownSound() const override { |
| 304 return chromeos::AccessibilityManager::Get()->PlayShutdownSound(); | 305 return chromeos::AccessibilityManager::Get()->PlayShutdownSound(); |
| 305 } | 306 } |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 NOTREACHED() << "Unexpected notification " << type; | 565 NOTREACHED() << "Unexpected notification " << type; |
| 565 } | 566 } |
| 566 } | 567 } |
| 567 | 568 |
| 568 void ChromeShellDelegate::PlatformInit() { | 569 void ChromeShellDelegate::PlatformInit() { |
| 569 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 570 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 570 content::NotificationService::AllSources()); | 571 content::NotificationService::AllSources()); |
| 571 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 572 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 572 content::NotificationService::AllSources()); | 573 content::NotificationService::AllSources()); |
| 573 } | 574 } |
| OLD | NEW |