summaryrefslogtreecommitdiffstats
path: root/chrome/browser/accessibility_events.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 13:46:24 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 13:46:24 +0000
commit83acf96f3a4632e4c962ebc3f0f84e3f989322df (patch)
tree1d56226dd349c3648a7675aef7e365556fe245fe /chrome/browser/accessibility_events.h
parente80bea9a23243ddf8f58c0358df8118159800b53 (diff)
downloadchromium_src-83acf96f3a4632e4c962ebc3f0f84e3f989322df.zip
chromium_src-83acf96f3a4632e4c962ebc3f0f84e3f989322df.tar.gz
chromium_src-83acf96f3a4632e4c962ebc3f0f84e3f989322df.tar.bz2
Add menu and menu item events to the accessibility extension api, and
generate menu item notifications for gtk menus. The code to generate menu open and close events is a little more complicated and will come in a future patch. BUG=none TEST=navigated menus with keyboard, watched notifications fire Review URL: http://codereview.chromium.org/1585011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/accessibility_events.h')
-rw-r--r--chrome/browser/accessibility_events.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/browser/accessibility_events.h b/chrome/browser/accessibility_events.h
index da9189c..a1fe7ae 100644
--- a/chrome/browser/accessibility_events.h
+++ b/chrome/browser/accessibility_events.h
@@ -238,4 +238,38 @@ class AccessibilityListBoxInfo : public AccessibilityControlInfo {
int item_count_;
};
+// Accessibility information about a menu; this class is used by
+// onMenuOpened, onMenuClosed, and onControlFocused event listeners.
+class AccessibilityMenuInfo : public AccessibilityControlInfo {
+ public:
+ AccessibilityMenuInfo(Profile* profile, std::string menu_name)
+ : AccessibilityControlInfo(profile, menu_name) { }
+
+ virtual void SerializeToDict(DictionaryValue *dict) const;
+};
+
+// Accessibility information about a menu item; this class is used by
+// onControlFocused event listeners.
+class AccessibilityMenuItemInfo : public AccessibilityControlInfo {
+ public:
+ AccessibilityMenuItemInfo(Profile* profile,
+ std::string name,
+ bool has_submenu,
+ int item_index,
+ int item_count)
+ : AccessibilityControlInfo(profile, name),
+ has_submenu_(has_submenu),
+ item_index_(item_index),
+ item_count_(item_count) {
+ }
+
+ virtual void SerializeToDict(DictionaryValue *dict) const;
+
+ private:
+ bool has_submenu_;
+ // The 0-based index of the current item and the number of total items.
+ int item_index_;
+ int item_count_;
+};
+
#endif // CHROME_BROWSER_ACCESSIBILITY_EVENTS_H_