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

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

Issue 1763103002: WebPluginContainer: expose and implement localToScreenRect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 WebPoint WebPluginContainerImpl::localToRootFramePoint(const WebPoint& pointInLo cal) 583 WebPoint WebPluginContainerImpl::localToRootFramePoint(const WebPoint& pointInLo cal)
584 { 584 {
585 FrameView* view = toFrameView(parent()); 585 FrameView* view = toFrameView(parent());
586 if (!view) 586 if (!view)
587 return pointInLocal; 587 return pointInLocal;
588 IntPoint absolutePoint = roundedIntPoint(m_element->layoutObject()->localToA bsolute(FloatPoint(pointInLocal), UseTransforms)); 588 IntPoint absolutePoint = roundedIntPoint(m_element->layoutObject()->localToA bsolute(FloatPoint(pointInLocal), UseTransforms));
589 return view->contentsToRootFrame(absolutePoint); 589 return view->contentsToRootFrame(absolutePoint);
590 } 590 }
591 591
592 WebRect WebPluginContainerImpl::localToScreenRect(const WebRect& rectInLocal)
593 {
594 FrameView* view = toFrameView(parent());
595 if (!view)
596 return rectInLocal;
597 IntRect absoluteRect = roundedIntRect(m_element->layoutObject()->localToAbso luteQuad(FloatQuad(FloatRect(rectInLocal)), UseTransforms).boundingBox());
598
599 return view->contentsToScreen(absoluteRect);
600 }
601
592 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response ) 602 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response )
593 { 603 {
594 // Make sure that the plugin receives window geometry before data, or else 604 // Make sure that the plugin receives window geometry before data, or else
595 // plugins misbehave. 605 // plugins misbehave.
596 frameRectsChanged(); 606 frameRectsChanged();
597 607
598 WrappedResourceResponse urlResponse(response); 608 WrappedResourceResponse urlResponse(response);
599 m_webPlugin->didReceiveResponse(urlResponse); 609 m_webPlugin->didReceiveResponse(urlResponse);
600 } 610 }
601 611
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 // frame view. 987 // frame view.
978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 988 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
979 } 989 }
980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 990 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
981 // Convert to the plugin position. 991 // Convert to the plugin position.
982 for (size_t i = 0; i < cutOutRects.size(); i++) 992 for (size_t i = 0; i < cutOutRects.size(); i++)
983 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 993 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
984 } 994 }
985 995
986 } // namespace blink 996 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.h ('k') | third_party/WebKit/public/web/WebPluginContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698