summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_accessibility.h
diff options
context:
space:
mode:
authorklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 00:53:06 +0000
committerklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 00:53:06 +0000
commite846d0dba2bf9506a929c9e16294997e37014039 (patch)
tree5ac70d2216fd450b3d4f164a26f752504c8cb220 /chrome/browser/browser_accessibility.h
parentfabd89f6aa700cb0e59b04e92ce54e729cbd0c66 (diff)
downloadchromium_src-e846d0dba2bf9506a929c9e16294997e37014039.zip
chromium_src-e846d0dba2bf9506a929c9e16294997e37014039.tar.gz
chromium_src-e846d0dba2bf9506a929c9e16294997e37014039.tar.bz2
Adds propagation and handling of render-side focus events, for the benefit of assistive technologies (accessibility). Also cleans up the handling of WM_GETOBJECT in RenderWidgetHostViewWin and WidgetWin, as well as in BrowserAccessibilityManager.
Review URL: http://codereview.chromium.org/115374 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_accessibility.h')
-rw-r--r--chrome/browser/browser_accessibility.h50
1 files changed, 31 insertions, 19 deletions
diff --git a/chrome/browser/browser_accessibility.h b/chrome/browser/browser_accessibility.h
index 8b56662..c8d4187 100644
--- a/chrome/browser/browser_accessibility.h
+++ b/chrome/browser/browser_accessibility.h
@@ -10,7 +10,6 @@
#include <oleacc.h>
-#include "base/basictypes.h"
#include "webkit/glue/webaccessibility.h"
using webkit_glue::WebAccessibility;
@@ -33,9 +32,14 @@ class ATL_NO_VTABLE BrowserAccessibility
COM_INTERFACE_ENTRY(IAccessible)
END_COM_MAP()
- BrowserAccessibility();
+ BrowserAccessibility() {}
~BrowserAccessibility() {}
+ HRESULT Initialize(int iaccessible_id,
+ int routing_id,
+ int process_id,
+ HWND parent_hwnd);
+
// Supported IAccessible methods.
// Performs the default action on a given object.
@@ -91,7 +95,7 @@ class ATL_NO_VTABLE BrowserAccessibility
STDMETHODIMP get_accValue(VARIANT var_id, BSTR* value);
// Non-supported (by WebKit) IAccessible methods.
- STDMETHODIMP accSelect(LONG flags_sel, VARIANT var_id);
+ STDMETHODIMP accSelect(LONG flags_sel, VARIANT var_id) { return E_NOTIMPL; }
STDMETHODIMP get_accHelpTopic(BSTR* help_file,
VARIANT var_id,
@@ -100,20 +104,11 @@ class ATL_NO_VTABLE BrowserAccessibility
STDMETHODIMP get_accSelection(VARIANT* selected);
// Deprecated functions, not implemented here.
- STDMETHODIMP put_accName(VARIANT var_id, BSTR put_name);
- STDMETHODIMP put_accValue(VARIANT var_id, BSTR put_val);
-
- // Modify/retrieve the unique id of this IAccessible instance.
- void set_iaccessible_id(int iaccessible_id) {
- iaccessible_id_ = iaccessible_id;
- }
- int iaccessible_id() const { return iaccessible_id_; }
+ STDMETHODIMP put_accName(VARIANT var_id, BSTR put_name) { return E_NOTIMPL; }
+ STDMETHODIMP put_accValue(VARIANT var_id, BSTR put_val) { return E_NOTIMPL; }
- // Modify/retrieve the unique id of this IAccessible's routing variables.
- void set_instance_id(int instance_id) {
- instance_id_ = instance_id;
- }
- int instance_id() const { return instance_id_; }
+ // Accessors/mutators.
+ HWND parent_hwnd() const { return parent_hwnd_;}
// Modify/retrieve the state (active/inactive) of this instance.
void set_instance_active(bool instance_active) {
@@ -121,6 +116,13 @@ class ATL_NO_VTABLE BrowserAccessibility
}
int instance_active() const { return instance_active_; }
+ void set_direct_descendant(bool direct_descendant) {
+ direct_descendant_ = direct_descendant;
+ }
+ bool direct_descendant() const { return direct_descendant_; }
+
+ int routing_id() const { return routing_id_; }
+
private:
// Creates an empty VARIANT. Used as the equivalent of a NULL (unused) input
// parameter.
@@ -148,7 +150,6 @@ class ATL_NO_VTABLE BrowserAccessibility
// Accessors.
const WebAccessibility::OutParams& response();
- HWND parent_hwnd();
// Returns a conversion from the BrowserAccessibilityRole (as defined in
// webkit/glue/webaccessibility.h) to an MSAA role.
@@ -162,10 +163,21 @@ class ATL_NO_VTABLE BrowserAccessibility
// mapping it to the correct IAccessible on that side. Initialized to -1.
int iaccessible_id_;
- // The unique id of this IAccessible instance. Used to help
+ // The unique ids of this IAccessible instance. Used to help
// BrowserAccessibilityManager instance retrieve the correct member
// variables for this process.
- int instance_id_;
+ int routing_id_;
+ int process_id_;
+
+ HWND parent_hwnd_;
+
+ // Indicates if an incoming request for child information relates to a child
+ // id of a direct child of the BrowserAccessibility object, or if it refers
+ // to an object elsewhere in the MSAA tree. Set by BrowserAccessibilityManager
+ // and applicable only to the root BrowserAccessibility object (id 0). Needed
+ // to properly handled MSAA focus events, where the child id is the only
+ // parameter in our control.
+ bool direct_descendant_;
// The instance should only be active if there is a non-terminated
// RenderProcessHost associated with it. The BrowserAccessibilityManager keeps