Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: chrome/browser/accessibility_events.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/accessibility/renderer_accessibility_browsertest.cc ('k') | chrome/browser/alternate_nav_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698