| 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/aura/wm_window_aura.h" | |
| 14 #include "ash/autoclick/autoclick_controller.h" | 13 #include "ash/autoclick/autoclick_controller.h" |
| 15 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" | 14 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" |
| 16 #include "ash/common/session/session_state_delegate.h" | 15 #include "ash/common/session/session_state_delegate.h" |
| 17 #include "ash/common/shelf/shelf_layout_manager.h" | 16 #include "ash/common/shelf/shelf_layout_manager.h" |
| 18 #include "ash/common/shelf/wm_shelf.h" | 17 #include "ash/common/shelf/wm_shelf.h" |
| 19 #include "ash/common/wm_shell.h" | 18 #include "ash/common/wm_shell.h" |
| 19 #include "ash/common/wm_window.h" |
| 20 #include "ash/high_contrast/high_contrast_controller.h" | 20 #include "ash/high_contrast/high_contrast_controller.h" |
| 21 #include "ash/root_window_controller.h" | 21 #include "ash/root_window_controller.h" |
| 22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
| 23 #include "ash/sticky_keys/sticky_keys_controller.h" | 23 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 24 #include "base/callback.h" | 24 #include "base/callback.h" |
| 25 #include "base/callback_helpers.h" | 25 #include "base/callback_helpers.h" |
| 26 #include "base/command_line.h" | 26 #include "base/command_line.h" |
| 27 #include "base/macros.h" | 27 #include "base/macros.h" |
| 28 #include "base/memory/ptr_util.h" | 28 #include "base/memory/ptr_util.h" |
| 29 #include "base/memory/singleton.h" | 29 #include "base/memory/singleton.h" |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 chromevox_panel_widget_observer_.reset( | 1341 chromevox_panel_widget_observer_.reset( |
| 1342 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); | 1342 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); |
| 1343 } | 1343 } |
| 1344 | 1344 |
| 1345 void AccessibilityManager::OnChromeVoxPanelClosing() { | 1345 void AccessibilityManager::OnChromeVoxPanelClosing() { |
| 1346 aura::Window* root_window = chromevox_panel_->GetRootWindow(); | 1346 aura::Window* root_window = chromevox_panel_->GetRootWindow(); |
| 1347 chromevox_panel_widget_observer_.reset(nullptr); | 1347 chromevox_panel_widget_observer_.reset(nullptr); |
| 1348 chromevox_panel_ = nullptr; | 1348 chromevox_panel_ = nullptr; |
| 1349 | 1349 |
| 1350 ash::WmShelf* shelf = | 1350 ash::WmShelf* shelf = |
| 1351 ash::WmShelf::ForWindow(ash::WmWindowAura::Get(root_window)); | 1351 ash::WmShelf::ForWindow(ash::WmWindow::Get(root_window)); |
| 1352 if (!shelf->IsShelfInitialized()) | 1352 if (!shelf->IsShelfInitialized()) |
| 1353 return; | 1353 return; |
| 1354 | 1354 |
| 1355 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | 1355 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 1356 if (shelf_layout_manager) | 1356 if (shelf_layout_manager) |
| 1357 shelf_layout_manager->SetChromeVoxPanelHeight(0); | 1357 shelf_layout_manager->SetChromeVoxPanelHeight(0); |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 void AccessibilityManager::OnChromeVoxPanelDestroying() { | 1360 void AccessibilityManager::OnChromeVoxPanelDestroying() { |
| 1361 chromevox_panel_widget_observer_.reset(nullptr); | 1361 chromevox_panel_widget_observer_.reset(nullptr); |
| 1362 chromevox_panel_ = nullptr; | 1362 chromevox_panel_ = nullptr; |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 void AccessibilityManager::SetKeyboardListenerExtensionId( | 1365 void AccessibilityManager::SetKeyboardListenerExtensionId( |
| 1366 const std::string& id, | 1366 const std::string& id, |
| 1367 content::BrowserContext* context) { | 1367 content::BrowserContext* context) { |
| 1368 keyboard_listener_extension_id_ = id; | 1368 keyboard_listener_extension_id_ = id; |
| 1369 | 1369 |
| 1370 extensions::ExtensionRegistry* registry = | 1370 extensions::ExtensionRegistry* registry = |
| 1371 extensions::ExtensionRegistry::Get(context); | 1371 extensions::ExtensionRegistry::Get(context); |
| 1372 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1372 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1373 extension_registry_observer_.Add(registry); | 1373 extension_registry_observer_.Add(registry); |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 } // namespace chromeos | 1376 } // namespace chromeos |
| OLD | NEW |