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

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

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test for external handlers. Created 6 years, 8 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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "WebRange.h" 69 #include "WebRange.h"
70 #include "WebSettingsImpl.h" 70 #include "WebSettingsImpl.h"
71 #include "WebTextInputInfo.h" 71 #include "WebTextInputInfo.h"
72 #include "WebViewClient.h" 72 #include "WebViewClient.h"
73 #include "WebWindowFeatures.h" 73 #include "WebWindowFeatures.h"
74 #include "WorkerGlobalScopeProxyProviderImpl.h" 74 #include "WorkerGlobalScopeProxyProviderImpl.h"
75 #include "core/accessibility/AXObjectCache.h" 75 #include "core/accessibility/AXObjectCache.h"
76 #include "core/clipboard/DataObject.h" 76 #include "core/clipboard/DataObject.h"
77 #include "core/dom/Document.h" 77 #include "core/dom/Document.h"
78 #include "core/dom/DocumentMarkerController.h" 78 #include "core/dom/DocumentMarkerController.h"
79 #include "core/dom/EventHandlerRegistry.h"
79 #include "core/dom/Text.h" 80 #include "core/dom/Text.h"
80 #include "core/dom/WheelController.h"
81 #include "core/editing/Editor.h" 81 #include "core/editing/Editor.h"
82 #include "core/editing/FrameSelection.h" 82 #include "core/editing/FrameSelection.h"
83 #include "core/editing/InputMethodController.h" 83 #include "core/editing/InputMethodController.h"
84 #include "core/editing/TextIterator.h" 84 #include "core/editing/TextIterator.h"
85 #include "core/events/KeyboardEvent.h" 85 #include "core/events/KeyboardEvent.h"
86 #include "core/events/WheelEvent.h" 86 #include "core/events/WheelEvent.h"
87 #include "core/frame/FrameHost.h" 87 #include "core/frame/FrameHost.h"
88 #include "core/frame/FrameView.h" 88 #include "core/frame/FrameView.h"
89 #include "core/frame/LocalFrame.h" 89 #include "core/frame/LocalFrame.h"
90 #include "core/frame/PinchViewport.h" 90 #include "core/frame/PinchViewport.h"
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 1442
1443 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty); 1443 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty);
1444 } 1444 }
1445 1445
1446 void WebViewImpl::popupOpened(PopupContainer* popupContainer) 1446 void WebViewImpl::popupOpened(PopupContainer* popupContainer)
1447 { 1447 {
1448 ASSERT(!m_selectPopup); 1448 ASSERT(!m_selectPopup);
1449 m_selectPopup = popupContainer; 1449 m_selectPopup = popupContainer;
1450 ASSERT(mainFrameImpl()->frame()->document()); 1450 ASSERT(mainFrameImpl()->frame()->document());
1451 Document& document = *mainFrameImpl()->frame()->document(); 1451 Document& document = *mainFrameImpl()->frame()->document();
1452 WheelController::from(document)->didAddWheelEventHandler(document); 1452 EventHandlerRegistry::from(document)->didAddExternalEventHandler(EventTypeNa mes::wheel);
1453 } 1453 }
1454 1454
1455 void WebViewImpl::popupClosed(PopupContainer* popupContainer) 1455 void WebViewImpl::popupClosed(PopupContainer* popupContainer)
1456 { 1456 {
1457 ASSERT(m_selectPopup); 1457 ASSERT(m_selectPopup);
1458 m_selectPopup = nullptr; 1458 m_selectPopup = nullptr;
1459 ASSERT(mainFrameImpl()->frame()->document()); 1459 ASSERT(mainFrameImpl()->frame()->document());
1460 Document& document = *mainFrameImpl()->frame()->document(); 1460 Document& document = *mainFrameImpl()->frame()->document();
1461 WheelController::from(document)->didRemoveWheelEventHandler(document); 1461 EventHandlerRegistry::from(document)->didRemoveExternalEventHandler(EventTyp eNames::wheel);
1462 } 1462 }
1463 1463
1464 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView) 1464 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView)
1465 { 1465 {
1466 ASSERT(client); 1466 ASSERT(client);
1467 if (hasOpenedPopup()) 1467 if (hasOpenedPopup())
1468 hidePopups(); 1468 hidePopups();
1469 ASSERT(!m_pagePopup); 1469 ASSERT(!m_pagePopup);
1470 1470
1471 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage); 1471 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage);
(...skipping 2507 matching lines...) Expand 10 before | Expand all | Expand 10 after
3979 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3979 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3980 3980
3981 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3981 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3982 return false; 3982 return false;
3983 3983
3984 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3984 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
3985 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3985 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
3986 } 3986 }
3987 3987
3988 } // namespace blink 3988 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698