| Differences between
and this patch
- a/WebCore/ChangeLog +15 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-07-15  Satish Sampath  <satish@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder.
6
        https://bugs.webkit.org/show_bug.cgi?id=42367
7
8
        No new tests, the relevant LayoutTestController bindings will be added in the next patch.
9
10
        * page/SpeechInput.cpp: renamed a method.
11
        * page/SpeechInput.h: renamed a method.
12
        * page/SpeechInputClient.h: added an extra method to optionally let users stop recording once they have spoken.
13
        * page/SpeechInputClientListener.h: renamed a method.
14
        * page/SpeechInputListener.h: renamed a method.
15
1
2010-07-23  Adam Barth  <abarth@webkit.org>
16
2010-07-23  Adam Barth  <abarth@webkit.org>
2
17
3
        Reviewed by Eric Seidel.
18
        Reviewed by Eric Seidel.
- a/WebCore/page/SpeechInput.cpp -2 / +2 lines
Lines 45-53 SpeechInput::SpeechInput(SpeechInputClient* client, SpeechInputListener* listene a/WebCore/page/SpeechInput.cpp_sec1
45
{
45
{
46
}
46
}
47
47
48
void SpeechInput::recordingComplete()
48
void SpeechInput::didCompleteRecording()
49
{
49
{
50
    m_listener->recordingComplete();
50
    m_listener->didCompleteRecording();
51
}
51
}
52
52
53
void SpeechInput::setRecognitionResult(const String& result)
53
void SpeechInput::setRecognitionResult(const String& result)
- a/WebCore/page/SpeechInput.h -1 / +1 lines
Lines 54-60 public: a/WebCore/page/SpeechInput.h_sec1
54
    virtual bool startRecognition();
54
    virtual bool startRecognition();
55
55
56
    // SpeechInputClient::Listener methods.
56
    // SpeechInputClient::Listener methods.
57
    virtual void recordingComplete();
57
    virtual void didCompleteRecording();
58
    virtual void setRecognitionResult(const String&);
58
    virtual void setRecognitionResult(const String&);
59
59
60
protected:
60
protected:
- a/WebCore/page/SpeechInputClient.h +4 lines
Lines 42-47 class SpeechInputClient { a/WebCore/page/SpeechInputClient.h_sec1
42
public:
42
public:
43
    virtual bool startRecognition(SpeechInputClientListener* listener) = 0;
43
    virtual bool startRecognition(SpeechInputClientListener* listener) = 0;
44
44
45
    // Stops audio recording and performs recognition with the audio recorded until now
46
    // (does not discard audio).
47
    virtual void stopRecording() = 0;
48
45
protected:
49
protected:
46
    virtual ~SpeechInputClient() { }
50
    virtual ~SpeechInputClient() { }
47
};
51
};
- a/WebCore/page/SpeechInputClientListener.h -1 / +7 lines
Lines 40-46 class String; a/WebCore/page/SpeechInputClientListener.h_sec1
40
// Provides an interface for the embedder to call into WebCore.
40
// Provides an interface for the embedder to call into WebCore.
41
class SpeechInputClientListener {
41
class SpeechInputClientListener {
42
public:
42
public:
43
    virtual void recordingComplete() = 0;
43
    // Informs that audio recording has completed and recognition is underway.
44
    virtual void didCompleteRecording() = 0;
45
46
    // Gives results from speech recognition, either partial or the final results.
47
    // This method can potentially get called multiple times if there are partial results
48
    // available as the user keeps speaking. If the speech could not be recognized properly
49
    // or if there was any other errors in the process, this method may never be called.
44
    virtual void setRecognitionResult(const String& result) = 0;
50
    virtual void setRecognitionResult(const String& result) = 0;
45
51
46
protected:
52
protected:
- a/WebCore/page/SpeechInputListener.h -1 / +7 lines
Lines 40-46 class String; a/WebCore/page/SpeechInputListener.h_sec1
40
// Interface to be implemented by the element which invokes SpeechInput.
40
// Interface to be implemented by the element which invokes SpeechInput.
41
class SpeechInputListener {
41
class SpeechInputListener {
42
public:
42
public:
43
    virtual void recordingComplete() = 0;
43
    // Informs that audio recording has completed and recognition is underway.
44
    virtual void didCompleteRecording() = 0;
45
46
    // Gives results from speech recognition, either partial or the final results.
47
    // This method can potentially get called multiple times if there are partial results
48
    // available as the user keeps speaking. If the speech could not be recognized properly
49
    // or if there was any other errors in the process, this method may never be called.
44
    virtual void setRecognitionResult(const String& result) = 0;
50
    virtual void setRecognitionResult(const String& result) = 0;
45
51
46
protected:
52
protected:
- a/WebCore/rendering/TextControlInnerElements.cpp -1 / +1 lines
Lines 397-403 SpeechInput* InputFieldSpeechButtonElement::speechInput() a/WebCore/rendering/TextControlInnerElements.cpp_sec1
397
    return m_speechInput.get();
397
    return m_speechInput.get();
398
}
398
}
399
399
400
void InputFieldSpeechButtonElement::recordingComplete()
400
void InputFieldSpeechButtonElement::didCompleteRecording()
401
{
401
{
402
    // FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
402
    // FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
403
    // in progress.
403
    // in progress.
- a/WebCore/rendering/TextControlInnerElements.h -1 / +1 lines
Lines 124-130 public: a/WebCore/rendering/TextControlInnerElements.h_sec1
124
    virtual void defaultEventHandler(Event*);
124
    virtual void defaultEventHandler(Event*);
125
125
126
    // SpeechInputListener methods.
126
    // SpeechInputListener methods.
127
    void recordingComplete();
127
    void didCompleteRecording();
128
    void setRecognitionResult(const String& result);
128
    void setRecognitionResult(const String& result);
129
129
130
private:
130
private:
- a/WebKit/chromium/ChangeLog +29 lines
Lines 1-3 a/WebKit/chromium/ChangeLog_sec1
1
2010-07-15  Satish Sampath  <satish@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder.
6
        https://bugs.webkit.org/show_bug.cgi?id=42367
7
8
        No new tests, the relevant LayoutTestController bindings and tests will be added in the next patch.
9
10
        * public/WebSpeechInputController.h: Added new interface, implemented by embedder and called by WebKit
11
        (WebKit::WebSpeechInputController::~WebSpeechInputController):
12
        * public/WebSpeechInputListener.h: Added new interface, implemented by WebKit and called by embedder.
13
        (WebKit::WebSpeechInputListener::~WebSpeechInputListener):
14
        * public/WebViewClient.h:
15
        (WebKit::WebViewClient::createSpeechInputClient): New method to get the embedder's speech input client interface.
16
        * src/SpeechInputClientImpl.cpp: Added new class, implementation of a two way connector between WebCore
17
        and the embedder for requests and responses.
18
        (WebKit::SpeechInputClientImpl::SpeechInputClientImpl):
19
        (WebKit::SpeechInputClientImpl::~SpeechInputClientImpl):
20
        (WebKit::SpeechInputClientImpl::startRecognition):
21
        (WebKit::SpeechInputClientImpl::stopRecording):
22
        (WebKit::SpeechInputClientImpl::didCompleteRecording):
23
        (WebKit::SpeechInputClientImpl::setRecognitionResult):
24
        (WebKit::SpeechInputClientImpl::didCompleteRecognition):
25
        * src/SpeechInputClientImpl.h: Added.
26
        * src/WebViewImpl.cpp:
27
        (WebKit::WebViewImpl::WebViewImpl): Pass on the above mentioned speech input connector to WebCore.
28
        * src/WebViewImpl.h:
29
1
2010-07-23  Pavel Feldman  <pfeldman@chromium.org>
30
2010-07-23  Pavel Feldman  <pfeldman@chromium.org>
2
31
3
        Reviewed by Reviewed by Yury Semikhatsky.
32
        Reviewed by Reviewed by Yury Semikhatsky.
- a/WebKit/chromium/WebKit.gyp +4 lines
Lines 234-239 a/WebKit/chromium/WebKit.gyp_sec1
234
                'public/WebSocketStreamError.h',
234
                'public/WebSocketStreamError.h',
235
                'public/WebSocketStreamHandle.h',
235
                'public/WebSocketStreamHandle.h',
236
                'public/WebSocketStreamHandleClient.h',
236
                'public/WebSocketStreamHandleClient.h',
237
                'public/WebSpeechInputController.h',
238
                'public/WebSpeechInputListener.h',
237
                'public/WebStorageArea.h',
239
                'public/WebStorageArea.h',
238
                'public/WebStorageEventDispatcher.h',
240
                'public/WebStorageEventDispatcher.h',
239
                'public/WebStorageNamespace.h',
241
                'public/WebStorageNamespace.h',
Lines 339-344 a/WebKit/chromium/WebKit.gyp_sec2
339
                'src/ResourceHandle.cpp',
341
                'src/ResourceHandle.cpp',
340
                'src/SharedWorkerRepository.cpp',
342
                'src/SharedWorkerRepository.cpp',
341
                'src/SocketStreamHandle.cpp',
343
                'src/SocketStreamHandle.cpp',
344
                'src/SpeechInputClientImpl.cpp',
345
                'src/SpeechInputClientImpl.h',
342
                'src/StorageAreaProxy.cpp',
346
                'src/StorageAreaProxy.cpp',
343
                'src/StorageAreaProxy.h',
347
                'src/StorageAreaProxy.h',
344
                'src/StorageEventDispatcherChromium.cpp',
348
                'src/StorageEventDispatcherChromium.cpp',
- a/WebKit/chromium/public/WebSpeechInputController.h +67 lines
Line 0 a/WebKit/chromium/public/WebSpeechInputController.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebSpeechInputController_h
32
#define WebSpeechInputController_h
33
34
#include "WebCommon.h"
35
36
namespace WebKit {
37
38
// Provides an embedder API called by WebKit.
39
class WebSpeechInputController {
40
public:
41
    // Starts speech recognition. Speech will get recorded until the endpointer detects silence,
42
    // runs to the limit or stopRecording is called. Progress indications and the recognized
43
    // text are returned via the listener interface.
44
    virtual bool startRecognition()
45
    {
46
         WEBKIT_ASSERT_NOT_REACHED();
47
         return false;
48
    }
49
50
    // Cancels an ongoing recognition and discards any audio recorded so far. No partial
51
    // recognition results are returned to the listener.
52
    virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); }
53
54
    // Stops audio recording and performs recognition with the audio recorded until now
55
    // (does not discard audio). This is an optional call and is typically invoked if the user
56
    // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech
57
    // recording 'endpointer' should detect silence in the input and stop recording automatically.
58
    // Call startRecognition() to record audio and recognize speech again.
59
    virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); }
60
61
protected:
62
    virtual ~WebSpeechInputController() { }
63
};
64
65
} // namespace WebKit
66
67
#endif // WebSpeechInputController_h
- a/WebKit/chromium/public/WebSpeechInputListener.h +70 lines
Line 0 a/WebKit/chromium/public/WebSpeechInputListener.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebSpeechInputListener_h
32
#define WebSpeechInputListener_h
33
34
namespace WebKit {
35
36
class WebString;
37
38
// Provides a WebKit API called by the embedder.
39
// A typical sequence of calls to the listener would be
40
//   1 call to didCompleteRecording
41
//   0 or more calls to setRecognitionResult
42
//   1 call to didCompleteRecognition
43
class WebSpeechInputListener {
44
public:
45
    // Informs that audio recording has completed and recognition is underway. This gets invoked
46
    // irrespective of whether recording was stopped automatically by the 'endpointer' or if
47
    // WebSpeechInputController::stopRecording() was called.
48
    // Typically after this call the listener would update the UI to reflect that recognition is
49
    // in progress.
50
    virtual void didCompleteRecording() = 0;
51
52
    // Gives results from speech recognition, either partial or the final results.
53
    // This method can potentially get called multiple times if there are partial results
54
    // available as the user keeps speaking. If the speech could not be recognized properly
55
    // or if there was any other errors in the process, this method may never be called.
56
    virtual void setRecognitionResult(const WebString&) = 0;
57
58
    // Informs that speech recognition has completed. This gets invoked irrespective of whether
59
    // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The
60
    // handler typically frees up any temporary resources allocated and waits for the next speech
61
    // recognition request.
62
    virtual void didCompleteRecognition() = 0;
63
64
protected:
65
    ~WebSpeechInputListener() { }
66
};
67
68
} // namespace WebKit
69
70
#endif // WebSpeechInputListener_h
- a/WebKit/chromium/public/WebViewClient.h -1 / +9 lines
Lines 55-60 class WebKeyboardEvent; a/WebKit/chromium/public/WebViewClient.h_sec1
55
class WebNode;
55
class WebNode;
56
class WebNotificationPresenter;
56
class WebNotificationPresenter;
57
class WebRange;
57
class WebRange;
58
class WebSpeechInputController;
59
class WebSpeechInputListener;
58
class WebStorageNamespace;
60
class WebStorageNamespace;
59
class WebURL;
61
class WebURL;
60
class WebView;
62
class WebView;
Lines 331-337 public: a/WebKit/chromium/public/WebViewClient.h_sec2
331
    // Geolocation ---------------------------------------------------------
333
    // Geolocation ---------------------------------------------------------
332
334
333
    // Access the embedder API for geolocation services.
335
    // Access the embedder API for geolocation services.
334
    virtual WebKit::WebGeolocationService* geolocationService() { return 0; }
336
    virtual WebGeolocationService* geolocationService() { return 0; }
337
338
    // Speech --------------------------------------------------------------
339
340
    // Access the embedder API for speech input services.
341
    virtual WebSpeechInputController* speechInputController(
342
        WebSpeechInputListener*) { return 0; }
335
343
336
protected:
344
protected:
337
    ~WebViewClient() { }
345
    ~WebViewClient() { }
- a/WebKit/chromium/src/SpeechInputClientImpl.cpp +93 lines
Line 0 a/WebKit/chromium/src/SpeechInputClientImpl.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
#include "SpeechInputClientImpl.h"
33
34
#include "PlatformString.h"
35
#include "WebSpeechInputController.h"
36
#include "WebString.h"
37
#include "WebViewClient.h"
38
#include "page/SpeechInputClientListener.h"
39
40
#if ENABLE(INPUT_SPEECH)
41
42
namespace WebKit {
43
44
SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
45
    : m_controller(web_view_client->speechInputController(this))
46
    , m_listener(0)
47
{
48
    ASSERT(m_controller);
49
}
50
51
SpeechInputClientImpl::~SpeechInputClientImpl()
52
{
53
}
54
55
bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputClientListener* listener)
56
{
57
    // Cancel any ongoing recognition first. No callbacks will be issued to that listener.
58
    if (m_listener)
59
        m_controller->cancelRecognition();
60
61
    m_listener = listener;
62
    return m_controller->startRecognition();
63
}
64
65
void SpeechInputClientImpl::stopRecording()
66
{
67
    ASSERT(m_listener);
68
    m_controller->stopRecording();
69
}
70
71
void SpeechInputClientImpl::didCompleteRecording()
72
{
73
    ASSERT(m_listener);
74
    if (m_listener)
75
        m_listener->didCompleteRecording();
76
}
77
78
void SpeechInputClientImpl::didCompleteRecognition()
79
{
80
    ASSERT(m_listener);
81
    m_listener = 0;
82
}
83
84
void SpeechInputClientImpl::setRecognitionResult(const WebString& result)
85
{
86
    ASSERT(m_listener);
87
    if (m_listener)
88
        m_listener->setRecognitionResult(result);
89
}
90
91
} // namespace WebKit
92
93
#endif // ENABLE(INPUT_SPEECH)
- a/WebKit/chromium/src/SpeechInputClientImpl.h +73 lines
Line 0 a/WebKit/chromium/src/SpeechInputClientImpl.h_sec1
1
/*
2
 * Copyright (C) 2010 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef SpeechInputClientImpl_h
32
#define SpeechInputClientImpl_h
33
34
#if ENABLE(INPUT_SPEECH)
35
36
#include "WebSpeechInputListener.h"
37
#include "page/SpeechInputClient.h"
38
39
namespace WebCore {
40
class SpeechInputClientListener;
41
}
42
43
namespace WebKit {
44
45
class WebSpeechInputController;
46
class WebViewClient;
47
48
class SpeechInputClientImpl
49
    : public WebCore::SpeechInputClient,
50
      public WebSpeechInputListener {
51
public:
52
    SpeechInputClientImpl(WebViewClient*);
53
    virtual ~SpeechInputClientImpl();
54
55
    // SpeechInputClient methods.
56
    bool startRecognition(WebCore::SpeechInputClientListener*);
57
    void stopRecording();
58
59
    // WebSpeechInputListener methods.
60
    void didCompleteRecording();
61
    void setRecognitionResult(const WebString&);
62
    void didCompleteRecognition();
63
64
private:
65
    WebSpeechInputController* m_controller; // To call into the embedder.
66
    WebCore::SpeechInputClientListener* m_listener; // Valid when recognition is in progress.
67
};
68
69
} // namespace WebKit
70
71
#endif // ENABLE(INPUT_SPEECH)
72
73
#endif // SpeechInputClientImpl_h
- a/WebKit/chromium/src/WebViewImpl.cpp +6 lines
Lines 258-263 WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools a/WebKit/chromium/src/WebViewImpl.cpp_sec1
258
    , m_layerRenderer(0)
258
    , m_layerRenderer(0)
259
    , m_isAcceleratedCompositingActive(false)
259
    , m_isAcceleratedCompositingActive(false)
260
#endif
260
#endif
261
#if ENABLE(INPUT_SPEECH)
262
    , m_speechInputClient(client)
263
#endif
261
    , m_gles2Context(0)
264
    , m_gles2Context(0)
262
{
265
{
263
    // WebKit/win/WebView.cpp does the same thing, except they call the
266
    // WebKit/win/WebView.cpp does the same thing, except they call the
Lines 278-283 WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools a/WebKit/chromium/src/WebViewImpl.cpp_sec2
278
281
279
    m_page->backForwardList()->setClient(&m_backForwardListClientImpl);
282
    m_page->backForwardList()->setClient(&m_backForwardListClientImpl);
280
    m_page->setGroupName(pageGroupName);
283
    m_page->setGroupName(pageGroupName);
284
#if ENABLE(INPUT_SPEECH)
285
    m_page->setSpeechInputClient(&m_speechInputClient);
286
#endif
281
287
282
    m_inspectorSettingsMap.set(new SettingsMap);
288
    m_inspectorSettingsMap.set(new SettingsMap);
283
}
289
}
- a/WebKit/chromium/src/WebViewImpl.h +5 lines
Lines 47-52 a/WebKit/chromium/src/WebViewImpl.h_sec1
47
#include "InspectorClientImpl.h"
47
#include "InspectorClientImpl.h"
48
#include "LayerRendererChromium.h"
48
#include "LayerRendererChromium.h"
49
#include "NotificationPresenterImpl.h"
49
#include "NotificationPresenterImpl.h"
50
#include "SpeechInputClientImpl.h"
50
#include <wtf/OwnPtr.h>
51
#include <wtf/OwnPtr.h>
51
#include <wtf/RefCounted.h>
52
#include <wtf/RefCounted.h>
52
53
Lines 511-516 private: a/WebKit/chromium/src/WebViewImpl.h_sec2
511
#endif
512
#endif
512
    static const WebInputEvent* m_currentInputEvent;
513
    static const WebInputEvent* m_currentInputEvent;
513
514
515
#if ENABLE(INPUT_SPEECH)
516
    SpeechInputClientImpl m_speechInputClient;
517
#endif
518
514
    OwnPtr<WebGLES2Context> m_gles2Context;
519
    OwnPtr<WebGLES2Context> m_gles2Context;
515
};
520
};
516
521

Return to Bug 42367