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 "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "content/common/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
15 | 15 |
16 namespace keys = extension_accessibility_api_constants; | 16 namespace keys = extension_accessibility_api_constants; |
17 | 17 |
18 void SendAccessibilityNotification( | 18 void SendAccessibilityNotification( |
19 int type, AccessibilityEventInfo* info) { | 19 int type, AccessibilityEventInfo* info) { |
20 Profile *profile = info->profile(); | 20 Profile *profile = info->profile(); |
21 if (profile->ShouldSendAccessibilityEvents()) { | 21 if (profile->ShouldSendAccessibilityEvents()) { |
22 NotificationService::current()->Notify( | 22 content::NotificationService::current()->Notify( |
23 type, | 23 type, |
24 content::Source<Profile>(profile), | 24 content::Source<Profile>(profile), |
25 content::Details<AccessibilityEventInfo>(info)); | 25 content::Details<AccessibilityEventInfo>(info)); |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 void SendAccessibilityVolumeNotification(double volume, bool is_muted) { | 29 void SendAccessibilityVolumeNotification(double volume, bool is_muted) { |
30 Profile* profile = ProfileManager::GetDefaultProfile(); | 30 Profile* profile = ProfileManager::GetDefaultProfile(); |
31 AccessibilityVolumeInfo info(profile, volume, is_muted); | 31 AccessibilityVolumeInfo info(profile, volume, is_muted); |
32 SendAccessibilityNotification( | 32 SendAccessibilityNotification( |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 const char* AccessibilityMenuItemInfo::type() const { | 236 const char* AccessibilityMenuItemInfo::type() const { |
237 return keys::kTypeMenuItem; | 237 return keys::kTypeMenuItem; |
238 } | 238 } |
239 | 239 |
240 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { | 240 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { |
241 AccessibilityControlInfo::SerializeToDict(dict); | 241 AccessibilityControlInfo::SerializeToDict(dict); |
242 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); | 242 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); |
243 dict->SetInteger(keys::kItemIndexKey, item_index_); | 243 dict->SetInteger(keys::kItemIndexKey, item_index_); |
244 dict->SetInteger(keys::kItemCountKey, item_count_); | 244 dict->SetInteger(keys::kItemCountKey, item_count_); |
245 } | 245 } |
OLD | NEW |