OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 MSVC_PUSH_WARNING_LEVEL(0); | 10 MSVC_PUSH_WARNING_LEVEL(0); |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 DCHECK(parent()->isFrameView()); | 699 DCHECK(parent()->isFrameView()); |
700 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent()); | 700 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent()); |
701 | 701 |
702 // The plugin is positioned in window coordinates, so it needs to be painted | 702 // The plugin is positioned in window coordinates, so it needs to be painted |
703 // in window coordinates. | 703 // in window coordinates. |
704 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0)); | 704 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0)); |
705 gc->translate(static_cast<float>(origin.x()), | 705 gc->translate(static_cast<float>(origin.x()), |
706 static_cast<float>(origin.y())); | 706 static_cast<float>(origin.y())); |
707 | 707 |
708 #if defined(OS_WIN) | 708 #if defined(OS_WIN) |
709 // HDC is only used when in windowless mode. | 709 // Note that HDC is only used when in windowless mode. |
710 HDC hdc = gc->platformContext()->canvas()->beginPlatformPaint(); | 710 HDC dc = gc->platformContext()->canvas()->beginPlatformPaint(); |
711 #else | 711 #else |
712 NOTIMPLEMENTED(); | 712 // TODO(port): the equivalent of the above. |
| 713 void* dc = NULL; // Temporary, to reduce ifdefs. |
713 #endif | 714 #endif |
714 | 715 |
715 WebCore::IntRect window_rect = | 716 WebCore::IntRect window_rect = |
716 WebCore::IntRect(view->contentsToWindow(damage_rect.location()), | 717 WebCore::IntRect(view->contentsToWindow(damage_rect.location()), |
717 damage_rect.size()); | 718 damage_rect.size()); |
718 | 719 |
| 720 delegate_->Paint(dc, webkit_glue::FromIntRect(window_rect)); |
| 721 |
719 #if defined(OS_WIN) | 722 #if defined(OS_WIN) |
720 delegate_->Paint(hdc, webkit_glue::FromIntRect(window_rect)); | |
721 | |
722 gc->platformContext()->canvas()->endPlatformPaint(); | 723 gc->platformContext()->canvas()->endPlatformPaint(); |
723 #endif | 724 #endif |
724 gc->restore(); | 725 gc->restore(); |
725 } | 726 } |
726 | 727 |
727 void WebPluginImpl::print(WebCore::GraphicsContext* gc) { | 728 void WebPluginImpl::print(WebCore::GraphicsContext* gc) { |
728 if (gc->paintingDisabled()) | 729 if (gc->paintingDisabled()) |
729 return; | 730 return; |
730 | 731 |
731 if (!parent()) | 732 if (!parent()) |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 client_index = clients_.erase(client_index); | 1402 client_index = clients_.erase(client_index); |
1402 if (resource_client) | 1403 if (resource_client) |
1403 resource_client->DidFail(); | 1404 resource_client->DidFail(); |
1404 } | 1405 } |
1405 | 1406 |
1406 // This needs to be called now and not in the destructor since the | 1407 // This needs to be called now and not in the destructor since the |
1407 // webframe_ might not be valid anymore. | 1408 // webframe_ might not be valid anymore. |
1408 webframe_->set_plugin_delegate(NULL); | 1409 webframe_->set_plugin_delegate(NULL); |
1409 webframe_ = NULL; | 1410 webframe_ = NULL; |
1410 } | 1411 } |
OLD | NEW |