[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jorlow at chromium.org jorlow at chromium.org
Wed Dec 22 12:33:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7b64ff1c3043f1c0ed005bfd5e093a7de2bc6233
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 25 11:59:41 2010 +0000

    2010-08-25  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Pass the element's bounds to embedder during speech recognition.
            https://bugs.webkit.org/show_bug.cgi?id=44427
    
            The embedder would typically want to show a native UI with information, settings etc.
            By passing the display bounds of the html element, the embedder can position the
            native speech recognition UI appropriately.
    
            * page/SpeechInput.cpp:
            (WebCore::SpeechInput::startRecognition):
            * page/SpeechInput.h:
            * page/SpeechInputClient.h:
            * platform/mock/SpeechInputClientMock.cpp:
            (WebCore::SpeechInputClientMock::startRecognition):
            * platform/mock/SpeechInputClientMock.h:
            * rendering/TextControlInnerElements.cpp:
            (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
            (WebCore::InputFieldSpeechButtonElement::detach):
    2010-08-25  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Pass the element's bounds to embedder during speech recognition.
            https://bugs.webkit.org/show_bug.cgi?id=44427
    
            * public/WebSpeechInputController.h:
            (WebKit::WebSpeechInputController::startRecognition):
            (WebKit::WebSpeechInputController::cancelRecognition):
            (WebKit::WebSpeechInputController::stopRecording):
            * src/SpeechInputClientImpl.cpp:
            (WebKit::SpeechInputClientImpl::startRecognition):
            * src/SpeechInputClientImpl.h:
            * src/WebSpeechInputControllerMockImpl.cpp:
            (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
            * src/WebSpeechInputControllerMockImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66007 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6184e38..1175b88 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-25  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Pass the element's bounds to embedder during speech recognition.
+        https://bugs.webkit.org/show_bug.cgi?id=44427
+
+        The embedder would typically want to show a native UI with information, settings etc.
+        By passing the display bounds of the html element, the embedder can position the
+        native speech recognition UI appropriately.
+
+        * page/SpeechInput.cpp:
+        (WebCore::SpeechInput::startRecognition):
+        * page/SpeechInput.h:
+        * page/SpeechInputClient.h:
+        * platform/mock/SpeechInputClientMock.cpp:
+        (WebCore::SpeechInputClientMock::startRecognition):
+        * platform/mock/SpeechInputClientMock.h:
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+        (WebCore::InputFieldSpeechButtonElement::detach):
+
 2010-08-25  Yongjun Zhang  <yongjun_zhang at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 24b52d2..234791b 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -93,10 +93,10 @@ void SpeechInput::setRecognitionResult(int listenerId, const String& result)
         m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
 }
 
-bool SpeechInput::startRecognition(int listenerId)
+bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect)
 {
     ASSERT(m_listeners.contains(listenerId));
-    return m_client->startRecognition(listenerId);
+    return m_client->startRecognition(listenerId, elementRect);
 }
 
 void SpeechInput::stopRecording(int listenerId)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index f36194c..d10b789 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -40,6 +40,7 @@
 
 namespace WebCore {
 
+class IntRect;
 class SpeechInputClient;
 class SpeechInputListener;
 
@@ -60,7 +61,7 @@ public:
     void unregisterListener(int);
 
     // Methods invoked by the input elements.
-    bool startRecognition(int);
+    bool startRecognition(int, const IntRect&);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index 87ff7b9..d5fda17 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -35,6 +35,7 @@
 
 namespace WebCore {
 
+class IntRect;
 class SpeechInputListener;
 
 // Provides an interface for SpeechInput to call into the embedder.
@@ -47,7 +48,7 @@ public:
     virtual void setListener(SpeechInputListener*) = 0;
 
     // Starts speech recognition and audio recording.
-    virtual bool startRecognition(int requestId) = 0;
+    virtual bool startRecognition(int requestId, const IntRect& elementRect) = 0;
 
     // Stops audio recording and performs recognition with the audio recorded until now
     // (does not discard audio).
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index c3d74d1..6b64942 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -50,7 +50,7 @@ void SpeechInputClientMock::setListener(SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientMock::startRecognition(int requestId)
+bool SpeechInputClientMock::startRecognition(int requestId, const IntRect&)
 {
     if (m_timer.isActive())
         return false;
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index 7d5fda2..ce83d3b 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -50,7 +50,7 @@ public:
 
     // SpeechInputClient methods.
     void setListener(SpeechInputListener*);
-    bool startRecognition(int);
+    bool startRecognition(int, const IntRect&);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 1465580..1939133 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -425,7 +425,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
     if (event->type() == eventNames().clickEvent) {
         switch (m_state) {
         case Idle:
-            if (speechInput()->startRecognition(m_listenerId))
+            if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect()))
                 setState(Recording);
             break;
         case Recording:
@@ -483,6 +483,10 @@ void InputFieldSpeechButtonElement::detach()
         if (Frame* frame = document()->frame())
             frame->eventHandler()->setCapturingMouseEventsNode(0);      
     }
+
+    if (m_state != Idle)
+      speechInput()->cancelRecognition(m_listenerId);
+
     TextControlInnerElement::detach();
 }
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3347abb..5d860ed 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-25  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Pass the element's bounds to embedder during speech recognition.
+        https://bugs.webkit.org/show_bug.cgi?id=44427
+
+        * public/WebSpeechInputController.h:
+        (WebKit::WebSpeechInputController::startRecognition):
+        (WebKit::WebSpeechInputController::cancelRecognition):
+        (WebKit::WebSpeechInputController::stopRecording):
+        * src/SpeechInputClientImpl.cpp:
+        (WebKit::SpeechInputClientImpl::startRecognition):
+        * src/SpeechInputClientImpl.h:
+        * src/WebSpeechInputControllerMockImpl.cpp:
+        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+        * src/WebSpeechInputControllerMockImpl.h:
+
 2010-08-25  Pawel Hajdan  <phajdan.jr at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
index 9aedb6f..0315722 100644
--- a/WebKit/chromium/public/WebSpeechInputController.h
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -35,12 +35,19 @@
 
 namespace WebKit {
 
+struct WebRect;
+
 // Provides an embedder API called by WebKit.
 class WebSpeechInputController {
 public:
     // Starts speech recognition. Speech will get recorded until the endpointer detects silence,
     // runs to the limit or stopRecording is called. Progress indications and the recognized
     // text are returned via the listener interface.
+    virtual bool startRecognition(int requestId, const WebRect&)
+    {
+        return startRecognition(requestId);
+    }
+    // FIXME: Remove this once chromium has picked up this change.
     virtual bool startRecognition(int)
     {
         WEBKIT_ASSERT_NOT_REACHED();
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 9c59bae..963d440 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -56,10 +56,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientImpl::startRecognition(int requestId)
+bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect)
 {
     ASSERT(m_listener);
-    return m_controller->startRecognition(requestId);
+    return m_controller->startRecognition(requestId, elementRect);
 }
 
 void SpeechInputClientImpl::stopRecording(int requestId)
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
index 0ab54c1..817b32b 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.h
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -54,7 +54,7 @@ public:
 
     // SpeechInputClient methods.
     void setListener(WebCore::SpeechInputListener*);
-    bool startRecognition(int);
+    bool startRecognition(int, const WebCore::IntRect&);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index 57e3635..60c4fed 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -33,6 +33,7 @@
 
 #include "PlatformString.h"
 #include "SpeechInputClientMock.h"
+#include "WebRect.h"
 
 namespace WebKit {
 
@@ -74,9 +75,9 @@ void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const
     m_listener->setRecognitionResult(requestId, result);
 }
 
-bool WebSpeechInputControllerMockImpl::startRecognition(int requestId)
+bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect)
 {
-    return m_webcoreMock->startRecognition(requestId);
+    return m_webcoreMock->startRecognition(requestId, elementRect);
 }
 
 void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId)
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index 38a15df..edbfca3 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -43,6 +43,8 @@ class SpeechInputClientMock;
 
 namespace WebKit {
 
+struct WebRect;
+
 class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener
                                        , public WebSpeechInputControllerMock {
 public:
@@ -55,7 +57,7 @@ public:
     void setRecognitionResult(int requestId, const WTF::String& result);
 
     // WebSpeechInputController methods.
-    bool startRecognition(int requestId);
+    bool startRecognition(int requestId, const WebRect& elementRect);
     void cancelRecognition(int requestId);
     void stopRecording(int requestId);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list