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

Unified Diff: content/renderer/speech_recognition_dispatcher.cc

Issue 11232014: Move a bunch of code in content\renderer to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/speech_recognition_dispatcher.h ('k') | content/renderer/text_input_client_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/speech_recognition_dispatcher.cc
===================================================================
--- content/renderer/speech_recognition_dispatcher.cc (revision 163045)
+++ content/renderer/speech_recognition_dispatcher.cc (working copy)
@@ -15,8 +15,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpeechRecognitionResult.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpeechRecognizerClient.h"
-using content::SpeechRecognitionError;
-using content::SpeechRecognitionResult;
using WebKit::WebVector;
using WebKit::WebString;
using WebKit::WebSpeechGrammar;
@@ -25,9 +23,11 @@
using WebKit::WebSpeechRecognitionParams;
using WebKit::WebSpeechRecognizerClient;
+namespace content {
+
SpeechRecognitionDispatcher::SpeechRecognitionDispatcher(
RenderViewImpl* render_view)
- : content::RenderViewObserver(render_view),
+ : RenderViewObserver(render_view),
recognizer_client_(NULL),
next_id_(1) {
}
@@ -63,8 +63,7 @@
for (size_t i = 0; i < params.grammars().size(); ++i) {
const WebSpeechGrammar& grammar = params.grammars()[i];
msg_params.grammars.push_back(
- content::SpeechRecognitionGrammar(grammar.src().spec(),
- grammar.weight()));
+ SpeechRecognitionGrammar(grammar.src().spec(), grammar.weight()));
}
msg_params.language = UTF16ToUTF8(params.language());
msg_params.max_hypotheses = static_cast<uint32>(params.maxAlternatives());
@@ -118,25 +117,25 @@
}
static WebSpeechRecognizerClient::ErrorCode WebKitErrorCode(
- content::SpeechRecognitionErrorCode e) {
+ SpeechRecognitionErrorCode e) {
switch (e) {
- case content::SPEECH_RECOGNITION_ERROR_NONE:
+ case SPEECH_RECOGNITION_ERROR_NONE:
NOTREACHED();
return WebSpeechRecognizerClient::OtherError;
- case content::SPEECH_RECOGNITION_ERROR_ABORTED:
+ case SPEECH_RECOGNITION_ERROR_ABORTED:
return WebSpeechRecognizerClient::AbortedError;
- case content::SPEECH_RECOGNITION_ERROR_AUDIO:
+ case SPEECH_RECOGNITION_ERROR_AUDIO:
return WebSpeechRecognizerClient::AudioCaptureError;
- case content::SPEECH_RECOGNITION_ERROR_NETWORK:
+ case SPEECH_RECOGNITION_ERROR_NETWORK:
return WebSpeechRecognizerClient::NetworkError;
- case content::SPEECH_RECOGNITION_ERROR_NOT_ALLOWED:
+ case SPEECH_RECOGNITION_ERROR_NOT_ALLOWED:
return WebSpeechRecognizerClient::NotAllowedError;
- case content::SPEECH_RECOGNITION_ERROR_NO_SPEECH:
+ case SPEECH_RECOGNITION_ERROR_NO_SPEECH:
return WebSpeechRecognizerClient::NoSpeechError;
- case content::SPEECH_RECOGNITION_ERROR_NO_MATCH:
+ case SPEECH_RECOGNITION_ERROR_NO_MATCH:
NOTREACHED();
return WebSpeechRecognizerClient::OtherError;
- case content::SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR:
+ case SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR:
return WebSpeechRecognizerClient::BadGrammarError;
}
NOTREACHED();
@@ -145,7 +144,7 @@
void SpeechRecognitionDispatcher::OnErrorOccurred(
int request_id, const SpeechRecognitionError& error) {
- if (error.code == content::SPEECH_RECOGNITION_ERROR_NO_MATCH) {
+ if (error.code == SPEECH_RECOGNITION_ERROR_NO_MATCH) {
recognizer_client_->didReceiveNoMatch(GetHandleFromID(request_id),
WebSpeechRecognitionResult());
} else {
@@ -213,3 +212,5 @@
DCHECK(iter != handle_map_.end());
return iter->second;
}
+
+} // namespace content
« no previous file with comments | « content/renderer/speech_recognition_dispatcher.h ('k') | content/renderer/text_input_client_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698