OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/aura/accessibility/automation_manager_aura.h" | 5 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 0, /* process_id */ | 143 0, /* process_id */ |
144 0 /* routing_id */); | 144 0 /* routing_id */); |
145 std::vector<content::AXEventNotificationDetails> details; | 145 std::vector<content::AXEventNotificationDetails> details; |
146 details.push_back(detail); | 146 details.push_back(detail); |
147 extensions::automation_util::DispatchAccessibilityEventsToAutomation( | 147 extensions::automation_util::DispatchAccessibilityEventsToAutomation( |
148 details, context, gfx::Vector2d()); | 148 details, context, gfx::Vector2d()); |
149 } | 149 } |
150 | 150 |
151 void AutomationManagerAura::OnNativeFocusChanged(aura::Window* focused_now) { | 151 void AutomationManagerAura::OnNativeFocusChanged(aura::Window* focused_now) { |
152 focused_window_ = focused_now; | 152 focused_window_ = focused_now; |
| 153 if (focused_now && !focused_now->HasObserver(this)) |
| 154 focused_now->AddObserver(this); |
153 } | 155 } |
| 156 |
| 157 void AutomationManagerAura::OnWindowDestroying(aura::Window* window) { |
| 158 if (focused_window_ == window) { |
| 159 window->RemoveObserver(this); |
| 160 focused_window_ = nullptr; |
| 161 } |
| 162 } |
OLD | NEW |