| 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_util.h" | 5 #include "chrome/browser/chromeos/accessibility_util.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 RenderViewHost* render_view_host_; | 76 RenderViewHost* render_view_host_; |
| 77 std::queue<ExtensionResource> resources_; | 77 std::queue<ExtensionResource> resources_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 void EnableAccessibility(bool enabled, WebUI* login_web_ui) { | 80 void EnableAccessibility(bool enabled, WebUI* login_web_ui) { |
| 81 bool accessibility_enabled = g_browser_process && | 81 bool accessibility_enabled = g_browser_process && |
| 82 g_browser_process->local_state()->GetBoolean( | 82 g_browser_process->local_state()->GetBoolean( |
| 83 prefs::kAccessibilityEnabled); | 83 prefs::kAccessibilityEnabled); |
| 84 if (accessibility_enabled == enabled) { | 84 if (accessibility_enabled == enabled) { |
| 85 LOG(INFO) << "Accessibility is already " << | 85 LOG(INFO) << "Accessibility is already " << |
| 86 (enabled ? "enabled" : "diabled") << ". Going to do nothing."; | 86 (enabled ? "enabled" : "disabled") << ". Going to do nothing."; |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 | 89 |
| 90 g_browser_process->local_state()->SetBoolean( | 90 g_browser_process->local_state()->SetBoolean( |
| 91 prefs::kAccessibilityEnabled, enabled); | 91 prefs::kAccessibilityEnabled, enabled); |
| 92 // Explicitly call SavePersistentPrefs instead of ScheduleSavePersistentPrefs | 92 // Explicitly call SavePersistentPrefs instead of ScheduleSavePersistentPrefs |
| 93 // so that this change gets written immediately, in case the user shuts | 93 // so that this change gets written immediately, in case the user shuts |
| 94 // down right now. TODO(dmazzoni) switch this back to | 94 // down right now. TODO(dmazzoni) switch this back to |
| 95 // ScheduleSavePersistentPrefs once http://crosbug.com/19491 is fixed. | 95 // ScheduleSavePersistentPrefs once http://crosbug.com/19491 is fixed. |
| 96 g_browser_process->local_state()->SavePersistentPrefs(); | 96 g_browser_process->local_state()->SavePersistentPrefs(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void ToggleAccessibility(WebUI* login_web_ui) { | 140 void ToggleAccessibility(WebUI* login_web_ui) { |
| 141 bool accessibility_enabled = g_browser_process && | 141 bool accessibility_enabled = g_browser_process && |
| 142 g_browser_process->local_state()->GetBoolean( | 142 g_browser_process->local_state()->GetBoolean( |
| 143 prefs::kAccessibilityEnabled); | 143 prefs::kAccessibilityEnabled); |
| 144 accessibility_enabled = !accessibility_enabled; | 144 accessibility_enabled = !accessibility_enabled; |
| 145 EnableAccessibility(accessibility_enabled, login_web_ui); | 145 EnableAccessibility(accessibility_enabled, login_web_ui); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 } // namespace accessibility | 148 } // namespace accessibility |
| 149 } // namespace chromeos | 149 } // namespace chromeos |
| OLD | NEW |