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

Side by Side Diff: Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

Issue 10692027: Merge 120881 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 5 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 | « no previous file | 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 * 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (!m_textureLayer.isNull()) 456 if (!m_textureLayer.isNull())
457 m_textureLayer.setOpaque(opaque); 457 m_textureLayer.setOpaque(opaque);
458 458
459 if (!m_ioSurfaceLayer.isNull()) 459 if (!m_ioSurfaceLayer.isNull())
460 m_ioSurfaceLayer.setOpaque(opaque); 460 m_ioSurfaceLayer.setOpaque(opaque);
461 #endif 461 #endif
462 } 462 }
463 463
464 bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) 464 bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
465 { 465 {
466 Page* page = m_element->document()->page(); 466 Frame* frame = m_element->document()->frame();
467 if (!page) 467 if (!frame)
468 return false; 468 return false;
469 469
470 // hitTestResultAtPoint() takes a padding rectangle. 470 // hitTestResultAtPoint() takes a padding rectangle.
471 // FIXME: We'll be off by 1 when the width or height is even. 471 // FIXME: We'll be off by 1 when the width or height is even.
472 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); 472 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height);
473 LayoutPoint center = documentRect.center(); 473 LayoutPoint center = documentRect.center();
474 // Make the rect we're checking (the point surrounded by padding rects) cont ained inside the requested rect. (Note that -1/2 is 0.) 474 // Make the rect we're checking (the point surrounded by padding rects) cont ained inside the requested rect. (Note that -1/2 is 0.)
475 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2); 475 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2);
476 HitTestResult result = 476 HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, f alse, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::A ctive, padding);
477 page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, f alse, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
478 const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); 477 const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
479 if (nodes.size() != 1) 478 if (nodes.size() != 1)
480 return false; 479 return false;
481 return (nodes.first().get() == m_element); 480 return (nodes.first().get() == m_element);
482 } 481 }
483 482
484 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response ) 483 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response )
485 { 484 {
486 // Make sure that the plugin receives window geometry before data, or else 485 // Make sure that the plugin receives window geometry before data, or else
487 // plugins misbehave. 486 // plugins misbehave.
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 // frame view. 715 // frame view.
717 RenderLayer* layer = m_element->renderer()->enclosingLayer(); 716 RenderLayer* layer = m_element->renderer()->enclosingLayer();
718 clipRect.intersect( 717 clipRect.intersect(
719 m_element->document()->view()->windowClipRectForLayer(layer, true)); 718 m_element->document()->view()->windowClipRectForLayer(layer, true));
720 } 719 }
721 720
722 return clipRect; 721 return clipRect;
723 } 722 }
724 723
725 } // namespace WebKit 724 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698