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

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

Issue 9808024: Move TTS extension API to chrome/browser/speech/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos compile error, rebase Created 8 years, 9 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/extensions/extension_tts_engine_api.h" 5 #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/extensions/extension_event_router.h" 11 #include "chrome/browser/extensions/extension_event_router.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_tts_api_constants.h"
14 #include "chrome/browser/extensions/extension_tts_api_controller.h"
15 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h"
15 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h"
16 #include "chrome/common/extensions/extension.h" 16 #include "chrome/common/extensions/extension.h"
17 17
18 namespace constants = extension_tts_api_constants; 18 namespace constants = tts_extension_api_constants;
19 19
20 namespace events { 20 namespace events {
21 const char kOnSpeak[] = "ttsEngine.onSpeak"; 21 const char kOnSpeak[] = "ttsEngine.onSpeak";
22 const char kOnStop[] = "ttsEngine.onStop"; 22 const char kOnStop[] = "ttsEngine.onStop";
23 }; // namespace events 23 }; // namespace events
24 24
25 void GetExtensionVoices(Profile* profile, ListValue* result_voices) { 25 void GetExtensionVoices(Profile* profile, ListValue* result_voices) {
26 ExtensionService* service = profile->GetExtensionService(); 26 ExtensionService* service = profile->GetExtensionService();
27 DCHECK(service); 27 DCHECK(service);
28 ExtensionEventRouter* event_router = profile->GetExtensionEventRouter(); 28 ExtensionEventRouter* event_router = profile->GetExtensionEventRouter();
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 std::string error_message; 257 std::string error_message;
258 event->GetString(constants::kErrorMessageKey, &error_message); 258 event->GetString(constants::kErrorMessageKey, &error_message);
259 controller->OnTtsEvent( 259 controller->OnTtsEvent(
260 utterance_id, TTS_EVENT_ERROR, char_index, error_message); 260 utterance_id, TTS_EVENT_ERROR, char_index, error_message);
261 } else { 261 } else {
262 EXTENSION_FUNCTION_VALIDATE(false); 262 EXTENSION_FUNCTION_VALIDATE(false);
263 } 263 }
264 264
265 return true; 265 return true;
266 } 266 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698