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

Unified Diff: ui/views/accessibility/native_view_accessibility_win.cc

Issue 23441024: Implement put_accvalue for textfields and location bar. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 4 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/views/accessibility/native_view_accessibility_win.cc
diff --git a/ui/views/accessibility/native_view_accessibility_win.cc b/ui/views/accessibility/native_view_accessibility_win.cc
index a0367fe1f1e32fa930a4799b3149ea597cd05e84..361e4f4ce497c87d0266825221b1908233e78e65 100644
--- a/ui/views/accessibility/native_view_accessibility_win.cc
+++ b/ui/views/accessibility/native_view_accessibility_win.cc
@@ -607,6 +607,24 @@ STDMETHODIMP NativeViewAccessibilityWin::get_accValue(
return S_OK;
}
+STDMETHODIMP NativeViewAccessibilityWin::put_accValue(
+ VARIANT var_id, BSTR new_value) {
msw 2013/08/31 20:22:36 nit: these arguments should be one-per line as-per
dmazzoni 2013/09/03 20:20:11 Done.
+ if (!IsValidId(var_id) || !new_value)
+ return E_INVALIDARG;
+
+ if (!view_)
+ return E_FAIL;
+
+ // Return an error if the view can't set the value.
+ ui::AccessibleViewState state;
+ view_->GetAccessibleState(&state);
+ if (state.set_value_callback.is_null())
+ return E_FAIL;
+
+ state.set_value_callback.Run(new_value);
+ return S_OK;
+}
+
// IAccessible functions not supported.
STDMETHODIMP NativeViewAccessibilityWin::get_accSelection(VARIANT* selected) {
@@ -644,12 +662,6 @@ STDMETHODIMP NativeViewAccessibilityWin::put_accName(
return E_NOTIMPL;
}
-STDMETHODIMP NativeViewAccessibilityWin::put_accValue(
- VARIANT var_id, BSTR put_val) {
- // Deprecated.
- return E_NOTIMPL;
-}
-
//
// IAccessible2
//

Powered by Google App Engine
This is Rietveld 408576698