Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1944)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 803943002: Remove old PopupContainer/PopupListBox popup menu Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 1b0251d0de2bf96af9c60876a87ea1cabe88be40..25b125c9cf60cf8202e2025c3cc45a30042dd442 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -146,7 +146,6 @@
#include "web/GraphicsLayerFactoryChromium.h"
#include "web/LinkHighlight.h"
#include "web/NavigatorContentUtilsClientImpl.h"
-#include "web/PopupContainer.h"
#include "web/PrerendererClientImpl.h"
#include "web/StorageQuotaClientImpl.h"
#include "web/ValidationMessageClientImpl.h"
@@ -157,7 +156,6 @@
#include "web/WebLocalFrameImpl.h"
#include "web/WebPagePopupImpl.h"
#include "web/WebPluginContainerImpl.h"
-#include "web/WebPopupMenuImpl.h"
#include "web/WebRemoteFrameImpl.h"
#include "web/WebSettingsImpl.h"
#include "web/WorkerGlobalScopeProxyProviderImpl.h"
@@ -487,13 +485,10 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
// If there is a popup open, close it as the user is clicking on the page (outside of the
// popup). We also save it so we can prevent a click on an element from immediately
// reopening the same popup.
- RefPtrWillBeRawPtr<PopupContainer> selectPopup = nullptr;
RefPtr<WebPagePopupImpl> pagePopup;
if (event.button == WebMouseEvent::ButtonLeft) {
- selectPopup = m_selectPopup;
pagePopup = m_pagePopup;
hidePopups();
- ASSERT(!m_selectPopup);
ASSERT(!m_pagePopup);
}
@@ -520,14 +515,6 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode)
m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownGestureToken();
- if (m_selectPopup && m_selectPopup == selectPopup) {
- // That click triggered a select popup which is the same as the one that
- // was showing before the click. It means the user clicked the select
- // while the popup was showing, and as a result we first closed then
- // immediately reopened the select popup. It needs to be closed.
- hideSelectPopup();
- }
-
if (m_pagePopup && pagePopup && m_pagePopup->hasSamePopupClient(pagePopup.get())) {
// That click triggered a page popup that is the same as the one we just closed.
// It needs to be closed.
@@ -735,11 +722,6 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
break;
}
- RefPtrWillBeRawPtr<PopupContainer> selectPopup = nullptr;
- selectPopup = m_selectPopup;
- hideSelectPopup();
- ASSERT(!m_selectPopup);
-
// Don't trigger a disambiguation popup on sites designed for mobile devices.
// Instead, assume that the page has been designed with big enough buttons and links.
// Don't trigger a disambiguation popup when screencasting, since it's implemented outside of
@@ -781,14 +763,6 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureEvent(targetedEvent);
- if (m_selectPopup && m_selectPopup == selectPopup) {
- // That tap triggered a select popup which is the same as the one that
- // was showing before the tap. It means the user tapped the select
- // while the popup was showing, and as a result we first closed then
- // immediately reopened the select popup. It needs to be closed.
- hideSelectPopup();
- }
-
break;
}
case WebInputEvent::GestureTwoFingerTap:
@@ -972,10 +946,8 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
// event.
m_suppressNextKeypressEvent = false;
- // If there is a select popup, it should be the one processing the event,
+ // If there is a popup, it should be the one processing the event,
// not the page.
- if (m_selectPopup)
- return m_selectPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event));
if (m_pagePopup) {
m_pagePopup->handleKeyEvent(PlatformKeyboardEventBuilder(event));
// We need to ignore the next Char event after this otherwise pressing
@@ -1041,10 +1013,8 @@ bool WebViewImpl::handleCharEvent(const WebKeyboardEvent& event)
bool suppress = m_suppressNextKeypressEvent;
m_suppressNextKeypressEvent = false;
- // If there is a select popup, it should be the one processing the event,
+ // If there is a popup, it should be the one processing the event,
// not the page.
- if (m_selectPopup)
- return m_selectPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event));
if (m_pagePopup)
return m_pagePopup->handleKeyEvent(PlatformKeyboardEventBuilder(event));
@@ -1535,34 +1505,6 @@ bool WebViewImpl::mapKeyCodeForScroll(
return true;
}
-void WebViewImpl::hideSelectPopup()
-{
- if (m_selectPopup)
- m_selectPopup->hidePopup();
-}
-
-void WebViewImpl::popupOpened(PopupContainer* popupContainer)
-{
- ASSERT(!m_selectPopup);
- m_selectPopup = popupContainer;
- ASSERT(mainFrameImpl()->frame()->document());
- Document& document = *mainFrameImpl()->frame()->document();
- page()->frameHost().eventHandlerRegistry().didAddEventHandler(document, EventHandlerRegistry::WheelEvent);
-}
-
-void WebViewImpl::popupClosed(PopupContainer* popupContainer)
-{
- ASSERT(m_selectPopup);
- m_selectPopup = nullptr;
- ASSERT(mainFrameImpl()->frame()->document());
- Document& document = *mainFrameImpl()->frame()->document();
- // Remove the handler we added in |popupOpened| conditionally, because the
- // Document may have already removed it, for instance, due to a navigation.
- EventHandlerRegistry* registry = &document.frameHost()->eventHandlerRegistry();
- if (registry->eventHandlerTargets(EventHandlerRegistry::WheelEvent)->contains(&document))
- registry->didRemoveEventHandler(document, EventHandlerRegistry::WheelEvent);
-}
-
PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& originBoundsInRootView)
{
ASSERT(client);
@@ -3834,7 +3776,6 @@ void WebViewImpl::extractSmartClipData(WebRect rect, WebString& clipText, WebStr
void WebViewImpl::hidePopups()
{
- hideSelectPopup();
if (m_pagePopup)
closePagePopup(m_pagePopup.get());
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698