OLD | NEW |
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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 for (size_t i = 0; i < cutOutRects.size(); i++) | 965 for (size_t i = 0; i < cutOutRects.size(); i++) |
966 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); | 966 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); |
967 } | 967 } |
968 | 968 |
969 IntRect WebPluginContainerImpl::windowClipRect() const | 969 IntRect WebPluginContainerImpl::windowClipRect() const |
970 { | 970 { |
971 // Start by clipping to our bounds. | 971 // Start by clipping to our bounds. |
972 IntRect clipRect = | 972 IntRect clipRect = |
973 convertToContainingWindow(IntRect(0, 0, width(), height())); | 973 convertToContainingWindow(IntRect(0, 0, width(), height())); |
974 | 974 |
975 // document().renderView() can be 0 when we receive messages from the | 975 if (m_element->document().isActive()) { |
976 // plugins while we are destroying a frame. | |
977 // FIXME: Can we just check m_element->document().isActive() ? | |
978 if (m_element->renderer()->document().renderView()) { | |
979 // Take our element and get the clip rect from the enclosing layer and | 976 // Take our element and get the clip rect from the enclosing layer and |
980 // frame view. | 977 // frame view. |
981 clipRect.intersect( | 978 clipRect.intersect( |
982 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); | 979 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); |
983 } | 980 } |
984 | 981 |
985 return clipRect; | 982 return clipRect; |
986 } | 983 } |
987 | 984 |
988 bool WebPluginContainerImpl::pluginShouldPersist() const | 985 bool WebPluginContainerImpl::pluginShouldPersist() const |
989 { | 986 { |
990 return m_webPlugin->shouldPersist(); | 987 return m_webPlugin->shouldPersist(); |
991 } | 988 } |
992 | 989 |
993 } // namespace blink | 990 } // namespace blink |
OLD | NEW |