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

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2741633002: Remove FrameHost::eventHandlerRegistry() (Closed)
Patch Set: Rebase Created 3 years, 9 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (nodes.size() != 1) 534 if (nodes.size() != 1)
535 return false; 535 return false;
536 return nodes.front().get() == m_element; 536 return nodes.front().get() == m_element;
537 } 537 }
538 538
539 void WebPluginContainerImpl::requestTouchEventType( 539 void WebPluginContainerImpl::requestTouchEventType(
540 TouchEventRequestType requestType) { 540 TouchEventRequestType requestType) {
541 if (m_touchEventRequestType == requestType || !m_element) 541 if (m_touchEventRequestType == requestType || !m_element)
542 return; 542 return;
543 543
544 if (FrameHost* frameHost = m_element->document().frameHost()) { 544 if (Page* page = m_element->document().page()) {
545 EventHandlerRegistry& registry = frameHost->eventHandlerRegistry(); 545 EventHandlerRegistry& registry = page->eventHandlerRegistry();
546 if (requestType != TouchEventRequestTypeNone && 546 if (requestType != TouchEventRequestTypeNone &&
547 m_touchEventRequestType == TouchEventRequestTypeNone) 547 m_touchEventRequestType == TouchEventRequestTypeNone)
548 registry.didAddEventHandler( 548 registry.didAddEventHandler(
549 *m_element, EventHandlerRegistry::TouchStartOrMoveEventBlocking); 549 *m_element, EventHandlerRegistry::TouchStartOrMoveEventBlocking);
550 else if (requestType == TouchEventRequestTypeNone && 550 else if (requestType == TouchEventRequestTypeNone &&
551 m_touchEventRequestType != TouchEventRequestTypeNone) 551 m_touchEventRequestType != TouchEventRequestTypeNone)
552 registry.didRemoveEventHandler( 552 registry.didRemoveEventHandler(
553 *m_element, EventHandlerRegistry::TouchStartOrMoveEventBlocking); 553 *m_element, EventHandlerRegistry::TouchStartOrMoveEventBlocking);
554 } 554 }
555 m_touchEventRequestType = requestType; 555 m_touchEventRequestType = requestType;
556 } 556 }
557 557
558 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) { 558 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) {
559 if (m_wantsWheelEvents == wantsWheelEvents) 559 if (m_wantsWheelEvents == wantsWheelEvents)
560 return; 560 return;
561 if (FrameHost* frameHost = m_element->document().frameHost()) { 561 if (Page* page = m_element->document().page()) {
562 EventHandlerRegistry& registry = frameHost->eventHandlerRegistry(); 562 EventHandlerRegistry& registry = page->eventHandlerRegistry();
563 if (wantsWheelEvents) 563 if (wantsWheelEvents)
564 registry.didAddEventHandler(*m_element, 564 registry.didAddEventHandler(*m_element,
565 EventHandlerRegistry::WheelEventBlocking); 565 EventHandlerRegistry::WheelEventBlocking);
566 else 566 else
567 registry.didRemoveEventHandler(*m_element, 567 registry.didRemoveEventHandler(*m_element,
568 EventHandlerRegistry::WheelEventBlocking); 568 EventHandlerRegistry::WheelEventBlocking);
569 } 569 }
570 570
571 m_wantsWheelEvents = wantsWheelEvents; 571 m_wantsWheelEvents = wantsWheelEvents;
572 if (Page* page = m_element->document().page()) { 572 if (Page* page = m_element->document().page()) {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 // frame view. 986 // frame view.
987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect);
988 } 988 }
989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
990 // Convert to the plugin position. 990 // Convert to the plugin position.
991 for (size_t i = 0; i < cutOutRects.size(); i++) 991 for (size_t i = 0; i < cutOutRects.size(); i++)
992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
993 } 993 }
994 994
995 } // namespace blink 995 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698