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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 UpdateSpokenFeedbackFromPref(); | 1187 UpdateSpokenFeedbackFromPref(); |
1188 UpdateHighContrastFromPref(); | 1188 UpdateHighContrastFromPref(); |
1189 UpdateAutoclickFromPref(); | 1189 UpdateAutoclickFromPref(); |
1190 UpdateAutoclickDelayFromPref(); | 1190 UpdateAutoclickDelayFromPref(); |
1191 UpdateVirtualKeyboardFromPref(); | 1191 UpdateVirtualKeyboardFromPref(); |
1192 UpdateCaretHighlightFromPref(); | 1192 UpdateCaretHighlightFromPref(); |
1193 UpdateCursorHighlightFromPref(); | 1193 UpdateCursorHighlightFromPref(); |
1194 UpdateFocusHighlightFromPref(); | 1194 UpdateFocusHighlightFromPref(); |
1195 UpdateSelectToSpeakFromPref(); | 1195 UpdateSelectToSpeakFromPref(); |
1196 UpdateSwitchAccessFromPref(); | 1196 UpdateSwitchAccessFromPref(); |
| 1197 |
| 1198 // Update the panel height in the shelf layout manager when the profile |
| 1199 // changes, since the shelf layout manager doesn't exist in the login profile. |
| 1200 if (chromevox_panel_) |
| 1201 chromevox_panel_->UpdatePanelHeight(); |
1197 } | 1202 } |
1198 | 1203 |
1199 void AccessibilityManager::ActiveUserChanged(const AccountId& account_id) { | 1204 void AccessibilityManager::ActiveUserChanged(const AccountId& account_id) { |
1200 SetProfile(ProfileManager::GetActiveUserProfile()); | 1205 SetProfile(ProfileManager::GetActiveUserProfile()); |
1201 } | 1206 } |
1202 | 1207 |
1203 void AccessibilityManager::OnAppTerminating() { | 1208 void AccessibilityManager::OnAppTerminating() { |
1204 session_state_observer_.reset(); | 1209 session_state_observer_.reset(); |
1205 } | 1210 } |
1206 | 1211 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1424 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
1420 // Clear the accessibility focus ring. | 1425 // Clear the accessibility focus ring. |
1421 AccessibilityFocusRingController::GetInstance()->SetFocusRing( | 1426 AccessibilityFocusRingController::GetInstance()->SetFocusRing( |
1422 std::vector<gfx::Rect>()); | 1427 std::vector<gfx::Rect>()); |
1423 } | 1428 } |
1424 | 1429 |
1425 void AccessibilityManager::OnChromeVoxPanelClosing() { | 1430 void AccessibilityManager::OnChromeVoxPanelClosing() { |
1426 aura::Window* root_window = chromevox_panel_->GetRootWindow(); | 1431 aura::Window* root_window = chromevox_panel_->GetRootWindow(); |
1427 chromevox_panel_widget_observer_.reset(nullptr); | 1432 chromevox_panel_widget_observer_.reset(nullptr); |
1428 chromevox_panel_ = nullptr; | 1433 chromevox_panel_ = nullptr; |
1429 ash::Shelf::ForWindow(root_window) | 1434 |
1430 ->shelf_layout_manager() | 1435 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window); |
1431 ->SetChromeVoxPanelHeight(0); | 1436 if (!shelf) |
| 1437 return; |
| 1438 |
| 1439 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 1440 if (shelf_layout_manager) |
| 1441 shelf_layout_manager->SetChromeVoxPanelHeight(0); |
1432 } | 1442 } |
1433 | 1443 |
1434 void AccessibilityManager::OnChromeVoxPanelDestroying() { | 1444 void AccessibilityManager::OnChromeVoxPanelDestroying() { |
1435 chromevox_panel_widget_observer_.reset(nullptr); | 1445 chromevox_panel_widget_observer_.reset(nullptr); |
1436 chromevox_panel_ = nullptr; | 1446 chromevox_panel_ = nullptr; |
1437 } | 1447 } |
1438 | 1448 |
1439 void AccessibilityManager::SetKeyboardListenerExtensionId( | 1449 void AccessibilityManager::SetKeyboardListenerExtensionId( |
1440 const std::string& id, | 1450 const std::string& id, |
1441 content::BrowserContext* context) { | 1451 content::BrowserContext* context) { |
1442 keyboard_listener_extension_id_ = id; | 1452 keyboard_listener_extension_id_ = id; |
1443 | 1453 |
1444 extensions::ExtensionRegistry* registry = | 1454 extensions::ExtensionRegistry* registry = |
1445 extensions::ExtensionRegistry::Get(context); | 1455 extensions::ExtensionRegistry::Get(context); |
1446 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1456 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
1447 extension_registry_observer_.Add(registry); | 1457 extension_registry_observer_.Add(registry); |
1448 } | 1458 } |
1449 | 1459 |
1450 } // namespace chromeos | 1460 } // namespace chromeos |
OLD | NEW |