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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void AutomationManagerAura::Focus(int32 id) { | 94 void AutomationManagerAura::Focus(int32 id) { |
95 CHECK(enabled_); | 95 CHECK(enabled_); |
96 current_tree_->Focus(id); | 96 current_tree_->Focus(id); |
97 } | 97 } |
98 | 98 |
99 void AutomationManagerAura::MakeVisible(int32 id) { | 99 void AutomationManagerAura::MakeVisible(int32 id) { |
100 CHECK(enabled_); | 100 CHECK(enabled_); |
101 current_tree_->MakeVisible(id); | 101 current_tree_->MakeVisible(id); |
102 } | 102 } |
103 | 103 |
104 void AutomationManagerAura::SetSelection(int32 id, int32 start, int32 end) { | 104 void AutomationManagerAura::SetSelection(int32 anchor_id, |
| 105 int32 anchor_offset, |
| 106 int32 focus_id, |
| 107 int32 focus_offset) { |
105 CHECK(enabled_); | 108 CHECK(enabled_); |
106 current_tree_->SetSelection(id, start, end); | 109 if (anchor_id != focus_id) { |
| 110 NOTREACHED(); |
| 111 return; |
| 112 } |
| 113 current_tree_->SetSelection(anchor_id, anchor_offset, focus_offset); |
107 } | 114 } |
108 | 115 |
109 void AutomationManagerAura::ShowContextMenu(int32 id) { | 116 void AutomationManagerAura::ShowContextMenu(int32 id) { |
110 CHECK(enabled_); | 117 CHECK(enabled_); |
111 current_tree_->ShowContextMenu(id); | 118 current_tree_->ShowContextMenu(id); |
112 } | 119 } |
113 | 120 |
114 AutomationManagerAura::AutomationManagerAura() | 121 AutomationManagerAura::AutomationManagerAura() |
115 : enabled_(false), processing_events_(false) {} | 122 : enabled_(false), processing_events_(false) {} |
116 | 123 |
(...skipping 24 matching lines...) Expand all Loading... |
141 | 148 |
142 processing_events_ = false; | 149 processing_events_ = false; |
143 auto pending_events_copy = pending_events_; | 150 auto pending_events_copy = pending_events_; |
144 pending_events_.clear(); | 151 pending_events_.clear(); |
145 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 152 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
146 SendEvent(context, | 153 SendEvent(context, |
147 pending_events_copy[i].first, | 154 pending_events_copy[i].first, |
148 pending_events_copy[i].second); | 155 pending_events_copy[i].second); |
149 } | 156 } |
150 } | 157 } |
OLD | NEW |