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

Unified Diff: ui/base/accessibility/accessible_text_utils.cc

Issue 9958139: Add support for UIA accessibility interfaces like IAccessibleEx and IRawElementProviderSimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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: ui/base/accessibility/accessible_text_utils.cc
===================================================================
--- ui/base/accessibility/accessible_text_utils.cc (revision 130412)
+++ ui/base/accessibility/accessible_text_utils.cc (working copy)
@@ -87,4 +87,27 @@
}
}
+#if defined(OS_WIN)
+// UIA TextProvider implementation.
+UIATextProvider::UIATextProvider()
+ : editable_(false) {}
+
+// static
+bool UIATextProvider::CreateTextProvider(bool editable, IUnknown** provider) {
+ CComObject<ui::UIATextProvider>* text_provider = NULL;
+ CComObject<ui::UIATextProvider>::CreateInstance(&text_provider);
+ DCHECK(text_provider);
+ text_provider->set_editable(true);
dmazzoni 2012/04/04 06:02:00 set_editable(editable)
ananta 2012/04/04 19:23:00 Done.
+ text_provider->AddRef();
+ HRESULT hr = text_provider->QueryInterface(
dmazzoni 2012/04/04 06:02:00 Is this necessary? I think you should be able to j
ananta 2012/04/04 19:23:00 That returns the following error. error C2594: '='
dmazzoni 2012/04/04 19:30:15 This is because of the multiple inheritance. You s
ananta 2012/04/04 21:40:17 Done.
+ IID_IUnknown, reinterpret_cast<void**>(provider));
+ text_provider->Release();
+ return hr == S_OK;
+}
+
+STDMETHODIMP UIATextProvider::get_IsReadOnly(BOOL* read_only) {
+ *read_only = !editable_;
+ return S_OK;
+}
+#endif // OS_WIN
} // Namespace ui

Powered by Google App Engine
This is Rietveld 408576698