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

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

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 result_voice->SetString(constants::kGenderKey, constants::kGenderMale); 330 result_voice->SetString(constants::kGenderKey, constants::kGenderMale);
331 else if (voice.gender == TTS_GENDER_FEMALE) 331 else if (voice.gender == TTS_GENDER_FEMALE)
332 result_voice->SetString(constants::kGenderKey, constants::kGenderFemale); 332 result_voice->SetString(constants::kGenderKey, constants::kGenderFemale);
333 if (!voice.extension_id.empty()) 333 if (!voice.extension_id.empty())
334 result_voice->SetString(constants::kExtensionIdKey, voice.extension_id); 334 result_voice->SetString(constants::kExtensionIdKey, voice.extension_id);
335 335
336 base::ListValue* event_types = new base::ListValue(); 336 base::ListValue* event_types = new base::ListValue();
337 for (std::set<TtsEventType>::iterator iter = voice.events.begin(); 337 for (std::set<TtsEventType>::iterator iter = voice.events.begin();
338 iter != voice.events.end(); ++iter) { 338 iter != voice.events.end(); ++iter) {
339 const char* event_name_constant = TtsEventTypeToString(*iter); 339 const char* event_name_constant = TtsEventTypeToString(*iter);
340 event_types->Append(new base::StringValue(event_name_constant)); 340 event_types->AppendString(event_name_constant);
341 } 341 }
342 result_voice->Set(constants::kEventTypesKey, event_types); 342 result_voice->Set(constants::kEventTypesKey, event_types);
343 343
344 result_voices->Append(result_voice); 344 result_voices->Append(result_voice);
345 } 345 }
346 346
347 SetResult(std::move(result_voices)); 347 SetResult(std::move(result_voices));
348 return true; 348 return true;
349 } 349 }
350 350
(...skipping 16 matching lines...) Expand all
367 } 367 }
368 368
369 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory = 369 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory =
370 LAZY_INSTANCE_INITIALIZER; 370 LAZY_INSTANCE_INITIALIZER;
371 371
372 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { 372 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() {
373 return g_factory.Pointer(); 373 return g_factory.Pointer();
374 } 374 }
375 375
376 } // namespace extensions 376 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698