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

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 150403005: Chrome OS Accessibility: enable cursor compositing when screen magnifier is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not forward synthesized MOUSE_MOVED/DRAGGED events to CursorWindowController. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/accessibility_manager.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index 1302c4694e627294b4b71f1ad46e4c825c8f9bc2..37f4468312e7e4d71d58e4711298c6990eda4964 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -359,6 +359,21 @@ bool AccessibilityManager::ShouldShowAccessibilityMenu() {
return false;
}
+bool AccessibilityManager::ShouldEnableCursorCompositing() {
+#if defined(OS_CHROMEOS)
+ if (!profile_)
+ return false;
+ PrefService* pref_service = profile_->GetPrefs();
+ // Enable cursor compositing when one or more of the listed accessibility
+ // features are turned on.
+ if (pref_service->GetBoolean(prefs::kLargeCursorEnabled) ||
+ pref_service->GetBoolean(prefs::kHighContrastEnabled) ||
+ pref_service->GetBoolean(prefs::kScreenMagnifierEnabled))
+ return true;
+#endif
+ return false;
+}
+
void AccessibilityManager::EnableLargeCursor(bool enabled) {
if (!profile_)
return;
@@ -393,9 +408,8 @@ void AccessibilityManager::UpdateLargeCursorFromPref() {
#endif
#if defined(OS_CHROMEOS)
- // Enable cursor compositing mode when using high contrast or large cursor.
ash::Shell::GetInstance()->SetCursorCompositingEnabled(
- large_cursor_enabled_ || high_contrast_enabled_);
+ ShouldEnableCursorCompositing());
#endif
}
@@ -599,9 +613,8 @@ void AccessibilityManager::UpdateHighContrastFromPref() {
#endif
#if defined(OS_CHROMEOS)
- // Enable cursor compositing mode when using high contrast or large cursor.
ash::Shell::GetInstance()->SetCursorCompositingEnabled(
- large_cursor_enabled_ || high_contrast_enabled_);
+ ShouldEnableCursorCompositing());
#endif
}

Powered by Google App Engine
This is Rietveld 408576698