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-08-06 02:17:39 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 02:17:39 +0000
commit9ab51ab5d3ecb79d7027af8df36714ae1e135fcf (patch)
tree8c61f9de9512f197d19780fbcc0cf324c52c8606 /chrome/browser/accessibility_events.h
parent4f0bfd8d0b191d82da365be79a4f1acc9adbabf9 (diff)
downloadchromium_src-9ab51ab5d3ecb79d7027af8df36714ae1e135fcf.zip
chromium_src-9ab51ab5d3ecb79d7027af8df36714ae1e135fcf.tar.gz
chromium_src-9ab51ab5d3ecb79d7027af8df36714ae1e135fcf.tar.bz2
Expose the type of an AccessibilityControlInfo. (This will allow us
to use this same accessibility event code to make the Chrome OS login screen speak, before accessibility extensions are loaded.) BUG=none TEST=none Review URL: http://codereview.chromium.org/3073026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55178 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/accessibility_events.h')
-rw-r--r--chrome/browser/accessibility_events.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/chrome/browser/accessibility_events.h b/chrome/browser/accessibility_events.h
index 33f44a4..29376cd 100644
--- a/chrome/browser/accessibility_events.h
+++ b/chrome/browser/accessibility_events.h
@@ -31,6 +31,10 @@ class AccessibilityControlInfo {
// a JavaScript object.
virtual void SerializeToDict(DictionaryValue *dict) const;
+ // Return the specific type of this control, which will be one of the
+ // string constants defined in extension_accessibility_api_constants.h.
+ virtual const char* type() const = 0;
+
Profile* profile() const { return profile_; }
const std::string& name() const { return name_; }
@@ -54,7 +58,7 @@ class AccessibilityWindowInfo : public AccessibilityControlInfo {
AccessibilityWindowInfo(Profile* profile, std::string window_name)
: AccessibilityControlInfo(profile, window_name) { }
- virtual void SerializeToDict(DictionaryValue *dict) const;
+ virtual const char* type() const;
};
// Accessibility information about a push button passed to onControlFocused
@@ -64,7 +68,7 @@ class AccessibilityButtonInfo : public AccessibilityControlInfo {
AccessibilityButtonInfo(Profile* profile, std::string button_name)
: AccessibilityControlInfo(profile, button_name) { }
- virtual void SerializeToDict(DictionaryValue *dict) const;
+ virtual const char* type() const;
};
// Accessibility information about a hyperlink passed to onControlFocused
@@ -74,7 +78,7 @@ class AccessibilityLinkInfo : public AccessibilityControlInfo {
AccessibilityLinkInfo(Profile* profile, std::string link_name)
: AccessibilityControlInfo(profile, link_name) { }
- virtual void SerializeToDict(DictionaryValue *dict) const;
+ virtual const char* type() const;
};
// Accessibility information about a radio button passed to onControlFocused
@@ -92,6 +96,8 @@ class AccessibilityRadioButtonInfo : public AccessibilityControlInfo {
item_count_(item_count) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetChecked(bool checked) { checked_ = checked; }
@@ -114,6 +120,8 @@ class AccessibilityCheckboxInfo : public AccessibilityControlInfo {
checked_(checked) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetChecked(bool checked) { checked_ = checked; }
@@ -135,6 +143,8 @@ class AccessibilityTabInfo : public AccessibilityControlInfo {
tab_count_(tab_count) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetTab(int tab_index, std::string tab_name) {
@@ -163,6 +173,8 @@ class AccessibilityComboBoxInfo : public AccessibilityControlInfo {
item_count_(item_count) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetValue(int item_index, std::string value) {
@@ -193,6 +205,8 @@ class AccessibilityTextBoxInfo : public AccessibilityControlInfo {
selection_end_(0) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetValue(std::string value, int selection_start, int selection_end) {
@@ -223,6 +237,8 @@ class AccessibilityListBoxInfo : public AccessibilityControlInfo {
item_count_(item_count) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
void SetValue(int item_index, std::string value) {
@@ -246,7 +262,7 @@ class AccessibilityMenuInfo : public AccessibilityControlInfo {
AccessibilityMenuInfo(Profile* profile, std::string menu_name)
: AccessibilityControlInfo(profile, menu_name) { }
- virtual void SerializeToDict(DictionaryValue *dict) const;
+ virtual const char* type() const;
};
// Accessibility information about a menu item; this class is used by
@@ -264,6 +280,8 @@ class AccessibilityMenuItemInfo : public AccessibilityControlInfo {
item_count_(item_count) {
}
+ virtual const char* type() const;
+
virtual void SerializeToDict(DictionaryValue *dict) const;
private: