| 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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "ash/audio/sounds.h" | 13 #include "ash/audio/sounds.h" |
| 14 #include "ash/autoclick/autoclick_controller.h" | 14 #include "ash/autoclick/autoclick_controller.h" |
| 15 #include "ash/high_contrast/high_contrast_controller.h" | 15 #include "ash/high_contrast/high_contrast_controller.h" |
| 16 #include "ash/metrics/user_metrics_recorder.h" | 16 #include "ash/metrics/user_metrics_recorder.h" |
| 17 #include "ash/root_window_controller.h" |
| 17 #include "ash/session/session_state_delegate.h" | 18 #include "ash/session/session_state_delegate.h" |
| 18 #include "ash/shelf/shelf.h" | 19 #include "ash/shelf/shelf.h" |
| 19 #include "ash/shelf/shelf_layout_manager.h" | 20 #include "ash/shelf/shelf_layout_manager.h" |
| 20 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 21 #include "ash/sticky_keys/sticky_keys_controller.h" | 22 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 22 #include "ash/system/tray/system_tray_notifier.h" | 23 #include "ash/system/tray/system_tray_notifier.h" |
| 23 #include "base/callback.h" | 24 #include "base/callback.h" |
| 24 #include "base/callback_helpers.h" | 25 #include "base/callback_helpers.h" |
| 25 #include "base/command_line.h" | 26 #include "base/command_line.h" |
| 26 #include "base/macros.h" | 27 #include "base/macros.h" |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 event_args->AppendString(ui::ToString(gesture)); | 790 event_args->AppendString(ui::ToString(gesture)); |
| 790 std::unique_ptr<extensions::Event> event(new extensions::Event( | 791 std::unique_ptr<extensions::Event> event(new extensions::Event( |
| 791 extensions::events::ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE, | 792 extensions::events::ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE, |
| 792 extensions::api::accessibility_private::OnAccessibilityGesture:: | 793 extensions::api::accessibility_private::OnAccessibilityGesture:: |
| 793 kEventName, | 794 kEventName, |
| 794 std::move(event_args))); | 795 std::move(event_args))); |
| 795 event_router->DispatchEventWithLazyListener( | 796 event_router->DispatchEventWithLazyListener( |
| 796 extension_misc::kChromeVoxExtensionId, std::move(event)); | 797 extension_misc::kChromeVoxExtensionId, std::move(event)); |
| 797 } | 798 } |
| 798 | 799 |
| 800 void AccessibilityManager::SetTouchAccessibilityAnchorPoint( |
| 801 const gfx::Point& anchor_point) { |
| 802 ash::RootWindowController* root_window_controller = |
| 803 ash::RootWindowController::ForTargetRootWindow(); |
| 804 root_window_controller->SetTouchAccessibilityAnchorPoint(anchor_point); |
| 805 } |
| 806 |
| 799 bool AccessibilityManager::IsHighContrastEnabled() { | 807 bool AccessibilityManager::IsHighContrastEnabled() { |
| 800 return high_contrast_enabled_; | 808 return high_contrast_enabled_; |
| 801 } | 809 } |
| 802 | 810 |
| 803 void AccessibilityManager::EnableAutoclick(bool enabled) { | 811 void AccessibilityManager::EnableAutoclick(bool enabled) { |
| 804 if (!profile_) | 812 if (!profile_) |
| 805 return; | 813 return; |
| 806 | 814 |
| 807 PrefService* pref_service = profile_->GetPrefs(); | 815 PrefService* pref_service = profile_->GetPrefs(); |
| 808 pref_service->SetBoolean(prefs::kAccessibilityAutoclickEnabled, enabled); | 816 pref_service->SetBoolean(prefs::kAccessibilityAutoclickEnabled, enabled); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 content::BrowserContext* context) { | 1527 content::BrowserContext* context) { |
| 1520 keyboard_listener_extension_id_ = id; | 1528 keyboard_listener_extension_id_ = id; |
| 1521 | 1529 |
| 1522 extensions::ExtensionRegistry* registry = | 1530 extensions::ExtensionRegistry* registry = |
| 1523 extensions::ExtensionRegistry::Get(context); | 1531 extensions::ExtensionRegistry::Get(context); |
| 1524 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1532 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1525 extension_registry_observer_.Add(registry); | 1533 extension_registry_observer_.Add(registry); |
| 1526 } | 1534 } |
| 1527 | 1535 |
| 1528 } // namespace chromeos | 1536 } // namespace chromeos |
| OLD | NEW |