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

Unified Diff: chrome/renderer/speech_input_dispatcher.cc

Issue 6151011: Introduce RenderView::Observer interface so that RenderView doesn't have to k... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
Index: chrome/renderer/speech_input_dispatcher.cc
===================================================================
--- chrome/renderer/speech_input_dispatcher.cc (revision 71253)
+++ chrome/renderer/speech_input_dispatcher.cc (working copy)
@@ -5,7 +5,6 @@
#include "chrome/renderer/speech_input_dispatcher.h"
#include "base/utf_string_conversions.h"
-#include "chrome/renderer/render_view.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputListener.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
@@ -15,8 +14,9 @@
using WebKit::WebFrame;
SpeechInputDispatcher::SpeechInputDispatcher(
- RenderView* render_view, WebKit::WebSpeechInputListener* listener)
- : render_view_(render_view),
+ RenderView* render_view,
+ WebKit::WebSpeechInputListener* listener)
+ : RenderView::Observer(render_view),
listener_(listener) {
}
@@ -40,11 +40,11 @@
const WebKit::WebString& language,
const WebKit::WebString& grammar) {
VLOG(1) << "SpeechInputDispatcher::startRecognition enter";
- gfx::Size scroll = render_view_->webview()->mainFrame()->scrollOffset();
+ gfx::Size scroll = render_view()->webview()->mainFrame()->scrollOffset();
gfx::Rect rect = element_rect;
rect.Offset(-scroll.width(), -scroll.height());
- render_view_->Send(new ViewHostMsg_SpeechInput_StartRecognition(
- render_view_->routing_id(), request_id, rect,
+ Send(new ViewHostMsg_SpeechInput_StartRecognition(
+ routing_id(), request_id, rect,
UTF16ToUTF8(language), UTF16ToUTF8(grammar)));
VLOG(1) << "SpeechInputDispatcher::startRecognition exit";
return true;
@@ -52,15 +52,13 @@
void SpeechInputDispatcher::cancelRecognition(int request_id) {
VLOG(1) << "SpeechInputDispatcher::cancelRecognition enter";
- render_view_->Send(new ViewHostMsg_SpeechInput_CancelRecognition(
- render_view_->routing_id(), request_id));
+ Send(new ViewHostMsg_SpeechInput_CancelRecognition(routing_id(), request_id));
VLOG(1) << "SpeechInputDispatcher::cancelRecognition exit";
}
void SpeechInputDispatcher::stopRecording(int request_id) {
VLOG(1) << "SpeechInputDispatcher::stopRecording enter";
- render_view_->Send(new ViewHostMsg_SpeechInput_StopRecording(
- render_view_->routing_id(), request_id));
+ Send(new ViewHostMsg_SpeechInput_StopRecording(routing_id(), request_id));
VLOG(1) << "SpeechInputDispatcher::stopRecording exit";
}

Powered by Google App Engine
This is Rietveld 408576698