Benjamin Meyer <bmeyer@trolltech.com>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2008 10:03:14 +0000 (10:03 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2008 10:03:14 +0000 (10:03 +0000)
Implement ChromeClientQt::setToolTip
Implement ChromeClientQt::mouseDidMoveOverElement

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29713 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/Api/qwebpage.cpp
WebKit/qt/Api/qwebpage_p.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
WebKit/qt/WebCoreSupport/ChromeClientQt.h

index 61fa3e6..bde7eeb 100644 (file)
@@ -334,22 +334,7 @@ void QWebPagePrivate::updateEditorActions()
 
 void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
 {
-    QWebFramePrivate::core(mainFrame)->eventHandler()->handleMouseMoveEvent(PlatformMouseEvent(ev, 0));
-    const int xOffset =
-        mainFrame->d->horizontalScrollBar() ? mainFrame->d->horizontalScrollBar()->value() : 0;
-    const int yOffset =
-        mainFrame->d->verticalScrollBar() ? mainFrame->d->verticalScrollBar()->value() : 0;
-    IntPoint pt(ev->x() + xOffset, ev->y() + yOffset);
-    WebCore::HitTestResult result = QWebFramePrivate::core(mainFrame)->eventHandler()->hitTestResultAtPoint(pt, false);
-
-    if (result.absoluteLinkURL() != lastHoverURL
-        || result.title() != lastHoverTitle
-        || result.textContent() != lastHoverContent) {
-        lastHoverURL = result.absoluteLinkURL();
-        lastHoverTitle = result.title();
-        lastHoverContent = result.textContent();
-        emit q->hoveringOverLink(lastHoverURL.prettyURL(), lastHoverTitle, lastHoverContent);
-    }
+    QWebFramePrivate::core(mainFrame)->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0));
 }
 
 void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
index 26457a1..80b1e29 100644 (file)
@@ -130,10 +130,6 @@ public:
     QUndoStack *undoStack;
     QWidget *view;
 
-    WebCore::KURL lastHoverURL;
-    WebCore::String lastHoverTitle;
-    WebCore::String lastHoverContent;
-
     bool modified;
 
     bool insideOpenCall;
index cdd6b67..9e380bd 100644 (file)
@@ -1,3 +1,21 @@
+2008-01-22  Benjamin Meyer  <bmeyer@trolltech.com>
+
+        Reviewed by Simon.
+
+        Implement ChromeClientQt::setToolTip
+        Implement ChromeClientQt::mouseDidMoveOverElement
+        
+
+        * Api/qwebpage.cpp:
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::ChromeClientQt):
+        (WebCore::ChromeClientQt::focus):
+        (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+        (WebCore::ChromeClientQt::setToolTip):
+        (WebCore::ChromeClientQt::print):
+        * WebCoreSupport/ChromeClientQt.h:
+
 2008-01-21  Darin Adler  <darin@apple.com>
 
         Reviewed by John Sullivan.
index 4a02537..b426813 100644 (file)
@@ -33,6 +33,8 @@
 #include "FrameLoader.h"
 #include "FrameLoaderClientQt.h"
 #include "FrameView.h"
+#include "PlatformScrollBar.h"
+#include "HitTestResult.h"
 #include "NotImplemented.h"
 #include "WindowFeatures.h"
 
 namespace WebCore
 {
 
-    
+
 ChromeClientQt::ChromeClientQt(QWebPage* webPage)
     : m_webPage(webPage)
 {
-    
+
 }
 
 
 ChromeClientQt::~ChromeClientQt()
 {
-    
+
 }
 
 void ChromeClientQt::setWindowRect(const FloatRect& rect)
@@ -99,7 +101,7 @@ void ChromeClientQt::focus()
     QWidget* view = m_webPage->view();
     if (!view)
         return;
-    
+
     view->setFocus();
 }
 
@@ -315,14 +317,24 @@ void ChromeClientQt::updateBackingStore()
 {
 }
 
-void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult&, unsigned /*modifierFlags*/)
+void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
-    notImplemented();
+    if (result.absoluteLinkURL() != lastHoverURL
+        || result.title() != lastHoverTitle
+        || result.textContent() != lastHoverContent) {
+        lastHoverURL = result.absoluteLinkURL();
+        lastHoverTitle = result.title();
+        lastHoverContent = result.textContent();
+        emit m_webPage->hoveringOverLink(lastHoverURL.prettyURL(),
+                lastHoverTitle, lastHoverContent);
+    }
 }
 
-void ChromeClientQt::setToolTip(const String&)
+void ChromeClientQt::setToolTip(const String &tip)
 {
-    notImplemented();
+    QWidget* view = m_webPage->view();
+    if (view)
+        view->setToolTip(tip);
 }
 
 void ChromeClientQt::print(Frame*)
index 989fbb2..31d492b 100644 (file)
@@ -31,6 +31,8 @@
 #include "ChromeClient.h"
 #include "FloatRect.h"
 #include "RefCounted.h"
+#include "KURL.h"
+#include "PlatformString.h"
 
 class QWebPage;
 
@@ -92,7 +94,7 @@ namespace WebCore {
         virtual bool runJavaScriptConfirm(Frame*, const String&);
         virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
         virtual bool shouldInterruptJavaScript();
-        
+
         virtual void setStatusbarText(const String&);
 
         virtual bool tabsToLinks() const;
@@ -110,6 +112,9 @@ namespace WebCore {
         virtual void exceededDatabaseQuota(Frame*, const String&);
 
         QWebPage* m_webPage;
+        WebCore::KURL lastHoverURL;
+        WebCore::String lastHoverTitle;
+        WebCore::String lastHoverContent;
     };
 }