summaryrefslogtreecommitdiffstats
path: root/chrome/browser/accessibility_events.cc
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
committerIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
commit3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch)
tree7784b988ef1698cb6967ea1bdf07616237716c6c /chrome/browser/accessibility_events.cc
parentefc8475837ec58186051f23bb03542620424f6ce (diff)
downloadexternal_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2
Merge Chromium at 7.0.540.0 : Initial merge by git
Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15
Diffstat (limited to 'chrome/browser/accessibility_events.cc')
-rw-r--r--chrome/browser/accessibility_events.cc58
1 files changed, 39 insertions, 19 deletions
diff --git a/chrome/browser/accessibility_events.cc b/chrome/browser/accessibility_events.cc
index 79d2af9..aade4b3 100644
--- a/chrome/browser/accessibility_events.cc
+++ b/chrome/browser/accessibility_events.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/accessibility_events.h"
+#include "base/values.h"
+
#include "chrome/browser/extensions/extension_accessibility_api_constants.h"
#include "chrome/browser/profile.h"
#include "chrome/common/notification_service.h"
@@ -24,78 +26,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_);