Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-10-21 Satish Sampath <satish@chromium.org>
Reviewed by Jeremy Orlow. Allow embedder to pass on all the speech recognition results to the input element. https://bugs.webkit.org/show_bug.cgi?id=48068 No new tests added as functionality has not changed, tests will be added in the next patch where these results are exposed as an attribute to scripts. * Android.mk: Added new source files. * GNUmakefile.am: * WebCore.gypi: * WebCore.pro: * WebCore.xcodeproj/project.pbxproj: * page/SpeechInput.cpp: (WebCore::SpeechInput::setRecognitionResult): Accept an array instead of a single string. * page/SpeechInput.h: * page/SpeechInputListener.h: * page/SpeechInputResult.cpp: Added, defines a class for managing a speech input result. (WebCore::SpeechInputResult::create): (WebCore::SpeechInputResult::SpeechInputResult): (WebCore::SpeechInputResult::confidence): (WebCore::SpeechInputResult::utterance): * page/SpeechInputResult.h: Added. * platform/mock/SpeechInputClientMock.cpp: (WebCore::SpeechInputClientMock::timerFired): * rendering/TextControlInnerElements.cpp: (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): * rendering/TextControlInnerElements.h: 2010-10-21 Satish Sampath <satish@chromium.org> Reviewed by Jeremy Orlow. Allow embedder to pass on all the speech recognition results to the input element. https://bugs.webkit.org/show_bug.cgi?id=48068 * WebKit.gyp: Added new files * public/WebSpeechInputListener.h: * public/WebSpeechInputResult.h: Added, wrapper around WebCore::SpeechInputResult (WebKit::WebSpeechInputResult::WebSpeechInputResult): (WebKit::WebSpeechInputResult::~WebSpeechInputResult): * src/SpeechInputClientImpl.cpp: (WebKit::SpeechInputClientImpl::setRecognitionResult): Accepts an array instead of a single string. * src/SpeechInputClientImpl.h: * src/WebSpeechInputControllerMockImpl.cpp: (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult): * src/WebSpeechInputControllerMockImpl.h: * src/WebSpeechInputResult.cpp: Added. (WebKit::WebSpeechInputResult::reset): (WebKit::WebSpeechInputResult::WebSpeechInputResult): (WebKit::WebSpeechInputResult::set): (WebKit::WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>): Canonical link: https://commits.webkit.org/61024@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Satish Sampath
committed
Oct 25, 2010
1 parent
c2135e1
commit ffd293b404738ea5719412b22ad9706b44642ed8
Showing
23 changed files
with
339 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) 2010 Google Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "config.h" | ||
#include "SpeechInputResult.h" | ||
|
||
#if ENABLE(INPUT_SPEECH) | ||
|
||
namespace WebCore { | ||
|
||
PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence) | ||
{ | ||
return adoptRef(new SpeechInputResult(utterance, confidence)); | ||
} | ||
|
||
SpeechInputResult::SpeechInputResult(const String& utterance, double confidence) | ||
: m_utterance(utterance) | ||
, m_confidence(confidence) | ||
{ | ||
} | ||
|
||
double SpeechInputResult::confidence() const | ||
{ | ||
return m_confidence; | ||
} | ||
|
||
const String& SpeechInputResult::utterance() const | ||
{ | ||
return m_utterance; | ||
} | ||
|
||
} // namespace WebCore | ||
|
||
#endif // ENABLE(INPUT_SPEECH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2010 Google Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef SpeechInputResult_h | ||
#define SpeechInputResult_h | ||
|
||
#if ENABLE(INPUT_SPEECH) | ||
|
||
#include "PlatformString.h" | ||
#include <wtf/PassRefPtr.h> | ||
#include <wtf/RefCounted.h> | ||
|
||
namespace WebCore { | ||
|
||
// This class holds one speech recognition result including the text and other related | ||
// fields, as received from the embedder. | ||
class SpeechInputResult : public RefCounted<SpeechInputResult> { | ||
public: | ||
static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence); | ||
|
||
double confidence() const; | ||
const String& utterance() const; | ||
|
||
private: | ||
SpeechInputResult(const String& utterance, double confidence); | ||
|
||
String m_utterance; | ||
double m_confidence; | ||
}; | ||
|
||
} // namespace WebCore | ||
|
||
#endif // ENABLE(INPUT_SPEECH) | ||
|
||
#endif // SpeechInputResult_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.