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" | 13 #include "ash/aura/wm_window_aura.h" |
14 #include "ash/autoclick/autoclick_controller.h" | 14 #include "ash/autoclick/autoclick_controller.h" |
15 #include "ash/common/session/session_state_delegate.h" | 15 #include "ash/common/session/session_state_delegate.h" |
16 #include "ash/common/shelf/shelf.h" | |
17 #include "ash/common/shelf/shelf_layout_manager.h" | 16 #include "ash/common/shelf/shelf_layout_manager.h" |
17 #include "ash/common/shelf/wm_shelf.h" | |
18 #include "ash/common/wm_shell.h" | 18 #include "ash/common/wm_shell.h" |
19 #include "ash/high_contrast/high_contrast_controller.h" | 19 #include "ash/high_contrast/high_contrast_controller.h" |
20 #include "ash/root_window_controller.h" | 20 #include "ash/root_window_controller.h" |
21 #include "ash/shell.h" | 21 #include "ash/shell.h" |
22 #include "ash/sticky_keys/sticky_keys_controller.h" | 22 #include "ash/sticky_keys/sticky_keys_controller.h" |
23 #include "base/callback.h" | 23 #include "base/callback.h" |
24 #include "base/callback_helpers.h" | 24 #include "base/callback_helpers.h" |
25 #include "base/command_line.h" | 25 #include "base/command_line.h" |
26 #include "base/macros.h" | 26 #include "base/macros.h" |
27 #include "base/memory/singleton.h" | 27 #include "base/memory/singleton.h" |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1516 AccessibilityFocusRingController::GetInstance()->SetFocusRing( | 1516 AccessibilityFocusRingController::GetInstance()->SetFocusRing( |
1517 std::vector<gfx::Rect>(), | 1517 std::vector<gfx::Rect>(), |
1518 AccessibilityFocusRingController::PERSIST_FOCUS_RING); | 1518 AccessibilityFocusRingController::PERSIST_FOCUS_RING); |
1519 } | 1519 } |
1520 | 1520 |
1521 void AccessibilityManager::OnChromeVoxPanelClosing() { | 1521 void AccessibilityManager::OnChromeVoxPanelClosing() { |
1522 aura::Window* root_window = chromevox_panel_->GetRootWindow(); | 1522 aura::Window* root_window = chromevox_panel_->GetRootWindow(); |
1523 chromevox_panel_widget_observer_.reset(nullptr); | 1523 chromevox_panel_widget_observer_.reset(nullptr); |
1524 chromevox_panel_ = nullptr; | 1524 chromevox_panel_ = nullptr; |
1525 | 1525 |
1526 ash::Shelf* shelf = | 1526 ash::WmShelf* shelf = |
1527 ash::Shelf::ForWindow(ash::WmWindowAura::Get(root_window)); | 1527 ash::WmShelf::ForWindow(ash::WmWindowAura::Get(root_window)); |
1528 if (!shelf) | 1528 if (!shelf->IsShelfCreated()) |
msw
2016/08/30 22:02:07
nit: maybe skip this and just let the shelf layout
James Cook
2016/08/30 23:00:57
I'd prefer to keep this as-is. Otherwise there are
| |
1529 return; | 1529 return; |
1530 | 1530 |
1531 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | 1531 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
1532 if (shelf_layout_manager) | 1532 if (shelf_layout_manager) |
1533 shelf_layout_manager->SetChromeVoxPanelHeight(0); | 1533 shelf_layout_manager->SetChromeVoxPanelHeight(0); |
1534 } | 1534 } |
1535 | 1535 |
1536 void AccessibilityManager::OnChromeVoxPanelDestroying() { | 1536 void AccessibilityManager::OnChromeVoxPanelDestroying() { |
1537 chromevox_panel_widget_observer_.reset(nullptr); | 1537 chromevox_panel_widget_observer_.reset(nullptr); |
1538 chromevox_panel_ = nullptr; | 1538 chromevox_panel_ = nullptr; |
1539 } | 1539 } |
1540 | 1540 |
1541 void AccessibilityManager::SetKeyboardListenerExtensionId( | 1541 void AccessibilityManager::SetKeyboardListenerExtensionId( |
1542 const std::string& id, | 1542 const std::string& id, |
1543 content::BrowserContext* context) { | 1543 content::BrowserContext* context) { |
1544 keyboard_listener_extension_id_ = id; | 1544 keyboard_listener_extension_id_ = id; |
1545 | 1545 |
1546 extensions::ExtensionRegistry* registry = | 1546 extensions::ExtensionRegistry* registry = |
1547 extensions::ExtensionRegistry::Get(context); | 1547 extensions::ExtensionRegistry::Get(context); |
1548 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1548 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
1549 extension_registry_observer_.Add(registry); | 1549 extension_registry_observer_.Add(registry); |
1550 } | 1550 } |
1551 | 1551 |
1552 } // namespace chromeos | 1552 } // namespace chromeos |
OLD | NEW |