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

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: Addressed comments. 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>
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 // bitmasks defined in ui::AXNodeData. 744 // bitmasks defined in ui::AXNodeData.
745 void InitRoleAndState(); 745 void InitRoleAndState();
746 746
747 // Retrieve the value of an attribute from the string attribute map and 747 // Retrieve the value of an attribute from the string attribute map and
748 // if found and nonempty, allocate a new BSTR (with SysAllocString) 748 // if found and nonempty, allocate a new BSTR (with SysAllocString)
749 // and return S_OK. If not found or empty, return S_FALSE. 749 // and return S_OK. If not found or empty, return S_FALSE.
750 HRESULT GetStringAttributeAsBstr( 750 HRESULT GetStringAttributeAsBstr(
751 ui::AXStringAttribute attribute, 751 ui::AXStringAttribute attribute,
752 BSTR* value_bstr); 752 BSTR* value_bstr);
753 753
754 // Escapes the following characters with backslash: backslash, colon, comma,
dmazzoni 2015/10/12 20:53:50 Nit: I'd prefer if you didn't list which character
755 // equals and semicolon.
756 // It's okay for input to be the same as output.
757 static void SanitizeStringAttributeForIA2(const base::string16& input,
758 base::string16* output);
759
754 // If the string attribute |attribute| is present, add its value as an 760 // If the string attribute |attribute| is present, add its value as an
755 // IAccessible2 attribute with the name |ia2_attr|. 761 // IAccessible2 attribute with the name |ia2_attr|.
756 void StringAttributeToIA2(ui::AXStringAttribute attribute, 762 void StringAttributeToIA2(ui::AXStringAttribute attribute,
757 const char* ia2_attr); 763 const char* ia2_attr);
758 764
759 // If the bool attribute |attribute| is present, add its value as an 765 // If the bool attribute |attribute| is present, add its value as an
760 // IAccessible2 attribute with the name |ia2_attr|. 766 // IAccessible2 attribute with the name |ia2_attr|.
761 void BoolAttributeToIA2(ui::AXBoolAttribute attribute, 767 void BoolAttributeToIA2(ui::AXBoolAttribute attribute,
762 const char* ia2_attr); 768 const char* ia2_attr);
763 769
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 // Give BrowserAccessibility::Create access to our constructor. 903 // Give BrowserAccessibility::Create access to our constructor.
898 friend class BrowserAccessibility; 904 friend class BrowserAccessibility;
899 friend class BrowserAccessibilityRelation; 905 friend class BrowserAccessibilityRelation;
900 906
901 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); 907 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin);
902 }; 908 };
903 909
904 } // namespace content 910 } // namespace content
905 911
906 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 912 #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