| 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 23 matching lines...) Expand all Loading... |
| 34 #include "base/strings/string_util.h" | 34 #include "base/strings/string_util.h" |
| 35 #include "base/time/time.h" | 35 #include "base/time/time.h" |
| 36 #include "base/values.h" | 36 #include "base/values.h" |
| 37 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 37 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| 38 #include "chrome/browser/browser_process.h" | 38 #include "chrome/browser/browser_process.h" |
| 39 #include "chrome/browser/chrome_notification_types.h" | 39 #include "chrome/browser/chrome_notification_types.h" |
| 40 #include "chrome/browser/chromeos/accessibility/accessibility_extension_loader.h
" | 40 #include "chrome/browser/chromeos/accessibility/accessibility_extension_loader.h
" |
| 41 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" | 41 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" |
| 42 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 42 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 43 #include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h" | 43 #include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h" |
| 44 #include "chrome/browser/chromeos/accessibility/switch_access_event_handler.h" |
| 44 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 45 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 45 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 46 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 46 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 47 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 47 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" | 48 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
| 48 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con
troller.h" | 49 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con
troller.h" |
| 49 #include "chrome/browser/extensions/extension_service.h" | 50 #include "chrome/browser/extensions/extension_service.h" |
| 50 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 51 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 51 #include "chrome/browser/profiles/profile.h" | 52 #include "chrome/browser/profiles/profile.h" |
| 52 #include "chrome/browser/profiles/profile_manager.h" | 53 #include "chrome/browser/profiles/profile_manager.h" |
| 53 #include "chrome/browser/ui/ash/ash_util.h" | 54 #include "chrome/browser/ui/ash/ash_util.h" |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 | 934 |
| 934 const bool enabled = profile_->GetPrefs()->GetBoolean( | 935 const bool enabled = profile_->GetPrefs()->GetBoolean( |
| 935 prefs::kAccessibilitySwitchAccessEnabled); | 936 prefs::kAccessibilitySwitchAccessEnabled); |
| 936 | 937 |
| 937 if (switch_access_enabled_ == enabled) | 938 if (switch_access_enabled_ == enabled) |
| 938 return; | 939 return; |
| 939 switch_access_enabled_ = enabled; | 940 switch_access_enabled_ = enabled; |
| 940 | 941 |
| 941 if (enabled) { | 942 if (enabled) { |
| 942 switch_access_loader_->Load(profile_, base::Closure() /* done_cb */); | 943 switch_access_loader_->Load(profile_, base::Closure() /* done_cb */); |
| 944 switch_access_event_handler_.reset( |
| 945 new chromeos::SwitchAccessEventHandler()); |
| 943 } else { | 946 } else { |
| 944 switch_access_loader_->Unload(); | 947 switch_access_loader_->Unload(); |
| 948 switch_access_event_handler_.reset(nullptr); |
| 945 } | 949 } |
| 946 } | 950 } |
| 947 | 951 |
| 948 void AccessibilityManager::UpdateAccessibilityHighlightingFromPrefs() { | 952 void AccessibilityManager::UpdateAccessibilityHighlightingFromPrefs() { |
| 949 if (!focus_highlight_enabled_ && !caret_highlight_enabled_ && | 953 if (!focus_highlight_enabled_ && !caret_highlight_enabled_ && |
| 950 !cursor_highlight_enabled_) { | 954 !cursor_highlight_enabled_) { |
| 951 if (accessibility_highlight_manager_) | 955 if (accessibility_highlight_manager_) |
| 952 accessibility_highlight_manager_.reset(); | 956 accessibility_highlight_manager_.reset(); |
| 953 return; | 957 return; |
| 954 } | 958 } |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 content::BrowserContext* context) { | 1404 content::BrowserContext* context) { |
| 1401 keyboard_listener_extension_id_ = id; | 1405 keyboard_listener_extension_id_ = id; |
| 1402 | 1406 |
| 1403 extensions::ExtensionRegistry* registry = | 1407 extensions::ExtensionRegistry* registry = |
| 1404 extensions::ExtensionRegistry::Get(context); | 1408 extensions::ExtensionRegistry::Get(context); |
| 1405 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1409 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1406 extension_registry_observer_.Add(registry); | 1410 extension_registry_observer_.Add(registry); |
| 1407 } | 1411 } |
| 1408 | 1412 |
| 1409 } // namespace chromeos | 1413 } // namespace chromeos |
| OLD | NEW |