Refactoring of PopupMenuChromium For Readability and Maintainability
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2011 23:18:48 +0000 (23:18 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2011 23:18:48 +0000 (23:18 +0000)
commitac0c556c9a8ef4ece1a03d4b62e8b2e6b3239992
tree80c5c5f8c9c87e5185af24e6dc0be658ac947f4a
parentac98f66f433021fdcfecaa74c350b73a0a31570f
Refactoring of PopupMenuChromium For Readability and Maintainability
https://bugs.webkit.org/show_bug.cgi?id=66009

Reviewed by Darin Fisher.

Source/WebCore:

Split PopupMenuChromium into three sets of files: PopupMenuChromium.{h|cpp}, PopupContainer.{h|cpp},
and PopupLisBox.{h|cpp}  for readability and maintainability.

No new tests as there's no change in functionality.

* WebCore.gypi:
* platform/chromium/PopupContainer.cpp: Added.
(WebCore::constructRelativeMouseEvent):
(WebCore::constructRelativeWheelEvent):
(WebCore::PopupContainer::create):
(WebCore::PopupContainer::PopupContainer):
(WebCore::PopupContainer::~PopupContainer):
(WebCore::PopupContainer::layoutAndCalculateWidgetRect):
(WebCore::PopupContainer::showPopup):
(WebCore::PopupContainer::hidePopup):
(WebCore::PopupContainer::notifyPopupHidden):
(WebCore::PopupContainer::layoutAndGetRTLOffset):
(WebCore::PopupContainer::handleMouseDownEvent):
(WebCore::PopupContainer::handleMouseMoveEvent):
(WebCore::PopupContainer::handleMouseReleaseEvent):
(WebCore::PopupContainer::handleWheelEvent):
(WebCore::PopupContainer::handleTouchEvent):
(WebCore::PopupContainer::handleGestureEvent):
(WebCore::PopupContainer::handleKeyEvent):
(WebCore::PopupContainer::hide):
(WebCore::PopupContainer::paint):
(WebCore::PopupContainer::paintBorder):
(WebCore::PopupContainer::isInterestedInEventForKey):
(WebCore::PopupContainer::chromeClientChromium):
(WebCore::PopupContainer::showInRect):
(WebCore::PopupContainer::refresh):
(WebCore::PopupContainer::isRTL):
(WebCore::PopupContainer::selectedIndex):
(WebCore::PopupContainer::menuItemHeight):
(WebCore::PopupContainer::menuItemFontSize):
(WebCore::PopupContainer::menuStyle):
(WebCore::popupData):
(WebCore::PopupContainer::getSelectedItemToolTip):
* platform/chromium/PopupContainer.h: Added.
(WebCore::PopupContainer::listBox):
(WebCore::PopupContainer::popupType):
* platform/chromium/PopupListBox.cpp: Added.
(WebCore::PopupListBox::PopupListBox):
(WebCore::PopupListBox::handleMouseDownEvent):
(WebCore::PopupListBox::handleMouseMoveEvent):
(WebCore::PopupListBox::handleMouseReleaseEvent):
(WebCore::PopupListBox::handleWheelEvent):
(WebCore::PopupListBox::isInterestedInEventForKey):
(WebCore::PopupListBox::handleTouchEvent):
(WebCore::PopupListBox::handleGestureEvent):
(WebCore::isCharacterTypeEvent):
(WebCore::PopupListBox::handleKeyEvent):
(WebCore::PopupListBox::hostWindow):
(WebCore::stripLeadingWhiteSpace):
(WebCore::PopupListBox::typeAheadFind):
(WebCore::PopupListBox::paint):
(WebCore::PopupListBox::paintRow):
(WebCore::PopupListBox::getRowFont):
(WebCore::PopupListBox::abandon):
(WebCore::PopupListBox::pointToRowIndex):
(WebCore::PopupListBox::acceptIndex):
(WebCore::PopupListBox::selectIndex):
(WebCore::PopupListBox::setOriginalIndex):
(WebCore::PopupListBox::getRowHeight):
(WebCore::PopupListBox::getRowBounds):
(WebCore::PopupListBox::invalidateRow):
(WebCore::PopupListBox::scrollToRevealRow):
(WebCore::PopupListBox::isSelectableItem):
(WebCore::PopupListBox::clearSelection):
(WebCore::PopupListBox::selectNextRow):
(WebCore::PopupListBox::selectPreviousRow):
(WebCore::PopupListBox::adjustSelectedIndex):
(WebCore::PopupListBox::hidePopup):
(WebCore::PopupListBox::updateFromElement):
(WebCore::PopupListBox::setMaxWidthAndLayout):
(WebCore::PopupListBox::layout):
(WebCore::PopupListBox::clear):
(WebCore::PopupListBox::isPointInBounds):
* platform/chromium/PopupListBox.h: Added.
(WebCore::PopupItem::PopupItem):
(WebCore::PopupListBox::create):
(WebCore::PopupListBox::selectedIndex):
(WebCore::PopupListBox::numItems):
(WebCore::PopupListBox::setBaseWidth):
(WebCore::PopupListBox::setMaxHeight):
(WebCore::PopupListBox::setMaxWidth):
(WebCore::PopupListBox::disconnectClient):
(WebCore::PopupListBox::items):
(WebCore::PopupListBox::~PopupListBox):
(WebCore::PopupListBox::scrollToRevealSelection):
* platform/chromium/PopupMenuChromium.cpp:
* platform/chromium/PopupMenuChromium.h:

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
* src/WebPopupMenuImpl.cpp:
* src/WebViewImpl.cpp:
* tests/PopupMenuTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/chromium/PopupContainer.cpp [new file with mode: 0644]
Source/WebCore/platform/chromium/PopupContainer.h [new file with mode: 0644]
Source/WebCore/platform/chromium/PopupListBox.cpp [new file with mode: 0644]
Source/WebCore/platform/chromium/PopupListBox.h [new file with mode: 0644]
Source/WebCore/platform/chromium/PopupMenuChromium.cpp
Source/WebCore/platform/chromium/PopupMenuChromium.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/tests/PopupMenuTest.cpp