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 return; | |
David Tseng
2015/09/23 17:57:41
NOTREACHED here, right?
| |
111 current_tree_->SetSelection(anchor_id, anchor_offset, focus_offset); | |
107 } | 112 } |
108 | 113 |
109 void AutomationManagerAura::ShowContextMenu(int32 id) { | 114 void AutomationManagerAura::ShowContextMenu(int32 id) { |
110 CHECK(enabled_); | 115 CHECK(enabled_); |
111 current_tree_->ShowContextMenu(id); | 116 current_tree_->ShowContextMenu(id); |
112 } | 117 } |
113 | 118 |
114 AutomationManagerAura::AutomationManagerAura() | 119 AutomationManagerAura::AutomationManagerAura() |
115 : enabled_(false), processing_events_(false) {} | 120 : enabled_(false), processing_events_(false) {} |
116 | 121 |
(...skipping 24 matching lines...) Expand all Loading... | |
141 | 146 |
142 processing_events_ = false; | 147 processing_events_ = false; |
143 auto pending_events_copy = pending_events_; | 148 auto pending_events_copy = pending_events_; |
144 pending_events_.clear(); | 149 pending_events_.clear(); |
145 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 150 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
146 SendEvent(context, | 151 SendEvent(context, |
147 pending_events_copy[i].first, | 152 pending_events_copy[i].first, |
148 pending_events_copy[i].second); | 153 pending_events_copy[i].second); |
149 } | 154 } |
150 } | 155 } |
OLD | NEW |