| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 366 |
| 367 STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) { | 367 STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) { |
| 368 COM_OBJECT_VALIDATE_1_ARG(child_count); | 368 COM_OBJECT_VALIDATE_1_ARG(child_count); |
| 369 *child_count = delegate_->GetChildCount(); | 369 *child_count = delegate_->GetChildCount(); |
| 370 return S_OK; | 370 return S_OK; |
| 371 } | 371 } |
| 372 | 372 |
| 373 STDMETHODIMP AXPlatformNodeWin::get_accDefaultAction( | 373 STDMETHODIMP AXPlatformNodeWin::get_accDefaultAction( |
| 374 VARIANT var_id, BSTR* def_action) { | 374 VARIANT var_id, BSTR* def_action) { |
| 375 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, def_action); | 375 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, def_action); |
| 376 return GetStringAttributeAsBstr(ui::AX_ATTR_ACTION, def_action); | 376 int action; |
| 377 if (!GetIntAttribute(AX_ATTR_ACTION, &action)) { |
| 378 *def_action = nullptr; |
| 379 return S_FALSE; |
| 380 } |
| 381 |
| 382 base::string16 action_verb = |
| 383 ActionToString(static_cast<AXSupportedAction>(action)); |
| 384 if (action_verb.empty()) { |
| 385 *def_action = nullptr; |
| 386 return S_FALSE; |
| 387 } |
| 388 |
| 389 *def_action = SysAllocString(action_verb.c_str()); |
| 390 DCHECK(def_action); |
| 391 return S_OK; |
| 377 } | 392 } |
| 378 | 393 |
| 379 STDMETHODIMP AXPlatformNodeWin::get_accDescription( | 394 STDMETHODIMP AXPlatformNodeWin::get_accDescription( |
| 380 VARIANT var_id, BSTR* desc) { | 395 VARIANT var_id, BSTR* desc) { |
| 381 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, desc); | 396 COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, desc); |
| 382 return GetStringAttributeAsBstr(ui::AX_ATTR_DESCRIPTION, desc); | 397 return GetStringAttributeAsBstr(ui::AX_ATTR_DESCRIPTION, desc); |
| 383 } | 398 } |
| 384 | 399 |
| 385 STDMETHODIMP AXPlatformNodeWin::get_accFocus(VARIANT* focus_child) { | 400 STDMETHODIMP AXPlatformNodeWin::get_accFocus(VARIANT* focus_child) { |
| 386 COM_OBJECT_VALIDATE_1_ARG(focus_child); | 401 COM_OBJECT_VALIDATE_1_ARG(focus_child); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 ui::TextBoundaryDirection direction) { | 1162 ui::TextBoundaryDirection direction) { |
| 1148 HandleSpecialTextOffset(text, &start_offset); | 1163 HandleSpecialTextOffset(text, &start_offset); |
| 1149 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1164 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
| 1150 std::vector<int32_t> line_breaks; | 1165 std::vector<int32_t> line_breaks; |
| 1151 return static_cast<LONG>(ui::FindAccessibleTextBoundary( | 1166 return static_cast<LONG>(ui::FindAccessibleTextBoundary( |
| 1152 text, line_breaks, boundary, start_offset, direction, | 1167 text, line_breaks, boundary, start_offset, direction, |
| 1153 AX_TEXT_AFFINITY_DOWNSTREAM)); | 1168 AX_TEXT_AFFINITY_DOWNSTREAM)); |
| 1154 } | 1169 } |
| 1155 | 1170 |
| 1156 } // namespace ui | 1171 } // namespace ui |
| OLD | NEW |