| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/accessibility/accessibility_events.h" | 5 #include "chrome/browser/accessibility/accessibility_events.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 | 8 |
| 9 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" | 9 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 Profile* profile, const std::string& control_name) | 36 Profile* profile, const std::string& control_name) |
| 37 : AccessibilityEventInfo(profile), name_(control_name) { | 37 : AccessibilityEventInfo(profile), name_(control_name) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 AccessibilityControlInfo::~AccessibilityControlInfo() { | 40 AccessibilityControlInfo::~AccessibilityControlInfo() { |
| 41 } | 41 } |
| 42 | 42 |
| 43 void AccessibilityControlInfo::SerializeToDict(DictionaryValue *dict) const { | 43 void AccessibilityControlInfo::SerializeToDict(DictionaryValue *dict) const { |
| 44 dict->SetString(keys::kNameKey, name_); | 44 dict->SetString(keys::kNameKey, name_); |
| 45 dict->SetString(keys::kTypeKey, type()); | 45 dict->SetString(keys::kTypeKey, type()); |
| 46 if (!context_.empty()) |
| 47 dict->SetString(keys::kContextKey, context_); |
| 46 } | 48 } |
| 47 | 49 |
| 48 AccessibilityWindowInfo::AccessibilityWindowInfo(Profile* profile, | 50 AccessibilityWindowInfo::AccessibilityWindowInfo(Profile* profile, |
| 49 const std::string& window_name) | 51 const std::string& window_name) |
| 50 : AccessibilityControlInfo(profile, window_name) { | 52 : AccessibilityControlInfo(profile, window_name) { |
| 51 } | 53 } |
| 52 | 54 |
| 53 const char* AccessibilityWindowInfo::type() const { | 55 const char* AccessibilityWindowInfo::type() const { |
| 54 return keys::kTypeWindow; | 56 return keys::kTypeWindow; |
| 55 } | 57 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 const char* AccessibilityMenuItemInfo::type() const { | 251 const char* AccessibilityMenuItemInfo::type() const { |
| 250 return keys::kTypeMenuItem; | 252 return keys::kTypeMenuItem; |
| 251 } | 253 } |
| 252 | 254 |
| 253 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { | 255 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { |
| 254 AccessibilityControlInfo::SerializeToDict(dict); | 256 AccessibilityControlInfo::SerializeToDict(dict); |
| 255 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); | 257 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); |
| 256 dict->SetInteger(keys::kItemIndexKey, item_index_); | 258 dict->SetInteger(keys::kItemIndexKey, item_index_); |
| 257 dict->SetInteger(keys::kItemCountKey, item_count_); | 259 dict->SetInteger(keys::kItemCountKey, item_count_); |
| 258 } | 260 } |
| OLD | NEW |