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

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

Issue 67024: Adds some ifdefs so that test_shell can be compiled on linux... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/tools/test_shell/test_shell.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 #include "webkit/glue/webplugin_impl.h" 6 #include "webkit/glue/webplugin_impl.h"
7 7
8 #include "Cursor.h" 8 #include "Cursor.h"
9 #include "Document.h" 9 #include "Document.h"
10 #include "DocumentLoader.h" 10 #include "DocumentLoader.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 708
709 DCHECK(parent()->isFrameView()); 709 DCHECK(parent()->isFrameView());
710 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent()); 710 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent());
711 711
712 // The plugin is positioned in window coordinates, so it needs to be painted 712 // The plugin is positioned in window coordinates, so it needs to be painted
713 // in window coordinates. 713 // in window coordinates.
714 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0)); 714 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0));
715 gc->translate(static_cast<float>(origin.x()), 715 gc->translate(static_cast<float>(origin.x()),
716 static_cast<float>(origin.y())); 716 static_cast<float>(origin.y()));
717 717
718 #if defined(OS_WIN) || defined(OS_LINUX) 718 #if defined(OS_WIN) || defined(TOOLKIT_GTK)
719 // Note that |context| is only used when in windowless mode. 719 // Note that |context| is only used when in windowless mode.
720 gfx::NativeDrawingContext context = 720 gfx::NativeDrawingContext context =
721 gc->platformContext()->canvas()->beginPlatformPaint(); 721 gc->platformContext()->canvas()->beginPlatformPaint();
722 #elif defined(OS_MACOSX) 722 #elif defined(OS_MACOSX)
723 gfx::NativeDrawingContext context = gc->platformContext(); 723 gfx::NativeDrawingContext context = gc->platformContext();
724 #else
725 NOTIMPLEMENTED();
726 gfx::NativeDrawingContext context = NULL;
724 #endif 727 #endif
725 728
726 WebCore::IntRect window_rect = 729 WebCore::IntRect window_rect =
727 WebCore::IntRect(view->contentsToWindow(damage_rect.location()), 730 WebCore::IntRect(view->contentsToWindow(damage_rect.location()),
728 damage_rect.size()); 731 damage_rect.size());
729 732
730 delegate_->Paint(context, webkit_glue::FromIntRect(window_rect)); 733 delegate_->Paint(context, webkit_glue::FromIntRect(window_rect));
731 734
732 #if defined(OS_WIN) || defined(OS_LINUX) 735 #if defined(OS_WIN) || defined(TOOLKIT_GTK)
733 gc->platformContext()->canvas()->endPlatformPaint(); 736 gc->platformContext()->canvas()->endPlatformPaint();
734 #endif 737 #endif
735 gc->restore(); 738 gc->restore();
736 } 739 }
737 740
738 void WebPluginImpl::print(WebCore::GraphicsContext* gc) { 741 void WebPluginImpl::print(WebCore::GraphicsContext* gc) {
739 if (gc->paintingDisabled()) 742 if (gc->paintingDisabled())
740 return; 743 return;
741 744
742 if (!parent()) 745 if (!parent())
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 client_index = clients_.erase(client_index); 1429 client_index = clients_.erase(client_index);
1427 if (resource_client) 1430 if (resource_client)
1428 resource_client->DidFail(); 1431 resource_client->DidFail();
1429 } 1432 }
1430 1433
1431 // This needs to be called now and not in the destructor since the 1434 // This needs to be called now and not in the destructor since the
1432 // webframe_ might not be valid anymore. 1435 // webframe_ might not be valid anymore.
1433 webframe_->set_plugin_delegate(NULL); 1436 webframe_->set_plugin_delegate(NULL);
1434 webframe_ = NULL; 1437 webframe_ = NULL;
1435 } 1438 }
OLDNEW
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698