summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/SpeechInputClientImpl.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-04 12:00:17 -0700
committerJohn Reck <jreck@google.com>2010-11-09 11:35:04 -0800
commite14391e94c850b8bd03680c23b38978db68687a8 (patch)
tree3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebKit/chromium/src/SpeechInputClientImpl.cpp
parent1bd705833a68f07850cf7e204b26f8d328d16951 (diff)
downloadexternal_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebKit/chromium/src/SpeechInputClientImpl.cpp')
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 963d440..b5ed384 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -32,15 +32,21 @@
#include "SpeechInputClientImpl.h"
#include "PlatformString.h"
+#include "SpeechInputListener.h"
#include "WebSpeechInputController.h"
#include "WebString.h"
#include "WebViewClient.h"
-#include "page/SpeechInputListener.h"
+#include <wtf/PassOwnPtr.h>
#if ENABLE(INPUT_SPEECH)
namespace WebKit {
+PassOwnPtr<SpeechInputClientImpl> SpeechInputClientImpl::create(WebViewClient* client)
+{
+ return adoptPtr(new SpeechInputClientImpl(client));
+}
+
SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
: m_controller(web_view_client ? web_view_client->speechInputController(this) : 0)
, m_listener(0)
@@ -56,10 +62,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
m_listener = listener;
}
-bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect)
+bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar)
{
ASSERT(m_listener);
- return m_controller->startRecognition(requestId, elementRect);
+ return m_controller->startRecognition(requestId, elementRect, language, grammar);
}
void SpeechInputClientImpl::stopRecording(int requestId)
@@ -86,10 +92,13 @@ void SpeechInputClientImpl::didCompleteRecognition(int requestId)
m_listener->didCompleteRecognition(requestId);
}
-void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result)
+void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebSpeechInputResultArray& results)
{
ASSERT(m_listener);
- m_listener->setRecognitionResult(requestId, result);
+ WebCore::SpeechInputResultArray webcoreResults(results.size());
+ for (size_t i = 0; i < results.size(); ++i)
+ webcoreResults[i] = results[i];
+ m_listener->setRecognitionResult(requestId, webcoreResults);
}
} // namespace WebKit