OLD | NEW |
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #include "public/web/WebPlugin.h" | 83 #include "public/web/WebPlugin.h" |
84 #include "public/web/WebPrintParams.h" | 84 #include "public/web/WebPrintParams.h" |
85 #include "public/web/WebViewClient.h" | 85 #include "public/web/WebViewClient.h" |
86 #include "web/ChromeClientImpl.h" | 86 #include "web/ChromeClientImpl.h" |
87 #include "web/ScrollbarGroup.h" | 87 #include "web/ScrollbarGroup.h" |
88 #include "web/WebDataSourceImpl.h" | 88 #include "web/WebDataSourceImpl.h" |
89 #include "web/WebInputEventConversion.h" | 89 #include "web/WebInputEventConversion.h" |
90 #include "web/WebViewImpl.h" | 90 #include "web/WebViewImpl.h" |
91 | 91 |
92 | 92 |
93 using namespace WebCore; | 93 using namespace blink; |
94 | 94 |
95 namespace blink { | 95 namespace blink { |
96 | 96 |
97 // Public methods -------------------------------------------------------------- | 97 // Public methods -------------------------------------------------------------- |
98 | 98 |
99 void WebPluginContainerImpl::setFrameRect(const IntRect& frameRect) | 99 void WebPluginContainerImpl::setFrameRect(const IntRect& frameRect) |
100 { | 100 { |
101 Widget::setFrameRect(frameRect); | 101 Widget::setFrameRect(frameRect); |
102 reportGeometry(); | 102 reportGeometry(); |
103 } | 103 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 { | 327 { |
328 return m_webPlugin->isPrintScalingDisabled(); | 328 return m_webPlugin->isPrintScalingDisabled(); |
329 } | 329 } |
330 | 330 |
331 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const | 331 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const |
332 { | 332 { |
333 return m_webPlugin->printBegin(printParams); | 333 return m_webPlugin->printBegin(printParams); |
334 } | 334 } |
335 | 335 |
336 bool WebPluginContainerImpl::printPage(int pageNumber, | 336 bool WebPluginContainerImpl::printPage(int pageNumber, |
337 WebCore::GraphicsContext* gc) | 337 blink::GraphicsContext* gc) |
338 { | 338 { |
339 if (gc->paintingDisabled()) | 339 if (gc->paintingDisabled()) |
340 return true; | 340 return true; |
341 gc->save(); | 341 gc->save(); |
342 WebCanvas* canvas = gc->canvas(); | 342 WebCanvas* canvas = gc->canvas(); |
343 bool ret = m_webPlugin->printPage(pageNumber, canvas); | 343 bool ret = m_webPlugin->printPage(pageNumber, canvas); |
344 gc->restore(); | 344 gc->restore(); |
345 return ret; | 345 return ret; |
346 } | 346 } |
347 | 347 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 context->save(); | 649 context->save(); |
650 context->setFillColor(Color(0xCC, 0xCC, 0xCC)); | 650 context->setFillColor(Color(0xCC, 0xCC, 0xCC)); |
651 context->fillRect(intersection(horizontalOverhangArea, dirtyRect)); | 651 context->fillRect(intersection(horizontalOverhangArea, dirtyRect)); |
652 context->fillRect(intersection(verticalOverhangArea, dirtyRect)); | 652 context->fillRect(intersection(verticalOverhangArea, dirtyRect)); |
653 context->restore(); | 653 context->restore(); |
654 return true; | 654 return true; |
655 } | 655 } |
656 | 656 |
657 // Private methods ------------------------------------------------------------- | 657 // Private methods ------------------------------------------------------------- |
658 | 658 |
659 WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme
nt, WebPlugin* webPlugin) | 659 WebPluginContainerImpl::WebPluginContainerImpl(blink::HTMLPlugInElement* element
, WebPlugin* webPlugin) |
660 : WebCore::FrameDestructionObserver(element->document().frame()) | 660 : blink::FrameDestructionObserver(element->document().frame()) |
661 , m_element(element) | 661 , m_element(element) |
662 , m_webPlugin(webPlugin) | 662 , m_webPlugin(webPlugin) |
663 , m_webLayer(0) | 663 , m_webLayer(0) |
664 , m_touchEventRequestType(TouchEventRequestTypeNone) | 664 , m_touchEventRequestType(TouchEventRequestTypeNone) |
665 , m_wantsWheelEvents(false) | 665 , m_wantsWheelEvents(false) |
666 { | 666 { |
667 } | 667 } |
668 | 668 |
669 WebPluginContainerImpl::~WebPluginContainerImpl() | 669 WebPluginContainerImpl::~WebPluginContainerImpl() |
670 { | 670 { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 // Calculate a clip-rect so that we don't overlap the scrollbars, etc. | 914 // Calculate a clip-rect so that we don't overlap the scrollbars, etc. |
915 clipRect = windowClipRect(); | 915 clipRect = windowClipRect(); |
916 clipRect.move(-windowRect.x(), -windowRect.y()); | 916 clipRect.move(-windowRect.x(), -windowRect.y()); |
917 | 917 |
918 getPluginOcclusions(m_element, this->parent(), frameRect, cutOutRects); | 918 getPluginOcclusions(m_element, this->parent(), frameRect, cutOutRects); |
919 // Convert to the plugin position. | 919 // Convert to the plugin position. |
920 for (size_t i = 0; i < cutOutRects.size(); i++) | 920 for (size_t i = 0; i < cutOutRects.size(); i++) |
921 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); | 921 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); |
922 } | 922 } |
923 | 923 |
924 WebCore::IntRect WebPluginContainerImpl::windowClipRect() const | 924 blink::IntRect WebPluginContainerImpl::windowClipRect() const |
925 { | 925 { |
926 // Start by clipping to our bounds. | 926 // Start by clipping to our bounds. |
927 IntRect clipRect = | 927 IntRect clipRect = |
928 convertToContainingWindow(IntRect(0, 0, width(), height())); | 928 convertToContainingWindow(IntRect(0, 0, width(), height())); |
929 | 929 |
930 // document().renderView() can be 0 when we receive messages from the | 930 // document().renderView() can be 0 when we receive messages from the |
931 // plugins while we are destroying a frame. | 931 // plugins while we are destroying a frame. |
932 // FIXME: Can we just check m_element->document().isActive() ? | 932 // FIXME: Can we just check m_element->document().isActive() ? |
933 if (m_element->renderer()->document().renderView()) { | 933 if (m_element->renderer()->document().renderView()) { |
934 // Take our element and get the clip rect from the enclosing layer and | 934 // Take our element and get the clip rect from the enclosing layer and |
935 // frame view. | 935 // frame view. |
936 clipRect.intersect( | 936 clipRect.intersect( |
937 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); | 937 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); |
938 } | 938 } |
939 | 939 |
940 return clipRect; | 940 return clipRect; |
941 } | 941 } |
942 | 942 |
943 bool WebPluginContainerImpl::pluginShouldPersist() const | 943 bool WebPluginContainerImpl::pluginShouldPersist() const |
944 { | 944 { |
945 return m_webPlugin->shouldPersist(); | 945 return m_webPlugin->shouldPersist(); |
946 } | 946 } |
947 | 947 |
948 } // namespace blink | 948 } // namespace blink |
OLD | NEW |