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

Side by Side Diff: chrome/browser/speech/extension_api/tts_extension_api.cc

Issue 372103006: Stamp out CreateStringValue in chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/browser/speech/extension_api/tts_extension_api.h" 5 #include "chrome/browser/speech/extension_api/tts_extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 result_voice->SetString(constants::kGenderKey, constants::kGenderMale); 322 result_voice->SetString(constants::kGenderKey, constants::kGenderMale);
323 else if (voice.gender == TTS_GENDER_FEMALE) 323 else if (voice.gender == TTS_GENDER_FEMALE)
324 result_voice->SetString(constants::kGenderKey, constants::kGenderFemale); 324 result_voice->SetString(constants::kGenderKey, constants::kGenderFemale);
325 if (!voice.extension_id.empty()) 325 if (!voice.extension_id.empty())
326 result_voice->SetString(constants::kExtensionIdKey, voice.extension_id); 326 result_voice->SetString(constants::kExtensionIdKey, voice.extension_id);
327 327
328 base::ListValue* event_types = new base::ListValue(); 328 base::ListValue* event_types = new base::ListValue();
329 for (std::set<TtsEventType>::iterator iter = voice.events.begin(); 329 for (std::set<TtsEventType>::iterator iter = voice.events.begin();
330 iter != voice.events.end(); ++iter) { 330 iter != voice.events.end(); ++iter) {
331 const char* event_name_constant = TtsEventTypeToString(*iter); 331 const char* event_name_constant = TtsEventTypeToString(*iter);
332 event_types->Append(base::Value::CreateStringValue(event_name_constant)); 332 event_types->Append(new base::StringValue(event_name_constant));
333 } 333 }
334 result_voice->Set(constants::kEventTypesKey, event_types); 334 result_voice->Set(constants::kEventTypesKey, event_types);
335 335
336 result_voices->Append(result_voice); 336 result_voices->Append(result_voice);
337 } 337 }
338 338
339 SetResult(result_voices.release()); 339 SetResult(result_voices.release());
340 return true; 340 return true;
341 } 341 }
342 342
(...skipping 13 matching lines...) Expand all
356 } 356 }
357 357
358 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory = 358 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory =
359 LAZY_INSTANCE_INITIALIZER; 359 LAZY_INSTANCE_INITIALIZER;
360 360
361 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { 361 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() {
362 return g_factory.Pointer(); 362 return g_factory.Pointer();
363 } 363 }
364 364
365 } // namespace extensions 365 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698