Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.h

Issue 2975413002: Move ia2_attributes handling to AXPlatformNodeWin. (Closed)
Patch Set: Initial Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_ 5 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_
6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_ 6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_
7 7
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlcom.h> 9 #include <atlcom.h>
10 #include <oleacc.h> 10 #include <oleacc.h>
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 int MSAAState(); 419 int MSAAState();
420 420
421 int MSAARole(); 421 int MSAARole();
422 std::string StringOverrideForMSAARole(); 422 std::string StringOverrideForMSAARole();
423 423
424 int32_t IA2State(); 424 int32_t IA2State();
425 425
426 int32_t IA2Role(); 426 int32_t IA2Role();
427 427
428 std::vector<base::string16> IA2Attributes();
429
428 // AXPlatformNodeBase overrides. 430 // AXPlatformNodeBase overrides.
429 void Dispose() override; 431 void Dispose() override;
430 432
431 private: 433 private:
434 // IAccessible2 attributes.
435 std::vector<base::string16> ia2_attributes_;
436
432 int MSAAEvent(ui::AXEvent event); 437 int MSAAEvent(ui::AXEvent event);
433 bool IsWebAreaForPresentationalIframe(); 438 bool IsWebAreaForPresentationalIframe();
434 bool ShouldNodeHaveReadonlyState(const AXNodeData& data) const; 439 bool ShouldNodeHaveReadonlyState(const AXNodeData& data) const;
435 bool ShouldNodeHaveFocusableState(const AXNodeData& data) const; 440 bool ShouldNodeHaveFocusableState(const AXNodeData& data) const;
436 441
437 HRESULT GetStringAttributeAsBstr( 442 HRESULT GetStringAttributeAsBstr(
438 ui::AXStringAttribute attribute, 443 ui::AXStringAttribute attribute,
439 BSTR* value_bstr) const; 444 BSTR* value_bstr) const;
440 445
446 // Escapes characters in string attributes as required by the IA2 Spec.
447 // It's okay for input to be the same as output.
448 static void SanitizeStringAttributeForIA2(const base::string16& input,
449 base::string16* output);
450 /*
dmazzoni 2017/07/17 08:27:18 Fix this before landing?
dougt 2017/07/17 19:28:27 Done.
451 FRIEND_TEST_ALL_PREFIXES(BrowserAccessibilityTest,
452 TestSanitizeStringAttributeForIA2);
453 */
454 // Sets the selection given a start and end offset in IA2 Hypertext.
455 void SetIA2HypertextSelection(LONG start_offset, LONG end_offset);
456
457 // If the string attribute |attribute| is present, add its value as an
458 // IAccessible2 attribute with the name |ia2_attr|.
459 void StringAttributeToIA2(ui::AXStringAttribute attribute,
460 const char* ia2_attr);
461
462 // If the bool attribute |attribute| is present, add its value as an
463 // IAccessible2 attribute with the name |ia2_attr|.
464 void BoolAttributeToIA2(ui::AXBoolAttribute attribute, const char* ia2_attr);
465
466 // If the int attribute |attribute| is present, add its value as an
467 // IAccessible2 attribute with the name |ia2_attr|.
468 void IntAttributeToIA2(ui::AXIntAttribute attribute, const char* ia2_attr);
469
441 void AddAlertTarget(); 470 void AddAlertTarget();
442 void RemoveAlertTarget(); 471 void RemoveAlertTarget();
443 472
444 // Return the text to use for IAccessibleText. 473 // Return the text to use for IAccessibleText.
445 base::string16 TextForIAccessibleText(); 474 base::string16 TextForIAccessibleText();
446 475
447 // If offset is a member of IA2TextSpecialOffsets this function updates the 476 // If offset is a member of IA2TextSpecialOffsets this function updates the
448 // value of offset and returns, otherwise offset remains unchanged. 477 // value of offset and returns, otherwise offset remains unchanged.
449 void HandleSpecialTextOffset(LONG* offset); 478 void HandleSpecialTextOffset(LONG* offset);
450 479
(...skipping 15 matching lines...) Expand all
466 // Does not return a new reference. 495 // Does not return a new reference.
467 AXPlatformNodeWin* GetTargetFromChildID(const VARIANT& var_id); 496 AXPlatformNodeWin* GetTargetFromChildID(const VARIANT& var_id);
468 497
469 // Returns true if this node is in a treegrid. 498 // Returns true if this node is in a treegrid.
470 bool IsInTreeGrid(); 499 bool IsInTreeGrid();
471 }; 500 };
472 501
473 } // namespace ui 502 } // namespace ui
474 503
475 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_ 504 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698