| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/accessibility/accessibility_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 6 | 6 |
| 7 #include "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
| 8 #include "ash/autoclick/autoclick_controller.h" | 8 #include "ash/autoclick/autoclick_controller.h" |
| 9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 content::NotificationService::current()->Notify( | 387 content::NotificationService::current()->Notify( |
| 388 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_LARGE_CURSOR, | 388 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_LARGE_CURSOR, |
| 389 content::NotificationService::AllSources(), | 389 content::NotificationService::AllSources(), |
| 390 content::Details<AccessibilityStatusEventDetails>(&details)); | 390 content::Details<AccessibilityStatusEventDetails>(&details)); |
| 391 | 391 |
| 392 #if defined(USE_ASH) | 392 #if defined(USE_ASH) |
| 393 // Large cursor is implemented only in ash. | 393 // Large cursor is implemented only in ash. |
| 394 ash::Shell::GetInstance()->cursor_manager()->SetCursorSet( | 394 ash::Shell::GetInstance()->cursor_manager()->SetCursorSet( |
| 395 enabled ? ui::CURSOR_SET_LARGE : ui::CURSOR_SET_NORMAL); | 395 enabled ? ui::CURSOR_SET_LARGE : ui::CURSOR_SET_NORMAL); |
| 396 #endif | 396 #endif |
| 397 |
| 398 #if defined(OS_CHROMEOS) |
| 399 // Enable cursor compositing mode when using high contrast or large cursor. |
| 400 ash::Shell::GetInstance()->SetCursorCompositingEnabled( |
| 401 large_cursor_enabled_ || high_contrast_enabled_); |
| 402 #endif |
| 397 } | 403 } |
| 398 | 404 |
| 399 bool AccessibilityManager::IsIncognitoAllowed() { | 405 bool AccessibilityManager::IsIncognitoAllowed() { |
| 400 UserManager* user_manager = UserManager::Get(); | 406 UserManager* user_manager = UserManager::Get(); |
| 401 // Supervised users can't create incognito-mode windows. | 407 // Supervised users can't create incognito-mode windows. |
| 402 return !(user_manager->IsLoggedInAsLocallyManagedUser()); | 408 return !(user_manager->IsLoggedInAsLocallyManagedUser()); |
| 403 } | 409 } |
| 404 | 410 |
| 405 bool AccessibilityManager::IsLargeCursorEnabled() { | 411 bool AccessibilityManager::IsLargeCursorEnabled() { |
| 406 return large_cursor_enabled_; | 412 return large_cursor_enabled_; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 591 |
| 586 AccessibilityStatusEventDetails detail(enabled, ash::A11Y_NOTIFICATION_NONE); | 592 AccessibilityStatusEventDetails detail(enabled, ash::A11Y_NOTIFICATION_NONE); |
| 587 content::NotificationService::current()->Notify( | 593 content::NotificationService::current()->Notify( |
| 588 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, | 594 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, |
| 589 content::NotificationService::AllSources(), | 595 content::NotificationService::AllSources(), |
| 590 content::Details<AccessibilityStatusEventDetails>(&detail)); | 596 content::Details<AccessibilityStatusEventDetails>(&detail)); |
| 591 | 597 |
| 592 #if defined(USE_ASH) | 598 #if defined(USE_ASH) |
| 593 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(enabled); | 599 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(enabled); |
| 594 #endif | 600 #endif |
| 601 |
| 602 #if defined(OS_CHROMEOS) |
| 603 // Enable cursor compositing mode when using high contrast or large cursor. |
| 604 ash::Shell::GetInstance()->SetCursorCompositingEnabled( |
| 605 large_cursor_enabled_ || high_contrast_enabled_); |
| 606 #endif |
| 595 } | 607 } |
| 596 | 608 |
| 597 void AccessibilityManager::LocalePrefChanged() { | 609 void AccessibilityManager::LocalePrefChanged() { |
| 598 if (!profile_) | 610 if (!profile_) |
| 599 return; | 611 return; |
| 600 | 612 |
| 601 if (!IsSpokenFeedbackEnabled()) | 613 if (!IsSpokenFeedbackEnabled()) |
| 602 return; | 614 return; |
| 603 | 615 |
| 604 // If the system locale changes and spoken feedback is enabled, | 616 // If the system locale changes and spoken feedback is enabled, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 | 946 |
| 935 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 947 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 936 // Do any teardown work needed immediately after ChromeVox actually unloads. | 948 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 937 if (system_sounds_enabled_) { | 949 if (system_sounds_enabled_) { |
| 938 ash::PlaySystemSound(SOUND_SPOKEN_FEEDBACK_DISABLED, | 950 ash::PlaySystemSound(SOUND_SPOKEN_FEEDBACK_DISABLED, |
| 939 false /* honor_spoken_feedback */); | 951 false /* honor_spoken_feedback */); |
| 940 } | 952 } |
| 941 } | 953 } |
| 942 | 954 |
| 943 } // namespace chromeos | 955 } // namespace chromeos |
| OLD | NEW |