| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/extensions/component_loader.h" | 12 #include "chrome/browser/extensions/component_loader.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/extensions/extension_tts_api_platform.h" | 14 #include "chrome/browser/extensions/extension_tts_api_platform.h" |
| 15 #include "chrome/browser/extensions/file_reader.h" | 15 #include "chrome/browser/extensions/file_reader.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/common/extensions/extension_messages.h" | 18 #include "chrome/common/extensions/extension_messages.h" |
| 19 #include "chrome/common/extensions/extension_resource.h" | 19 #include "chrome/common/extensions/extension_resource.h" |
| 20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 21 #include "content/public/browser/browser_accessibility_state.h" | 21 #include "content/public/browser/browser_accessibility_state.h" |
| 22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/browser/web_ui.h" | 24 #include "content/public/browser/web_ui.h" |
| 25 #include "grit/browser_resources.h" | 25 #include "grit/browser_resources.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 | 29 |
| 30 using content::RenderViewHost; |
| 31 |
| 30 namespace chromeos { | 32 namespace chromeos { |
| 31 namespace accessibility { | 33 namespace accessibility { |
| 32 | 34 |
| 33 // Helper class that directly loads an extension's content scripts into | 35 // Helper class that directly loads an extension's content scripts into |
| 34 // all of the frames corresponding to a given RenderViewHost. | 36 // all of the frames corresponding to a given RenderViewHost. |
| 35 class ContentScriptLoader { | 37 class ContentScriptLoader { |
| 36 public: | 38 public: |
| 37 // Initialize the ContentScriptLoader with the ID of the extension | 39 // Initialize the ContentScriptLoader with the ID of the extension |
| 38 // and the RenderViewHost where the scripts should be loaded. | 40 // and the RenderViewHost where the scripts should be loaded. |
| 39 ContentScriptLoader(const std::string& extension_id, | 41 ContentScriptLoader(const std::string& extension_id, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return spoken_feedback_enabled; | 200 return spoken_feedback_enabled; |
| 199 } | 201 } |
| 200 | 202 |
| 201 void MaybeSpeak(const std::string& utterance) { | 203 void MaybeSpeak(const std::string& utterance) { |
| 202 if (IsSpokenFeedbackEnabled()) | 204 if (IsSpokenFeedbackEnabled()) |
| 203 Speak(utterance); | 205 Speak(utterance); |
| 204 } | 206 } |
| 205 | 207 |
| 206 } // namespace accessibility | 208 } // namespace accessibility |
| 207 } // namespace chromeos | 209 } // namespace chromeos |
| OLD | NEW |