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_events.h" | 5 #include "chrome/browser/accessibility_events.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 | 8 |
9 #include "chrome/browser/extensions/extension_accessibility_api_constants.h" | 9 #include "chrome/browser/extensions/extension_accessibility_api_constants.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "content/common/content_notification_types.h" |
11 #include "content/common/notification_service.h" | 12 #include "content/common/notification_service.h" |
12 #include "content/common/notification_type.h" | |
13 | 13 |
14 namespace keys = extension_accessibility_api_constants; | 14 namespace keys = extension_accessibility_api_constants; |
15 | 15 |
16 void SendAccessibilityNotification( | 16 void SendAccessibilityNotification( |
17 NotificationType type, AccessibilityControlInfo* info) { | 17 int type, AccessibilityControlInfo* info) { |
18 Profile *profile = info->profile(); | 18 Profile *profile = info->profile(); |
19 if (profile->ShouldSendAccessibilityEvents()) { | 19 if (profile->ShouldSendAccessibilityEvents()) { |
20 NotificationService::current()->Notify( | 20 NotificationService::current()->Notify( |
21 type, | 21 type, |
22 Source<Profile>(profile), | 22 Source<Profile>(profile), |
23 Details<AccessibilityControlInfo>(info)); | 23 Details<AccessibilityControlInfo>(info)); |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 AccessibilityControlInfo::AccessibilityControlInfo( | 27 AccessibilityControlInfo::AccessibilityControlInfo( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 const char* AccessibilityMenuItemInfo::type() const { | 211 const char* AccessibilityMenuItemInfo::type() const { |
212 return keys::kTypeMenuItem; | 212 return keys::kTypeMenuItem; |
213 } | 213 } |
214 | 214 |
215 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { | 215 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { |
216 AccessibilityControlInfo::SerializeToDict(dict); | 216 AccessibilityControlInfo::SerializeToDict(dict); |
217 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); | 217 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); |
218 dict->SetInteger(keys::kItemIndexKey, item_index_); | 218 dict->SetInteger(keys::kItemIndexKey, item_index_); |
219 dict->SetInteger(keys::kItemCountKey, item_count_); | 219 dict->SetInteger(keys::kItemCountKey, item_count_); |
220 } | 220 } |
OLD | NEW |