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

Unified Diff: content/browser/accessibility/browser_accessibility_win.h

Issue 8416034: Support IAccessibleHypertext. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add unit tests. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_win.h
diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h
index d20b650dd30ed624545a5ccb8a0e01a804f6f9e3..8a5ce6c19512fbe2ac931c990617744760c60c2f 100644
--- a/content/browser/accessibility/browser_accessibility_win.h
+++ b/content/browser/accessibility/browser_accessibility_win.h
@@ -40,11 +40,12 @@ BrowserAccessibilityWin
public CComObjectRootEx<CComMultiThreadModel>,
public IDispatchImpl<IAccessible2, &IID_IAccessible2,
&LIBID_IAccessible2Lib>,
+ public IAccessibleHyperlink,
dmazzoni 2011/11/01 05:08:34 Add IAccessibleAction here?
David Tseng 2011/11/01 19:38:04 IAccessibleHyperlink : IAccessibleAction
+ public IAccessibleHypertext,
public IAccessibleImage,
public IAccessibleTable,
public IAccessibleTable2,
public IAccessibleTableCell,
- public IAccessibleText,
public IAccessibleValue,
public IServiceProvider,
public ISimpleDOMDocument,
@@ -54,12 +55,14 @@ BrowserAccessibilityWin
BEGIN_COM_MAP(BrowserAccessibilityWin)
COM_INTERFACE_ENTRY2(IDispatch, IAccessible2)
COM_INTERFACE_ENTRY2(IAccessible, IAccessible2)
+ COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext)
COM_INTERFACE_ENTRY(IAccessible2)
+ COM_INTERFACE_ENTRY(IAccessibleHyperlink)
+ COM_INTERFACE_ENTRY(IAccessibleHypertext)
COM_INTERFACE_ENTRY(IAccessibleImage)
COM_INTERFACE_ENTRY(IAccessibleTable)
COM_INTERFACE_ENTRY(IAccessibleTable2)
COM_INTERFACE_ENTRY(IAccessibleTableCell)
- COM_INTERFACE_ENTRY(IAccessibleText)
COM_INTERFACE_ENTRY(IAccessibleValue)
COM_INTERFACE_ENTRY(IServiceProvider)
COM_INTERFACE_ENTRY(ISimpleDOMDocument)
@@ -67,6 +70,9 @@ BrowserAccessibilityWin
COM_INTERFACE_ENTRY(ISimpleDOMText)
END_COM_MAP()
+ // Represents a non-static text node in IAccessibleHypertext.
dmazzoni 2011/11/01 05:08:34 Add a tiny bit more detail so someone new to this
David Tseng 2011/11/01 19:38:04 Done.
+ static const char16 kEmbeddedCharacter[];
+
CONTENT_EXPORT BrowserAccessibilityWin();
CONTENT_EXPORT virtual ~BrowserAccessibilityWin();
@@ -478,6 +484,66 @@ BrowserAccessibilityWin
}
//
+ // IAccessibleHypertext methods.
+ //
+
+ CONTENT_EXPORT STDMETHODIMP get_nHyperlinks(long* hyperlinkCount);
dmazzoni 2011/11/01 05:08:34 Nit: Convert all of the method parameters to hacke
David Tseng 2011/11/01 19:38:04 Done.
+
+ CONTENT_EXPORT STDMETHODIMP get_hyperlink(
+ long index,
+ IAccessibleHyperlink** hyperlink);
+
+ CONTENT_EXPORT STDMETHODIMP get_hyperlinkIndex(long char_index,
+ long* hyperlink_index);
+
+ // IAccessibleHyperlink not implemented.
+ CONTENT_EXPORT STDMETHODIMP get_anchor(long index, VARIANT* anchor) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_anchorTarget(
+ long index,
+ VARIANT* anchorTarget) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_startIndex( long* index) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_endIndex( long* index) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_valid(boolean* valid) {
+ return E_NOTIMPL;
+ }
+
+ // IAccessibleAction not implemented.
+ CONTENT_EXPORT STDMETHODIMP nActions(long* nActions) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP doAction(long actionIndex) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_description(
+ long actionIndex,
+ BSTR* description) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_keyBinding(
+ long actionIndex,
+ long nMaxBindings,
+ BSTR** keyBindings,
+ long* nBindings) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_name(long actionIndex, BSTR* name) {
+ return E_NOTIMPL;
+ }
+ CONTENT_EXPORT STDMETHODIMP get_localizedName(
+ long actionIndex,
+ BSTR* localizedName) {
+ return E_NOTIMPL;
+ }
+
+ //
// IAccessibleValue methods.
//
@@ -715,6 +781,12 @@ BrowserAccessibilityWin
// Relationships between this node and other nodes.
std::vector<BrowserAccessibilityRelation*> relations_;
+ // The text of this node including embedded hyperlink characters.
+ string16 hypertext_;
+
+ // Maps the |hypertext_| embedded character offset to a child of |children_|.
+ std::map<int32, int32> hyperlink_offset_to_index_;
+
// Give BrowserAccessibility::Create access to our constructor.
friend class BrowserAccessibility;
friend class BrowserAccessibilityRelation;

Powered by Google App Engine
This is Rietveld 408576698