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

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: Rebase harder. 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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 1433
1434 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty); 1434 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari ty);
1435 } 1435 }
1436 1436
1437 void WebViewImpl::popupOpened(PopupContainer* popupContainer) 1437 void WebViewImpl::popupOpened(PopupContainer* popupContainer)
1438 { 1438 {
1439 ASSERT(!m_selectPopup); 1439 ASSERT(!m_selectPopup);
1440 m_selectPopup = popupContainer; 1440 m_selectPopup = popupContainer;
1441 ASSERT(mainFrameImpl()->frame()->document()); 1441 ASSERT(mainFrameImpl()->frame()->document());
1442 Document& document = *mainFrameImpl()->frame()->document(); 1442 Document& document = *mainFrameImpl()->frame()->document();
1443 WheelController::from(document)->didAddWheelEventHandler(document); 1443 EventHandlerRegistry::from(document)->didAddExternalEventHandler(EventTypeNa mes::wheel);
1444 } 1444 }
1445 1445
1446 void WebViewImpl::popupClosed(PopupContainer* popupContainer) 1446 void WebViewImpl::popupClosed(PopupContainer* popupContainer)
1447 { 1447 {
1448 ASSERT(m_selectPopup); 1448 ASSERT(m_selectPopup);
1449 m_selectPopup = nullptr; 1449 m_selectPopup = nullptr;
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)->didRemoveWheelEventHandler(document); 1452 EventHandlerRegistry::from(document)->didRemoveExternalEventHandler(EventTyp eNames::wheel);
1453 } 1453 }
1454 1454
1455 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView) 1455 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or iginBoundsInRootView)
1456 { 1456 {
1457 ASSERT(client); 1457 ASSERT(client);
1458 if (hasOpenedPopup()) 1458 if (hasOpenedPopup())
1459 hidePopups(); 1459 hidePopups();
1460 ASSERT(!m_pagePopup); 1460 ASSERT(!m_pagePopup);
1461 1461
1462 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage); 1462 WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage);
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3992 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3992 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3993 3993
3994 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3994 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3995 return false; 3995 return false;
3996 3996
3997 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3997 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
3998 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3998 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
3999 } 3999 }
4000 4000
4001 } // namespace blink 4001 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698