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

Unified Diff: chrome/browser/ui/views/accessibility_event_router_views.cc

Issue 6961027: Change event routers from singletons to being owned by the ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asargent and dmazzoni's comments Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/accessibility_event_router_views.cc
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index 34fb85e5432977f2818036a44098d8b9b54adc7c..547c10e3aeba7d13c220457d34425c1731e9a435 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -47,10 +47,8 @@ AccessibilityEventRouterViews* AccessibilityEventRouterViews::GetInstance() {
void AccessibilityEventRouterViews::HandleAccessibilityEvent(
views::View* view, ui::AccessibilityTypes::Event event_type) {
- if (!ExtensionAccessibilityEventRouter::GetInstance()->
- IsAccessibilityEnabled()) {
- return;
- }
+ // We check if accessibility is enabled in DispatchAccessibilityNotification,
dmazzoni 2011/05/24 18:19:52 I don't think this comment is needed, it's only he
+ // after getting the profile for this view.
switch (event_type) {
case ui::AccessibilityTypes::EVENT_FOCUS:
@@ -92,13 +90,13 @@ void AccessibilityEventRouterViews::HandleMenuItemFocused(
int item_index,
int item_count,
bool has_submenu) {
- if (!ExtensionAccessibilityEventRouter::GetInstance()->
- IsAccessibilityEnabled()) {
+ if (!most_recent_profile_)
return;
- }
- if (!most_recent_profile_)
+ if (!most_recent_profile_->accessibility_event_router()->
+ IsAccessibilityEnabled()) {
return;
+ }
AccessibilityMenuItemInfo info(
most_recent_profile_,
@@ -141,6 +139,10 @@ void AccessibilityEventRouterViews::DispatchAccessibilityNotification(
return;
}
+ if (!profile->accessibility_event_router()->IsAccessibilityEnabled()) {
+ return;
+ }
+
most_recent_profile_ = profile;
std::string class_name = view->GetClassName();
@@ -294,4 +296,3 @@ void AccessibilityEventRouterViews::SendCheckboxNotification(
profile, name, state.state == ui::AccessibilityTypes::STATE_CHECKED);
SendAccessibilityNotification(type, &info);
}
-

Powered by Google App Engine
This is Rietveld 408576698