OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) { | 368 STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) { |
369 COM_OBJECT_VALIDATE_1_ARG(child_count); | 369 COM_OBJECT_VALIDATE_1_ARG(child_count); |
370 *child_count = delegate_->GetChildCount(); | 370 *child_count = delegate_->GetChildCount(); |
371 return S_OK; | 371 return S_OK; |
372 } | 372 } |
373 | 373 |
374 STDMETHODIMP AXPlatformNodeWin::get_accDefaultAction( | 374 STDMETHODIMP AXPlatformNodeWin::get_accDefaultAction( |
375 VARIANT var_id, BSTR* def_action) { | 375 VARIANT var_id, BSTR* def_action) { |
376 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, def_action); | 376 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, def_action); |
377 return GetStringAttributeAsBstr(ui::AX_ATTR_ACTION, def_action); | 377 int action; |
| 378 if (!GetIntAttribute(AX_ATTR_ACTION, &action)) { |
| 379 *def_action = nullptr; |
| 380 return S_FALSE; |
| 381 } |
| 382 |
| 383 base::string16 action_verb = |
| 384 ActionToString(static_cast<AXSupportedAction>(action)); |
| 385 if (action_verb.empty()) { |
| 386 *def_action = nullptr; |
| 387 return S_FALSE; |
| 388 } |
| 389 |
| 390 *def_action = SysAllocString(action_verb.c_str()); |
| 391 DCHECK(def_action); |
| 392 return S_OK; |
378 } | 393 } |
379 | 394 |
380 STDMETHODIMP AXPlatformNodeWin::get_accDescription( | 395 STDMETHODIMP AXPlatformNodeWin::get_accDescription( |
381 VARIANT var_id, BSTR* desc) { | 396 VARIANT var_id, BSTR* desc) { |
382 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, desc); | 397 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, desc); |
383 return GetStringAttributeAsBstr(ui::AX_ATTR_DESCRIPTION, desc); | 398 return GetStringAttributeAsBstr(ui::AX_ATTR_DESCRIPTION, desc); |
384 } | 399 } |
385 | 400 |
386 STDMETHODIMP AXPlatformNodeWin::get_accFocus(VARIANT* focus_child) { | 401 STDMETHODIMP AXPlatformNodeWin::get_accFocus(VARIANT* focus_child) { |
387 COM_OBJECT_VALIDATE_1_ARG(focus_child); | 402 COM_OBJECT_VALIDATE_1_ARG(focus_child); |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 ui::TextBoundaryDirection direction) { | 1166 ui::TextBoundaryDirection direction) { |
1152 HandleSpecialTextOffset(text, &start_offset); | 1167 HandleSpecialTextOffset(text, &start_offset); |
1153 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1168 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
1154 std::vector<int32_t> line_breaks; | 1169 std::vector<int32_t> line_breaks; |
1155 return static_cast<LONG>(ui::FindAccessibleTextBoundary( | 1170 return static_cast<LONG>(ui::FindAccessibleTextBoundary( |
1156 text, line_breaks, boundary, start_offset, direction, | 1171 text, line_breaks, boundary, start_offset, direction, |
1157 AX_TEXT_AFFINITY_DOWNSTREAM)); | 1172 AX_TEXT_AFFINITY_DOWNSTREAM)); |
1158 } | 1173 } |
1159 | 1174 |
1160 } // namespace ui | 1175 } // namespace ui |
OLD | NEW |