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

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.h

Issue 1397183002: Escapes backslash, colon, comma, equals and semicolon in IAccessible2 string attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased with master. Created 5 years, 2 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
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_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>
11 #include <UIAutomationCore.h> 11 #include <UIAutomationCore.h>
12 12
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/gtest_prod_util.h"
16 #include "content/browser/accessibility/browser_accessibility.h" 17 #include "content/browser/accessibility/browser_accessibility.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "third_party/iaccessible2/ia2_api_all.h" 19 #include "third_party/iaccessible2/ia2_api_all.h"
19 #include "third_party/isimpledom/ISimpleDOMDocument.h" 20 #include "third_party/isimpledom/ISimpleDOMDocument.h"
20 #include "third_party/isimpledom/ISimpleDOMNode.h" 21 #include "third_party/isimpledom/ISimpleDOMNode.h"
21 #include "third_party/isimpledom/ISimpleDOMText.h" 22 #include "third_party/isimpledom/ISimpleDOMText.h"
22 23
23 namespace ui { 24 namespace ui {
24 enum TextBoundaryDirection; 25 enum TextBoundaryDirection;
25 enum TextBoundaryType; 26 enum TextBoundaryType;
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 // bitmasks defined in ui::AXNodeData. 745 // bitmasks defined in ui::AXNodeData.
745 void InitRoleAndState(); 746 void InitRoleAndState();
746 747
747 // Retrieve the value of an attribute from the string attribute map and 748 // Retrieve the value of an attribute from the string attribute map and
748 // if found and nonempty, allocate a new BSTR (with SysAllocString) 749 // if found and nonempty, allocate a new BSTR (with SysAllocString)
749 // and return S_OK. If not found or empty, return S_FALSE. 750 // and return S_OK. If not found or empty, return S_FALSE.
750 HRESULT GetStringAttributeAsBstr( 751 HRESULT GetStringAttributeAsBstr(
751 ui::AXStringAttribute attribute, 752 ui::AXStringAttribute attribute,
752 BSTR* value_bstr); 753 BSTR* value_bstr);
753 754
755 // Escapes characters in string attributes as required by the IA2 Spec.
756 // It's okay for input to be the same as output.
757 CONTENT_EXPORT static void SanitizeStringAttributeForIA2(
758 const base::string16& input,
759 base::string16* output);
760 FRIEND_TEST_ALL_PREFIXES(BrowserAccessibilityTest,
761 TestSanitizeStringAttributeForIA2);
762
754 // If the string attribute |attribute| is present, add its value as an 763 // If the string attribute |attribute| is present, add its value as an
755 // IAccessible2 attribute with the name |ia2_attr|. 764 // IAccessible2 attribute with the name |ia2_attr|.
756 void StringAttributeToIA2(ui::AXStringAttribute attribute, 765 void StringAttributeToIA2(ui::AXStringAttribute attribute,
757 const char* ia2_attr); 766 const char* ia2_attr);
758 767
759 // If the bool attribute |attribute| is present, add its value as an 768 // If the bool attribute |attribute| is present, add its value as an
760 // IAccessible2 attribute with the name |ia2_attr|. 769 // IAccessible2 attribute with the name |ia2_attr|.
761 void BoolAttributeToIA2(ui::AXBoolAttribute attribute, 770 void BoolAttributeToIA2(ui::AXBoolAttribute attribute,
762 const char* ia2_attr); 771 const char* ia2_attr);
763 772
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 // Give BrowserAccessibility::Create access to our constructor. 906 // Give BrowserAccessibility::Create access to our constructor.
898 friend class BrowserAccessibility; 907 friend class BrowserAccessibility;
899 friend class BrowserAccessibilityRelation; 908 friend class BrowserAccessibilityRelation;
900 909
901 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); 910 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin);
902 }; 911 };
903 912
904 } // namespace content 913 } // namespace content
905 914
906 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 915 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698