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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/web/WebInputEventConversion.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 { 164 {
165 if (!parent()) 165 if (!parent())
166 return; 166 return;
167 167
168 LayoutBox* layoutObject = toLayoutBox(m_element->layoutObject()); 168 LayoutBox* layoutObject = toLayoutBox(m_element->layoutObject());
169 if (!layoutObject) 169 if (!layoutObject)
170 return; 170 return;
171 171
172 IntRect dirtyRect = rect; 172 IntRect dirtyRect = rect;
173 dirtyRect.move( 173 dirtyRect.move(
174 layoutObject->borderLeft() + layoutObject->paddingLeft(), 174 (layoutObject->borderLeft() + layoutObject->paddingLeft()).toInt(),
175 layoutObject->borderTop() + layoutObject->paddingTop()); 175 (layoutObject->borderTop() + layoutObject->paddingTop()).toInt());
176 176
177 m_pendingInvalidationRect.unite(dirtyRect); 177 m_pendingInvalidationRect.unite(dirtyRect);
178 178
179 layoutObject->setMayNeedPaintInvalidation(); 179 layoutObject->setMayNeedPaintInvalidation();
180 } 180 }
181 181
182 void WebPluginContainerImpl::setFocus(bool focused, WebFocusType focusType) 182 void WebPluginContainerImpl::setFocus(bool focused, WebFocusType focusType)
183 { 183 {
184 Widget::setFocus(focused, focusType); 184 Widget::setFocus(focused, focusType);
185 m_webPlugin->updateFocus(focused, focusType); 185 m_webPlugin->updateFocus(focused, focusType);
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 else if (event->type() == EventTypeNames::drop) 744 else if (event->type() == EventTypeNames::drop)
745 dragStatus = WebDragStatusDrop; 745 dragStatus = WebDragStatusDrop;
746 746
747 if (dragStatus == WebDragStatusUnknown) 747 if (dragStatus == WebDragStatusUnknown)
748 return; 748 return;
749 749
750 DataTransfer* dataTransfer = event->getDataTransfer(); 750 DataTransfer* dataTransfer = event->getDataTransfer();
751 WebDragData dragData = dataTransfer->dataObject()->toWebDragData(); 751 WebDragData dragData = dataTransfer->dataObject()->toWebDragData();
752 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask> (dataTransfer->sourceOperation()); 752 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask> (dataTransfer->sourceOperation());
753 WebPoint dragScreenLocation(event->screenX(), event->screenY()); 753 WebPoint dragScreenLocation(event->screenX(), event->screenY());
754 WebPoint dragLocation(event->absoluteLocation().x() - location().x(), event- >absoluteLocation().y() - location().y()); 754 WebPoint dragLocation((event->absoluteLocation().x() - location().x()).toInt (), (event->absoluteLocation().y() - location().y()).toInt());
755 755
756 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, dragLocation, dragScreenLocation); 756 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, dragLocation, dragScreenLocation);
757 } 757 }
758 758
759 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) 759 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event)
760 { 760 {
761 WebMouseWheelEventBuilder webEvent(this, LayoutItem(m_element->layoutObject( )), *event); 761 WebMouseWheelEventBuilder webEvent(this, LayoutItem(m_element->layoutObject( )), *event);
762 if (webEvent.type == WebInputEvent::Undefined) 762 if (webEvent.type == WebInputEvent::Undefined)
763 return; 763 return;
764 764
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 // frame view. 937 // frame view.
938 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 938 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
939 } 939 }
940 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 940 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
941 // Convert to the plugin position. 941 // Convert to the plugin position.
942 for (size_t i = 0; i < cutOutRects.size(); i++) 942 for (size_t i = 0; i < cutOutRects.size(); i++)
943 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 943 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
944 } 944 }
945 945
946 } // namespace blink 946 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebInputEventConversion.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698