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

Side by Side Diff: content/browser/speech/speech_recognition_manager_impl.cc

Issue 10091006: TabContents -> WebContentsImpl, part 15. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 "content/browser/speech/speech_recognition_manager_impl.h" 5 #include "content/browser/speech/speech_recognition_manager_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/browser_main_loop.h" 8 #include "content/browser/browser_main_loop.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" 10 #include "content/browser/speech/input_tag_speech_dispatcher_host.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 void SpeechRecognitionManagerImpl::CheckRenderViewTypeAndStartRecognition( 146 void SpeechRecognitionManagerImpl::CheckRenderViewTypeAndStartRecognition(
147 const SpeechRecognitionParams& params) { 147 const SpeechRecognitionParams& params) {
148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
149 149
150 RenderViewHostImpl* render_view_host = RenderViewHostImpl::FromID( 150 RenderViewHostImpl* render_view_host = RenderViewHostImpl::FromID(
151 params.render_process_id, params.render_view_id); 151 params.render_process_id, params.render_view_id);
152 if (!render_view_host || !render_view_host->GetDelegate()) 152 if (!render_view_host || !render_view_host->GetDelegate())
153 return; 153 return;
154 154
155 // For host delegates other than VIEW_TYPE_TAB_CONTENTS we can't reliably show 155 // For host delegates other than VIEW_TYPE_WEB_CONTENTS we can't reliably show
156 // a popup, including the speech input bubble. In these cases for privacy 156 // a popup, including the speech input bubble. In these cases for privacy
157 // reasons we don't want to start recording if the user can't be properly 157 // reasons we don't want to start recording if the user can't be properly
158 // notified. An example of this is trying to show the speech input bubble 158 // notified. An example of this is trying to show the speech input bubble
159 // within an extension popup: http://crbug.com/92083. In these situations the 159 // within an extension popup: http://crbug.com/92083. In these situations the
160 // speech input extension API should be used instead. 160 // speech input extension API should be used instead.
161 if (render_view_host->GetDelegate()->GetRenderViewType() == 161 if (render_view_host->GetDelegate()->GetRenderViewType() ==
162 content::VIEW_TYPE_TAB_CONTENTS) { 162 content::VIEW_TYPE_WEB_CONTENTS) {
163 BrowserThread::PostTask( 163 BrowserThread::PostTask(
164 BrowserThread::IO, FROM_HERE, 164 BrowserThread::IO, FROM_HERE,
165 base::Bind(&SpeechRecognitionManagerImpl::ProceedStartingRecognition, 165 base::Bind(&SpeechRecognitionManagerImpl::ProceedStartingRecognition,
166 base::Unretained(this), params)); 166 base::Unretained(this), params));
167 } 167 }
168 } 168 }
169 169
170 void SpeechRecognitionManagerImpl::ProceedStartingRecognition( 170 void SpeechRecognitionManagerImpl::ProceedStartingRecognition(
171 const SpeechRecognitionParams& params) { 171 const SpeechRecognitionParams& params) {
172 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 172 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 357
358 SpeechRecognitionManagerImpl::Request::Request() 358 SpeechRecognitionManagerImpl::Request::Request()
359 : is_active(false) { 359 : is_active(false) {
360 } 360 }
361 361
362 SpeechRecognitionManagerImpl::Request::~Request() { 362 SpeechRecognitionManagerImpl::Request::~Request() {
363 } 363 }
364 364
365 } // namespace speech 365 } // namespace speech
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/web_contents/navigation_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698