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

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

Issue 2975413002: Move ia2_attributes handling to AXPlatformNodeWin. (Closed)
Patch Set: Suggestions from dmazzoni 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 void** object) override; 414 void** object) override;
415 415
416 protected: 416 protected:
417 AXPlatformNodeWin(); 417 AXPlatformNodeWin();
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 ComputeIA2State();
425 425
426 int32_t IA2Role(); 426 int32_t ComputeIA2Role();
427
428 std::vector<base::string16> ComputeIA2Attributes();
427 429
428 // AXPlatformNodeBase overrides. 430 // AXPlatformNodeBase overrides.
429 void Dispose() override; 431 void Dispose() override;
430 432
431 private: 433 private:
432 int MSAAEvent(ui::AXEvent event); 434 int MSAAEvent(ui::AXEvent event);
433 bool IsWebAreaForPresentationalIframe(); 435 bool IsWebAreaForPresentationalIframe();
434 bool ShouldNodeHaveReadonlyState(const AXNodeData& data) const; 436 bool ShouldNodeHaveReadonlyState(const AXNodeData& data) const;
435 bool ShouldNodeHaveFocusableState(const AXNodeData& data) const; 437 bool ShouldNodeHaveFocusableState(const AXNodeData& data) const;
436 438
437 HRESULT GetStringAttributeAsBstr( 439 HRESULT GetStringAttributeAsBstr(
438 ui::AXStringAttribute attribute, 440 ui::AXStringAttribute attribute,
439 BSTR* value_bstr) const; 441 BSTR* value_bstr) const;
440 442
443 // Escapes characters in string attributes as required by the IA2 Spec.
444 // It's okay for input to be the same as output.
445 static void SanitizeStringAttributeForIA2(const base::string16& input,
446 base::string16* output);
447
448 // Sets the selection given a start and end offset in IA2 Hypertext.
449 void SetIA2HypertextSelection(LONG start_offset, LONG end_offset);
450
451 // If the string attribute |attribute| is present, add its value as an
452 // IAccessible2 attribute with the name |ia2_attr|.
453 void StringAttributeToIA2(std::vector<base::string16>& attributes,
454 ui::AXStringAttribute attribute,
455 const char* ia2_attr);
456
457 // If the bool attribute |attribute| is present, add its value as an
458 // IAccessible2 attribute with the name |ia2_attr|.
459 void BoolAttributeToIA2(std::vector<base::string16>& attributes,
460 ui::AXBoolAttribute attribute,
461 const char* ia2_attr);
462
463 // If the int attribute |attribute| is present, add its value as an
464 // IAccessible2 attribute with the name |ia2_attr|.
465 void IntAttributeToIA2(std::vector<base::string16>& attributes,
466 ui::AXIntAttribute attribute,
467 const char* ia2_attr);
468
441 void AddAlertTarget(); 469 void AddAlertTarget();
442 void RemoveAlertTarget(); 470 void RemoveAlertTarget();
443 471
444 // Return the text to use for IAccessibleText. 472 // Return the text to use for IAccessibleText.
445 base::string16 TextForIAccessibleText(); 473 base::string16 TextForIAccessibleText();
446 474
447 // If offset is a member of IA2TextSpecialOffsets this function updates the 475 // If offset is a member of IA2TextSpecialOffsets this function updates the
448 // value of offset and returns, otherwise offset remains unchanged. 476 // value of offset and returns, otherwise offset remains unchanged.
449 void HandleSpecialTextOffset(LONG* offset); 477 void HandleSpecialTextOffset(LONG* offset);
450 478
(...skipping 15 matching lines...) Expand all
466 // Does not return a new reference. 494 // Does not return a new reference.
467 AXPlatformNodeWin* GetTargetFromChildID(const VARIANT& var_id); 495 AXPlatformNodeWin* GetTargetFromChildID(const VARIANT& var_id);
468 496
469 // Returns true if this node is in a treegrid. 497 // Returns true if this node is in a treegrid.
470 bool IsInTreeGrid(); 498 bool IsInTreeGrid();
471 }; 499 };
472 500
473 } // namespace ui 501 } // namespace ui
474 502
475 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_ 503 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_WIN_H_
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_base.cc ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698