Chromium Code Reviews| 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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1505 chromevox_panel_->Close(); | 1505 chromevox_panel_->Close(); |
| 1506 chromevox_panel_ = nullptr; | 1506 chromevox_panel_ = nullptr; |
| 1507 } | 1507 } |
| 1508 chromevox_panel_ = new ChromeVoxPanel( | 1508 chromevox_panel_ = new ChromeVoxPanel( |
| 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 chromevox_panel_->ResetPanelHeight(); |
| 1516 chromevox_panel_widget_observer_.reset(nullptr); | 1516 chromevox_panel_widget_observer_.reset(); |
| 1517 chromevox_panel_ = nullptr; | 1517 chromevox_panel_ = nullptr; |
| 1518 | |
| 1519 ash::WmShelf* shelf = | |
| 1520 ash::WmShelf::ForWindow(ash::WmWindow::Get(root_window)); | |
| 1521 if (!shelf->IsShelfInitialized()) | |
| 1522 return; | |
| 1523 | |
| 1524 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | |
| 1525 if (shelf_layout_manager) | |
| 1526 shelf_layout_manager->SetChromeVoxPanelHeight(0); | |
|
James Cook
2017/05/16 21:32:36
This code was kind-of copy/pasted so I collapsed t
| |
| 1527 } | 1518 } |
| 1528 | 1519 |
| 1529 void AccessibilityManager::OnChromeVoxPanelDestroying() { | 1520 void AccessibilityManager::OnChromeVoxPanelDestroying() { |
| 1530 chromevox_panel_widget_observer_.reset(nullptr); | 1521 chromevox_panel_widget_observer_.reset(nullptr); |
| 1531 chromevox_panel_ = nullptr; | 1522 chromevox_panel_ = nullptr; |
| 1532 } | 1523 } |
| 1533 | 1524 |
| 1534 void AccessibilityManager::SetKeyboardListenerExtensionId( | 1525 void AccessibilityManager::SetKeyboardListenerExtensionId( |
| 1535 const std::string& id, | 1526 const std::string& id, |
| 1536 content::BrowserContext* context) { | 1527 content::BrowserContext* context) { |
| 1537 keyboard_listener_extension_id_ = id; | 1528 keyboard_listener_extension_id_ = id; |
| 1538 | 1529 |
| 1539 extensions::ExtensionRegistry* registry = | 1530 extensions::ExtensionRegistry* registry = |
| 1540 extensions::ExtensionRegistry::Get(context); | 1531 extensions::ExtensionRegistry::Get(context); |
| 1541 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1532 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1542 extension_registry_observer_.Add(registry); | 1533 extension_registry_observer_.Add(registry); |
| 1543 } | 1534 } |
| 1544 | 1535 |
| 1545 } // namespace chromeos | 1536 } // namespace chromeos |
| OLD | NEW |