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

Side by Side Diff: content/renderer/speech_recognition_dispatcher.cc

Issue 10407120: Moving tray icon and notification balloon for background speech recognition sessions to ChromeSpeec… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed win issued ("interface" member clashes with a VS macro name, sigh) Created 8 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 | Annotate | Revision Log
« no previous file with comments | « content/public/browser/speech_recognition_session_context.cc ('k') | no next file » | 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 "content/renderer/speech_recognition_dispatcher.h" 5 #include "content/renderer/speech_recognition_dispatcher.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/common/speech_recognition_messages.h" 9 #include "content/common/speech_recognition_messages.h"
10 #include "content/renderer/render_view_impl.h" 10 #include "content/renderer/render_view_impl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 SpeechRecognitionHostMsg_StartRequest_Params msg_params; 63 SpeechRecognitionHostMsg_StartRequest_Params msg_params;
64 for (size_t i = 0; i < params.grammars().size(); ++i) { 64 for (size_t i = 0; i < params.grammars().size(); ++i) {
65 const WebSpeechGrammar& grammar = params.grammars()[i]; 65 const WebSpeechGrammar& grammar = params.grammars()[i];
66 msg_params.grammars.push_back( 66 msg_params.grammars.push_back(
67 content::SpeechRecognitionGrammar(grammar.src().spec(), 67 content::SpeechRecognitionGrammar(grammar.src().spec(),
68 grammar.weight())); 68 grammar.weight()));
69 } 69 }
70 msg_params.language = UTF16ToUTF8(params.language()); 70 msg_params.language = UTF16ToUTF8(params.language());
71 msg_params.is_one_shot = !params.continuous(); 71 msg_params.is_one_shot = !params.continuous();
72 msg_params.origin_url = ""; // TODO(primiano) we need an origin from WebKit. 72 msg_params.origin_url = params.origin().toString().utf8();
73 msg_params.render_view_id = routing_id(); 73 msg_params.render_view_id = routing_id();
74 msg_params.request_id = GetIDForHandle(handle); 74 msg_params.request_id = GetIDForHandle(handle);
75 Send(new SpeechRecognitionHostMsg_StartRequest(msg_params)); 75 Send(new SpeechRecognitionHostMsg_StartRequest(msg_params));
76 } 76 }
77 77
78 void SpeechRecognitionDispatcher::stop( 78 void SpeechRecognitionDispatcher::stop(
79 const WebSpeechRecognitionHandle& handle, 79 const WebSpeechRecognitionHandle& handle,
80 WebSpeechRecognizerClient* recognizer_client) { 80 WebSpeechRecognizerClient* recognizer_client) {
81 DCHECK(recognizer_client_ == recognizer_client); 81 DCHECK(recognizer_client_ == recognizer_client);
82 Send(new SpeechRecognitionHostMsg_StopCaptureRequest(routing_id(), 82 Send(new SpeechRecognitionHostMsg_StopCaptureRequest(routing_id(),
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 ++next_id_; 184 ++next_id_;
185 return new_id; 185 return new_id;
186 } 186 }
187 187
188 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( 188 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID(
189 int request_id) { 189 int request_id) {
190 HandleMap::iterator iter = handle_map_.find(request_id); 190 HandleMap::iterator iter = handle_map_.find(request_id);
191 DCHECK(iter != handle_map_.end()); 191 DCHECK(iter != handle_map_.end());
192 return iter->second; 192 return iter->second;
193 } 193 }
OLDNEW
« no previous file with comments | « content/public/browser/speech_recognition_session_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698