| 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/chromeos/login/wizard_accessibility_helper.h" | 5 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_accessibility_api.h" | 10 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 RegisterNotifications(); | 50 RegisterNotifications(); |
| 51 // SetAccessibilityEnabled(true) fully enables accessibility. Init() is | 51 // SetAccessibilityEnabled(true) fully enables accessibility. Init() is |
| 52 // necessary during startup when the global accessibility pref is set but | 52 // necessary during startup when the global accessibility pref is set but |
| 53 // the notifications are not registered. | 53 // the notifications are not registered. |
| 54 SetAccessibilityEnabled(true); | 54 SetAccessibilityEnabled(true); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 void WizardAccessibilityHelper::RegisterNotifications() { | 58 void WizardAccessibilityHelper::RegisterNotifications() { |
| 59 registrar_.Add(accessibility_handler_.get(), | 59 registrar_.Add(accessibility_handler_.get(), |
| 60 NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, | 60 chrome::ACCESSIBILITY_CONTROL_FOCUSED, |
| 61 NotificationService::AllSources()); | 61 NotificationService::AllSources()); |
| 62 registrar_.Add(accessibility_handler_.get(), | 62 registrar_.Add(accessibility_handler_.get(), |
| 63 NotificationType::ACCESSIBILITY_CONTROL_ACTION, | 63 chrome::ACCESSIBILITY_CONTROL_ACTION, |
| 64 NotificationService::AllSources()); | 64 NotificationService::AllSources()); |
| 65 registrar_.Add(accessibility_handler_.get(), | 65 registrar_.Add(accessibility_handler_.get(), |
| 66 NotificationType::ACCESSIBILITY_TEXT_CHANGED, | 66 chrome::ACCESSIBILITY_TEXT_CHANGED, |
| 67 NotificationService::AllSources()); | 67 NotificationService::AllSources()); |
| 68 registrar_.Add(accessibility_handler_.get(), | 68 registrar_.Add(accessibility_handler_.get(), |
| 69 NotificationType::ACCESSIBILITY_MENU_OPENED, | 69 chrome::ACCESSIBILITY_MENU_OPENED, |
| 70 NotificationService::AllSources()); | 70 NotificationService::AllSources()); |
| 71 registrar_.Add(accessibility_handler_.get(), | 71 registrar_.Add(accessibility_handler_.get(), |
| 72 NotificationType::ACCESSIBILITY_MENU_CLOSED, | 72 chrome::ACCESSIBILITY_MENU_CLOSED, |
| 73 NotificationService::AllSources()); | 73 NotificationService::AllSources()); |
| 74 registered_notifications_ = true; | 74 registered_notifications_ = true; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void WizardAccessibilityHelper::UnregisterNotifications() { | 77 void WizardAccessibilityHelper::UnregisterNotifications() { |
| 78 if (!registered_notifications_) | 78 if (!registered_notifications_) |
| 79 return; | 79 return; |
| 80 registrar_.RemoveAll(); | 80 registrar_.RemoveAll(); |
| 81 registered_notifications_ = false; | 81 registered_notifications_ = false; |
| 82 } | 82 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 SetAccessibilityEnabled(enabled); | 118 SetAccessibilityEnabled(enabled); |
| 119 if (doSpeak) { | 119 if (doSpeak) { |
| 120 accessibility_handler_->Speak(enabled ? | 120 accessibility_handler_->Speak(enabled ? |
| 121 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : | 121 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : |
| 122 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), | 122 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), |
| 123 false, true); | 123 false, true); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace chromeos | 127 } // namespace chromeos |
| OLD | NEW |