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

Unified Diff: chrome/browser/extensions/extension_tts_api_controller.cc

Issue 7686018: Fix a bug in the TTS extension API where the getVoices function wouldn't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tts_api_controller.cc
===================================================================
--- chrome/browser/extensions/extension_tts_api_controller.cc (revision 97580)
+++ chrome/browser/extensions/extension_tts_api_controller.cc (working copy)
@@ -229,34 +229,35 @@
ListValue* ExtensionTtsController::GetVoices(Profile* profile) {
ListValue* result_voices = new ListValue();
- if (platform_impl_ && platform_impl_->PlatformImplAvailable()) {
+ ExtensionTtsPlatformImpl* platform_impl = GetPlatformImpl();
+ if (platform_impl && platform_impl->PlatformImplAvailable()) {
DictionaryValue* result_voice = new DictionaryValue();
result_voice->SetString(
constants::kVoiceNameKey, constants::kNativeVoiceName);
- if (!platform_impl_->gender().empty())
- result_voice->SetString(constants::kGenderKey, platform_impl_->gender());
+ if (!platform_impl->gender().empty())
+ result_voice->SetString(constants::kGenderKey, platform_impl->gender());
ListValue* event_types = new ListValue();
// All platforms must send end events, and cancelled and interrupted
// events are generated from the controller.
- DCHECK(platform_impl_->SendsEvent(TTS_EVENT_END));
+ DCHECK(platform_impl->SendsEvent(TTS_EVENT_END));
event_types->Append(Value::CreateStringValue(constants::kEventTypeEnd));
event_types->Append(Value::CreateStringValue(
constants::kEventTypeCancelled));
event_types->Append(Value::CreateStringValue(
constants::kEventTypeInterrupted));
- if (platform_impl_->SendsEvent(TTS_EVENT_START))
+ if (platform_impl->SendsEvent(TTS_EVENT_START))
event_types->Append(Value::CreateStringValue(constants::kEventTypeStart));
- if (platform_impl_->SendsEvent(TTS_EVENT_WORD))
+ if (platform_impl->SendsEvent(TTS_EVENT_WORD))
event_types->Append(Value::CreateStringValue(constants::kEventTypeWord));
- if (platform_impl_->SendsEvent(TTS_EVENT_SENTENCE))
+ if (platform_impl->SendsEvent(TTS_EVENT_SENTENCE))
event_types->Append(Value::CreateStringValue(
constants::kEventTypeSentence));
- if (platform_impl_->SendsEvent(TTS_EVENT_MARKER))
+ if (platform_impl->SendsEvent(TTS_EVENT_MARKER))
event_types->Append(Value::CreateStringValue(
constants::kEventTypeMarker));
- if (platform_impl_->SendsEvent(TTS_EVENT_ERROR))
+ if (platform_impl->SendsEvent(TTS_EVENT_ERROR))
event_types->Append(Value::CreateStringValue(
constants::kEventTypeError));
result_voice->Set(constants::kEventTypesKey, event_types);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698