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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 1953613002: Make touch accessibility gestures work with ChromeVox Next (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 // to the new language. 773 // to the new language.
774 EnableSpokenFeedback(false, ui::A11Y_NOTIFICATION_NONE); 774 EnableSpokenFeedback(false, ui::A11Y_NOTIFICATION_NONE);
775 EnableSpokenFeedback(true, ui::A11Y_NOTIFICATION_NONE); 775 EnableSpokenFeedback(true, ui::A11Y_NOTIFICATION_NONE);
776 } 776 }
777 777
778 void AccessibilityManager::PlayEarcon(int sound_key) { 778 void AccessibilityManager::PlayEarcon(int sound_key) {
779 DCHECK(sound_key < chromeos::SOUND_COUNT); 779 DCHECK(sound_key < chromeos::SOUND_COUNT);
780 ash::PlaySystemSoundIfSpokenFeedback(sound_key); 780 ash::PlaySystemSoundIfSpokenFeedback(sound_key);
781 } 781 }
782 782
783 void AccessibilityManager::HandleAccessibilityGesture(ui::AXGesture gesture) {
784 extensions::EventRouter* event_router =
785 extensions::EventRouter::Get(profile());
786 CHECK(event_router);
787
788 std::unique_ptr<base::ListValue> event_args(new base::ListValue());
789 event_args->AppendString(ui::ToString(gesture));
790 std::unique_ptr<extensions::Event> event(new extensions::Event(
791 extensions::events::ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE,
792 extensions::api::accessibility_private::OnAccessibilityGesture::
793 kEventName,
794 std::move(event_args)));
795 event_router->DispatchEventWithLazyListener(
796 extension_misc::kChromeVoxExtensionId, std::move(event));
797 }
798
783 bool AccessibilityManager::IsHighContrastEnabled() { 799 bool AccessibilityManager::IsHighContrastEnabled() {
784 return high_contrast_enabled_; 800 return high_contrast_enabled_;
785 } 801 }
786 802
787 void AccessibilityManager::EnableAutoclick(bool enabled) { 803 void AccessibilityManager::EnableAutoclick(bool enabled) {
788 if (!profile_) 804 if (!profile_)
789 return; 805 return;
790 806
791 PrefService* pref_service = profile_->GetPrefs(); 807 PrefService* pref_service = profile_->GetPrefs();
792 pref_service->SetBoolean(prefs::kAccessibilityAutoclickEnabled, enabled); 808 pref_service->SetBoolean(prefs::kAccessibilityAutoclickEnabled, enabled);
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 content::BrowserContext* context) { 1519 content::BrowserContext* context) {
1504 keyboard_listener_extension_id_ = id; 1520 keyboard_listener_extension_id_ = id;
1505 1521
1506 extensions::ExtensionRegistry* registry = 1522 extensions::ExtensionRegistry* registry =
1507 extensions::ExtensionRegistry::Get(context); 1523 extensions::ExtensionRegistry::Get(context);
1508 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1524 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1509 extension_registry_observer_.Add(registry); 1525 extension_registry_observer_.Add(registry);
1510 } 1526 }
1511 1527
1512 } // namespace chromeos 1528 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698