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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 profile_, session_manager::SessionManager::Get()->IsUserSessionBlocked()); | 1509 profile_, session_manager::SessionManager::Get()->IsUserSessionBlocked()); |
1510 chromevox_panel_widget_observer_.reset( | 1510 chromevox_panel_widget_observer_.reset( |
1511 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); | 1511 new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this)); |
1512 } | 1512 } |
1513 | 1513 |
1514 void AccessibilityManager::OnChromeVoxPanelClosing() { | 1514 void AccessibilityManager::OnChromeVoxPanelClosing() { |
1515 aura::Window* root_window = chromevox_panel_->GetRootWindow(); | 1515 aura::Window* root_window = chromevox_panel_->GetRootWindow(); |
1516 chromevox_panel_widget_observer_.reset(nullptr); | 1516 chromevox_panel_widget_observer_.reset(nullptr); |
1517 chromevox_panel_ = nullptr; | 1517 chromevox_panel_ = nullptr; |
1518 | 1518 |
1519 ash::WmShelf* shelf = | 1519 ash::WmShelf* shelf = ash::WmShelf::ForWindow(root_window); |
1520 ash::WmShelf::ForWindow(ash::WmWindow::Get(root_window)); | |
1521 if (!shelf->IsShelfInitialized()) | 1520 if (!shelf->IsShelfInitialized()) |
1522 return; | 1521 return; |
1523 | 1522 |
1524 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | 1523 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
1525 if (shelf_layout_manager) | 1524 if (shelf_layout_manager) |
1526 shelf_layout_manager->SetChromeVoxPanelHeight(0); | 1525 shelf_layout_manager->SetChromeVoxPanelHeight(0); |
1527 } | 1526 } |
1528 | 1527 |
1529 void AccessibilityManager::OnChromeVoxPanelDestroying() { | 1528 void AccessibilityManager::OnChromeVoxPanelDestroying() { |
1530 chromevox_panel_widget_observer_.reset(nullptr); | 1529 chromevox_panel_widget_observer_.reset(nullptr); |
1531 chromevox_panel_ = nullptr; | 1530 chromevox_panel_ = nullptr; |
1532 } | 1531 } |
1533 | 1532 |
1534 void AccessibilityManager::SetKeyboardListenerExtensionId( | 1533 void AccessibilityManager::SetKeyboardListenerExtensionId( |
1535 const std::string& id, | 1534 const std::string& id, |
1536 content::BrowserContext* context) { | 1535 content::BrowserContext* context) { |
1537 keyboard_listener_extension_id_ = id; | 1536 keyboard_listener_extension_id_ = id; |
1538 | 1537 |
1539 extensions::ExtensionRegistry* registry = | 1538 extensions::ExtensionRegistry* registry = |
1540 extensions::ExtensionRegistry::Get(context); | 1539 extensions::ExtensionRegistry::Get(context); |
1541 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1540 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
1542 extension_registry_observer_.Add(registry); | 1541 extension_registry_observer_.Add(registry); |
1543 } | 1542 } |
1544 | 1543 |
1545 } // namespace chromeos | 1544 } // namespace chromeos |
OLD | NEW |