[Qt] Transform QtFallbackWebPopupCombo into QtWebComboBox
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 18:39:12 +0000 (18:39 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 18:39:12 +0000 (18:39 +0000)
commit42940ff947b80361d51063119124348954243328
tree72b3627efcd665e332529319e1af66a2119fd65c
parent53d71ad6ce78cf6b36c3cc19eb4974d59fadbfeb
[Qt] Transform QtFallbackWebPopupCombo into QtWebComboBox
https://bugs.webkit.org/show_bug.cgi?id=67344

Reviewed by Andreas Kling.

Renamed QtFallbackWebPopup to QtWebComboBox and decoupled it from
QtFallbackWebPopup. The new class is a QComboBox with the features that
we need for QtWebKit: tracking when the popup is hidden (via the didHide()
signal) and a convenience method to show its popup in the cursor position.

An important change was made to the combobox: instead of hooking our actions in
showPopup() and hidePopup(), as well as watching for popup visibility events, we
now just watch for the visibility events. This allowed us to get rid of
m_popupVisible and tracking the Show event.

This commit also removed a workaround for input focus added in r40970 after
reviewers request. See bug report for details.

* QtWebKit.pro:
* WebCoreSupport/QtFallbackWebPopup.cpp:
(WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
(WebCore::QtFallbackWebPopup::~QtFallbackWebPopup):
(WebCore::QtFallbackWebPopup::show):
(WebCore::QtFallbackWebPopup::deleteComboBox):
* WebCoreSupport/QtFallbackWebPopup.h:
* WebCoreSupport/QtWebComboBox.cpp: Added.
(WebCore::QtWebComboBox::QtWebComboBox):
(WebCore::QtWebComboBox::showPopupAtCursorPosition):
(WebCore::QtWebComboBox::eventFilter):
* WebCoreSupport/QtWebComboBox.h: Added.

* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::popupFocus):
Change the test to use QObject::findChild(). The old method couldn't find our
new class because we defined a new metaclass for it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/QtWebKit.pro
Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
Source/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp [new file with mode: 0644]
Source/WebKit/qt/WebCoreSupport/QtWebComboBox.h [new file with mode: 0644]
Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp