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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 225823007: Migrate wheel events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 #include "web/WebViewImpl.h" 32 #include "web/WebViewImpl.h"
33 33
34 #include "CSSValueKeywords.h" 34 #include "CSSValueKeywords.h"
35 #include "HTMLNames.h" 35 #include "HTMLNames.h"
36 #include "RuntimeEnabledFeatures.h" 36 #include "RuntimeEnabledFeatures.h"
37 #include "core/accessibility/AXObjectCache.h" 37 #include "core/accessibility/AXObjectCache.h"
38 #include "core/clipboard/DataObject.h" 38 #include "core/clipboard/DataObject.h"
39 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
40 #include "core/dom/DocumentMarkerController.h" 40 #include "core/dom/DocumentMarkerController.h"
41 #include "core/dom/Text.h" 41 #include "core/dom/Text.h"
42 #include "core/dom/WheelController.h"
43 #include "core/editing/Editor.h" 42 #include "core/editing/Editor.h"
44 #include "core/editing/FrameSelection.h" 43 #include "core/editing/FrameSelection.h"
45 #include "core/editing/InputMethodController.h" 44 #include "core/editing/InputMethodController.h"
46 #include "core/editing/TextIterator.h" 45 #include "core/editing/TextIterator.h"
47 #include "core/events/KeyboardEvent.h" 46 #include "core/events/KeyboardEvent.h"
48 #include "core/events/WheelEvent.h" 47 #include "core/events/WheelEvent.h"
48 #include "core/frame/EventHandlerRegistry.h"
49 #include "core/frame/FrameHost.h" 49 #include "core/frame/FrameHost.h"
50 #include "core/frame/FrameView.h" 50 #include "core/frame/FrameView.h"
51 #include "core/frame/LocalFrame.h" 51 #include "core/frame/LocalFrame.h"
52 #include "core/frame/PinchViewport.h" 52 #include "core/frame/PinchViewport.h"
53 #include "core/frame/Settings.h" 53 #include "core/frame/Settings.h"
54 #include "core/frame/SmartClip.h" 54 #include "core/frame/SmartClip.h"
55 #include "core/html/HTMLInputElement.h" 55 #include "core/html/HTMLInputElement.h"
56 #include "core/html/HTMLMediaElement.h" 56 #include "core/html/HTMLMediaElement.h"
57 #include "core/html/HTMLPlugInElement.h" 57 #include "core/html/HTMLPlugInElement.h"
58 #include "core/html/HTMLTextAreaElement.h" 58 #include "core/html/HTMLTextAreaElement.h"
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 if (!frame) 1469 if (!frame)
1470 return false; 1470 return false;
1471 1471
1472 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty); 1472 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty);
1473 } 1473 }
1474 1474
1475 void WebViewImpl::popupOpened(PopupContainer* popupContainer) 1475 void WebViewImpl::popupOpened(PopupContainer* popupContainer)
1476 { 1476 {
1477 ASSERT(!m_selectPopup); 1477 ASSERT(!m_selectPopup);
1478 m_selectPopup = popupContainer; 1478 m_selectPopup = popupContainer;
1479 ASSERT(mainFrameImpl()->frame()->document()); 1479 page()->frameHost().eventHandlerRegistry().didAddExternalEventHandler(EventT ypeNames::wheel);
Rick Byers 2014/05/31 03:16:40 I know you're just updating the existing code, but
Sami 2014/06/02 10:00:22 This is the only place where we need external even
1480 Document& document = *mainFrameImpl()->frame()->document();
1481 WheelController::from(document)->didAddWheelEventHandler(document);
1482 } 1480 }
1483 1481
1484 void WebViewImpl::popupClosed(PopupContainer* popupContainer) 1482 void WebViewImpl::popupClosed(PopupContainer* popupContainer)
1485 { 1483 {
1486 ASSERT(m_selectPopup); 1484 ASSERT(m_selectPopup);
1487 m_selectPopup = nullptr; 1485 m_selectPopup = nullptr;
1488 ASSERT(mainFrameImpl()->frame()->document()); 1486 page()->frameHost().eventHandlerRegistry().didRemoveExternalEventHandler(Eve ntTypeNames::wheel);
1489 Document& document = *mainFrameImpl()->frame()->document();
1490 WheelController::from(document)->didRemoveWheelEventHandler(document);
1491 } 1487 }
1492 1488
1493 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView) 1489 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView)
1494 { 1490 {
1495 ASSERT(client); 1491 ASSERT(client);
1496 if (hasOpenedPopup()) 1492 if (hasOpenedPopup())
1497 hidePopups(); 1493 hidePopups();
1498 ASSERT(!m_pagePopup); 1494 ASSERT(!m_pagePopup);
1499 1495
1500 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage); 1496 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage);
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4070 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4075 4071
4076 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4072 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4077 return false; 4073 return false;
4078 4074
4079 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4075 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4080 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4076 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4081 } 4077 }
4082 4078
4083 } // namespace blink 4079 } // namespace blink
OLDNEW
« Source/core/frame/LocalFrame.cpp ('K') | « Source/web/FrameLoaderClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698