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

Side by Side Diff: webkit/glue/webplugin_impl.cc

Issue 19413: Linux plugins WIP. (Closed)
Patch Set: review comments Created 11 years, 10 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 | « webkit/glue/webplugin_delegate.h ('k') | webkit/tools/test_shell/test_webview_delegate_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « webkit/glue/webplugin_delegate.h ('k') | webkit/tools/test_shell/test_webview_delegate_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698