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

Side by Side Diff: chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc

Issue 27034009: Implement Google network speech synthesis (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Multiple voices with the same language Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/common/extensions/api/speech/tts_engine_manifest_handler.h" 5 #include "chrome/common/extensions/api/speech/tts_engine_manifest_handler.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 if (one_tts_voice->HasKey(keys::kTtsVoicesGender)) { 89 if (one_tts_voice->HasKey(keys::kTtsVoicesGender)) {
90 if (!one_tts_voice->GetString( 90 if (!one_tts_voice->GetString(
91 keys::kTtsVoicesGender, &voice_data.gender) || 91 keys::kTtsVoicesGender, &voice_data.gender) ||
92 (voice_data.gender != keys::kTtsGenderMale && 92 (voice_data.gender != keys::kTtsGenderMale &&
93 voice_data.gender != keys::kTtsGenderFemale)) { 93 voice_data.gender != keys::kTtsGenderFemale)) {
94 *error = ASCIIToUTF16(errors::kInvalidTtsVoicesGender); 94 *error = ASCIIToUTF16(errors::kInvalidTtsVoicesGender);
95 return false; 95 return false;
96 } 96 }
97 } 97 }
98 if (one_tts_voice->HasKey(keys::kTtsVoicesRemote)) {
99 if (!one_tts_voice->GetBoolean(
100 keys::kTtsVoicesRemote, &voice_data.remote)) {
101 *error = ASCIIToUTF16(errors::kInvalidTtsVoicesRemote);
102 return false;
103 }
104 }
98 if (one_tts_voice->HasKey(keys::kTtsVoicesEventTypes)) { 105 if (one_tts_voice->HasKey(keys::kTtsVoicesEventTypes)) {
99 const base::ListValue* event_types_list; 106 const base::ListValue* event_types_list;
100 if (!one_tts_voice->GetList( 107 if (!one_tts_voice->GetList(
101 keys::kTtsVoicesEventTypes, 108 keys::kTtsVoicesEventTypes,
102 &event_types_list)) { 109 &event_types_list)) {
103 *error = ASCIIToUTF16( 110 *error = ASCIIToUTF16(
104 errors::kInvalidTtsVoicesEventTypes); 111 errors::kInvalidTtsVoicesEventTypes);
105 return false; 112 return false;
106 } 113 }
107 for (size_t i = 0; i < event_types_list->GetSize(); i++) { 114 for (size_t i = 0; i < event_types_list->GetSize(); i++) {
(...skipping 25 matching lines...) Expand all
133 140
134 extension->SetManifestData(keys::kTtsVoices, info.release()); 141 extension->SetManifestData(keys::kTtsVoices, info.release());
135 return true; 142 return true;
136 } 143 }
137 144
138 const std::vector<std::string> TtsEngineManifestHandler::Keys() const { 145 const std::vector<std::string> TtsEngineManifestHandler::Keys() const {
139 return SingleKey(keys::kTtsEngine); 146 return SingleKey(keys::kTtsEngine);
140 } 147 }
141 148
142 } // namespace extensions 149 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698