| 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/accessibility/accessibility_util.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 g_browser_process->local_state()->GetBoolean( | 88 g_browser_process->local_state()->GetBoolean( |
| 89 prefs::kSpokenFeedbackEnabled); | 89 prefs::kSpokenFeedbackEnabled); |
| 90 if (accessibility_enabled == enabled) { | 90 if (accessibility_enabled == enabled) { |
| 91 LOG(INFO) << "Accessibility is already " << | 91 LOG(INFO) << "Accessibility is already " << |
| 92 (enabled ? "enabled" : "disabled") << ". Going to do nothing."; | 92 (enabled ? "enabled" : "disabled") << ". Going to do nothing."; |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 | 95 |
| 96 g_browser_process->local_state()->SetBoolean( | 96 g_browser_process->local_state()->SetBoolean( |
| 97 prefs::kSpokenFeedbackEnabled, enabled); | 97 prefs::kSpokenFeedbackEnabled, enabled); |
| 98 g_browser_process->local_state()->ScheduleSavePersistentPrefs(); | 98 g_browser_process->local_state()->CommitPendingWrite(); |
| 99 ExtensionAccessibilityEventRouter::GetInstance()-> | 99 ExtensionAccessibilityEventRouter::GetInstance()-> |
| 100 SetAccessibilityEnabled(enabled); | 100 SetAccessibilityEnabled(enabled); |
| 101 BrowserAccessibilityState::GetInstance()->OnAccessibilityEnabledManually(); | 101 BrowserAccessibilityState::GetInstance()->OnAccessibilityEnabledManually(); |
| 102 | 102 |
| 103 Speak(enabled ? | 103 Speak(enabled ? |
| 104 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : | 104 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : |
| 105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str()); | 105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str()); |
| 106 | 106 |
| 107 // Load/Unload ChromeVox | 107 // Load/Unload ChromeVox |
| 108 Profile* profile = ProfileManager::GetDefaultProfile(); | 108 Profile* profile = ProfileManager::GetDefaultProfile(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return false; | 175 return false; |
| 176 } | 176 } |
| 177 PrefService* prefs = g_browser_process->local_state(); | 177 PrefService* prefs = g_browser_process->local_state(); |
| 178 bool accessibility_enabled = prefs && | 178 bool accessibility_enabled = prefs && |
| 179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled); | 179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled); |
| 180 return accessibility_enabled; | 180 return accessibility_enabled; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace accessibility | 183 } // namespace accessibility |
| 184 } // namespace chromeos | 184 } // namespace chromeos |
| OLD | NEW |