| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 bool AccessibilityManager::IsFocusHighlightEnabled() const { | 1009 bool AccessibilityManager::IsFocusHighlightEnabled() const { |
| 1010 return focus_highlight_enabled_; | 1010 return focus_highlight_enabled_; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 void AccessibilityManager::UpdateFocusHighlightFromPref() { | 1013 void AccessibilityManager::UpdateFocusHighlightFromPref() { |
| 1014 if (!profile_) | 1014 if (!profile_) |
| 1015 return; | 1015 return; |
| 1016 | 1016 |
| 1017 const bool enabled = profile_->GetPrefs()->GetBoolean( | 1017 bool enabled = profile_->GetPrefs()->GetBoolean( |
| 1018 prefs::kAccessibilityFocusHighlightEnabled); | 1018 prefs::kAccessibilityFocusHighlightEnabled); |
| 1019 | 1019 |
| 1020 // Focus highlighting can't be on when spoken feedback is on, because |
| 1021 // ChromeVox does its own focus highlighting. |
| 1022 if (profile_->GetPrefs()->GetBoolean( |
| 1023 prefs::kAccessibilitySpokenFeedbackEnabled)) |
| 1024 enabled = false; |
| 1025 |
| 1020 if (focus_highlight_enabled_ == enabled) | 1026 if (focus_highlight_enabled_ == enabled) |
| 1021 return; | 1027 return; |
| 1022 focus_highlight_enabled_ = enabled; | 1028 focus_highlight_enabled_ = enabled; |
| 1023 | 1029 |
| 1024 UpdateAccessibilityHighlightingFromPrefs(); | 1030 UpdateAccessibilityHighlightingFromPrefs(); |
| 1025 } | 1031 } |
| 1026 | 1032 |
| 1027 void AccessibilityManager::SetSelectToSpeakEnabled(bool enabled) { | 1033 void AccessibilityManager::SetSelectToSpeakEnabled(bool enabled) { |
| 1028 if (!profile_) | 1034 if (!profile_) |
| 1029 return; | 1035 return; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 chromevox_panel_widget_observer_.reset( | 1499 chromevox_panel_widget_observer_.reset( |
| 1494 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); | 1500 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); |
| 1495 } | 1501 } |
| 1496 } | 1502 } |
| 1497 | 1503 |
| 1498 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 1504 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 1499 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1505 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 1500 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1506 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
| 1501 // Clear the accessibility focus ring. | 1507 // Clear the accessibility focus ring. |
| 1502 AccessibilityFocusRingController::GetInstance()->SetFocusRing( | 1508 AccessibilityFocusRingController::GetInstance()->SetFocusRing( |
| 1503 std::vector<gfx::Rect>()); | 1509 std::vector<gfx::Rect>(), |
| 1510 AccessibilityFocusRingController::PERSIST_FOCUS_RING); |
| 1504 } | 1511 } |
| 1505 | 1512 |
| 1506 void AccessibilityManager::OnChromeVoxPanelClosing() { | 1513 void AccessibilityManager::OnChromeVoxPanelClosing() { |
| 1507 aura::Window* root_window = chromevox_panel_->GetRootWindow(); | 1514 aura::Window* root_window = chromevox_panel_->GetRootWindow(); |
| 1508 chromevox_panel_widget_observer_.reset(nullptr); | 1515 chromevox_panel_widget_observer_.reset(nullptr); |
| 1509 chromevox_panel_ = nullptr; | 1516 chromevox_panel_ = nullptr; |
| 1510 | 1517 |
| 1511 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window); | 1518 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window); |
| 1512 if (!shelf) | 1519 if (!shelf) |
| 1513 return; | 1520 return; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1527 content::BrowserContext* context) { | 1534 content::BrowserContext* context) { |
| 1528 keyboard_listener_extension_id_ = id; | 1535 keyboard_listener_extension_id_ = id; |
| 1529 | 1536 |
| 1530 extensions::ExtensionRegistry* registry = | 1537 extensions::ExtensionRegistry* registry = |
| 1531 extensions::ExtensionRegistry::Get(context); | 1538 extensions::ExtensionRegistry::Get(context); |
| 1532 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1539 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1533 extension_registry_observer_.Add(registry); | 1540 extension_registry_observer_.Add(registry); |
| 1534 } | 1541 } |
| 1535 | 1542 |
| 1536 } // namespace chromeos | 1543 } // namespace chromeos |
| OLD | NEW |