summaryrefslogtreecommitdiffstats
path: root/chrome/browser/accessibility_events.cc
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.cc
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.cc')
-rw-r--r--chrome/browser/accessibility_events.cc56
1 files changed, 37 insertions, 19 deletions
diff --git a/chrome/browser/accessibility_events.cc b/chrome/browser/accessibility_events.cc
index 79d2af9..068a3b4 100644
--- a/chrome/browser/accessibility_events.cc
+++ b/chrome/browser/accessibility_events.cc
@@ -24,78 +24,96 @@ void SendAccessibilityNotification(
void AccessibilityControlInfo::SerializeToDict(DictionaryValue *dict) const {
dict->SetString(keys::kNameKey, name_);
+ dict->SetString(keys::kTypeKey, type());
}
-void AccessibilityWindowInfo::SerializeToDict(DictionaryValue *dict) const {
- AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeWindow);
+const char* AccessibilityWindowInfo::type() const {
+ return keys::kTypeWindow;
}
-void AccessibilityButtonInfo::SerializeToDict(DictionaryValue *dict) const {
- AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeButton);
+const char* AccessibilityButtonInfo::type() const {
+ return keys::kTypeButton;
}
-void AccessibilityLinkInfo::SerializeToDict(DictionaryValue *dict) const {
- AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeLink);
+const char* AccessibilityLinkInfo::type() const {
+ return keys::kTypeLink;
+}
+
+const char* AccessibilityRadioButtonInfo::type() const {
+ return keys::kTypeRadioButton;
}
void AccessibilityRadioButtonInfo::SerializeToDict(
DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeRadioButton);
dict->SetBoolean(keys::kCheckedKey, checked_);
dict->SetInteger(keys::kItemIndexKey, item_index_);
dict->SetInteger(keys::kItemCountKey, item_count_);
}
+const char* AccessibilityCheckboxInfo::type() const {
+ return keys::kTypeCheckbox;
+}
+
void AccessibilityCheckboxInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeCheckbox);
dict->SetBoolean(keys::kCheckedKey, checked_);
}
+const char* AccessibilityTabInfo::type() const {
+ return keys::kTypeTab;
+}
+
void AccessibilityTabInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeTab);
dict->SetInteger(keys::kItemIndexKey, tab_index_);
dict->SetInteger(keys::kItemCountKey, tab_count_);
}
+const char* AccessibilityComboBoxInfo::type() const {
+ return keys::kTypeComboBox;
+}
+
void AccessibilityComboBoxInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeComboBox);
dict->SetString(keys::kValueKey, value_);
dict->SetInteger(keys::kItemIndexKey, item_index_);
dict->SetInteger(keys::kItemCountKey, item_count_);
}
+const char* AccessibilityTextBoxInfo::type() const {
+ return keys::kTypeTextBox;
+}
+
void AccessibilityTextBoxInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeTextBox);
dict->SetString(keys::kValueKey, value_);
dict->SetBoolean(keys::kPasswordKey, password_);
dict->SetInteger(keys::kSelectionStartKey, selection_start_);
dict->SetInteger(keys::kSelectionEndKey, selection_end_);
}
+const char* AccessibilityListBoxInfo::type() const {
+ return keys::kTypeListBox;
+}
+
void AccessibilityListBoxInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeListBox);
dict->SetString(keys::kValueKey, value_);
dict->SetInteger(keys::kItemIndexKey, item_index_);
dict->SetInteger(keys::kItemCountKey, item_count_);
}
-void AccessibilityMenuInfo::SerializeToDict(DictionaryValue *dict) const {
- AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeMenu);
+const char* AccessibilityMenuInfo::type() const {
+ return keys::kTypeMenu;
+}
+
+const char* AccessibilityMenuItemInfo::type() const {
+ return keys::kTypeMenuItem;
}
void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const {
AccessibilityControlInfo::SerializeToDict(dict);
- dict->SetString(keys::kTypeKey, keys::kTypeMenuItem);
dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_);
dict->SetInteger(keys::kItemIndexKey, item_index_);
dict->SetInteger(keys::kItemCountKey, item_count_);