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

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

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin Created 7 years, 10 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
« no previous file with comments | « chrome/browser/intents/web_intents_registry_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/values.h" 10 #include "base/values.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return true; 180 return true;
181 } 181 }
182 182
183 // static 183 // static
184 TtsAPI* TtsAPI::Get(Profile* profile) { 184 TtsAPI* TtsAPI::Get(Profile* profile) {
185 return ProfileKeyedAPIFactory<TtsAPI>::GetForProfile(profile); 185 return ProfileKeyedAPIFactory<TtsAPI>::GetForProfile(profile);
186 } 186 }
187 187
188 TtsAPI::TtsAPI(Profile* profile) { 188 TtsAPI::TtsAPI(Profile* profile) {
189 ManifestHandler::Register(extension_manifest_keys::kTtsEngine, 189 ManifestHandler::Register(extension_manifest_keys::kTtsEngine,
190 new TtsEngineManifestHandler); 190 make_linked_ptr(new TtsEngineManifestHandler));
191 ExtensionFunctionRegistry* registry = 191 ExtensionFunctionRegistry* registry =
192 ExtensionFunctionRegistry::GetInstance(); 192 ExtensionFunctionRegistry::GetInstance();
193 registry->RegisterFunction<ExtensionTtsEngineSendTtsEventFunction>(); 193 registry->RegisterFunction<ExtensionTtsEngineSendTtsEventFunction>();
194 registry->RegisterFunction<TtsGetVoicesFunction>(); 194 registry->RegisterFunction<TtsGetVoicesFunction>();
195 registry->RegisterFunction<TtsIsSpeakingFunction>(); 195 registry->RegisterFunction<TtsIsSpeakingFunction>();
196 registry->RegisterFunction<TtsSpeakFunction>(); 196 registry->RegisterFunction<TtsSpeakFunction>();
197 registry->RegisterFunction<TtsStopSpeakingFunction>(); 197 registry->RegisterFunction<TtsStopSpeakingFunction>();
198 } 198 }
199 199
200 TtsAPI::~TtsAPI() { 200 TtsAPI::~TtsAPI() {
201 } 201 }
202 202
203 static base::LazyInstance<ProfileKeyedAPIFactory<TtsAPI> > 203 static base::LazyInstance<ProfileKeyedAPIFactory<TtsAPI> >
204 g_factory = LAZY_INSTANCE_INITIALIZER; 204 g_factory = LAZY_INSTANCE_INITIALIZER;
205 205
206 ProfileKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { 206 ProfileKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() {
207 return &g_factory.Get(); 207 return &g_factory.Get();
208 } 208 }
209 209
210 } // namespace extensions 210 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/intents/web_intents_registry_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698