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

Unified Diff: base/win/accessibility_misc_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
« no previous file with comments | « base/win/accessibility_misc_utils.h ('k') | content/browser/accessibility/browser_accessibility_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/accessibility_misc_utils.cc
===================================================================
--- base/win/accessibility_misc_utils.cc (revision 0)
+++ base/win/accessibility_misc_utils.cc (revision 0)
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "base/win/accessibility_misc_utils.h"
+
+#include "base/logging.h"
+
+namespace base {
+namespace win {
+
+// UIA TextProvider implementation.
+UIATextProvider::UIATextProvider()
+ : editable_(false) {}
+
+// static
+bool UIATextProvider::CreateTextProvider(bool editable, IUnknown** provider) {
+ CComObject<UIATextProvider>* text_provider = NULL;
+ HRESULT hr = CComObject<UIATextProvider>::CreateInstance(&text_provider);
+ if (SUCCEEDED(hr)) {
+ DCHECK(text_provider);
+ text_provider->set_editable(editable);
+ text_provider->AddRef();
+ *provider = static_cast<ITextProvider*>(text_provider);
+ return true;
+ }
+ return false;
+}
+
+STDMETHODIMP UIATextProvider::get_IsReadOnly(BOOL* read_only) {
+ *read_only = !editable_;
+ return S_OK;
+}
+
+} // namespace win
+} // namespace base
Property changes on: base\win\accessibility_misc_utils.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « base/win/accessibility_misc_utils.h ('k') | content/browser/accessibility/browser_accessibility_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698