| 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 "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <atlbase.h> | 10 #include <atlbase.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "app/gfx/chrome_canvas.h" | 13 #include "app/gfx/canvas.h" |
| 14 #include "app/l10n_util.h" | 14 #include "app/l10n_util.h" |
| 15 #include "app/resource_bundle.h" | 15 #include "app/resource_bundle.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 19 #include "base/gfx/size.h" | 19 #include "base/gfx/size.h" |
| 20 #include "base/gfx/native_widget_types.h" | 20 #include "base/gfx/native_widget_types.h" |
| 21 #include "chrome/app/chrome_dll_resource.h" | 21 #include "chrome/app/chrome_dll_resource.h" |
| 22 #include "chrome/common/plugin_messages.h" | 22 #include "chrome/common/plugin_messages.h" |
| 23 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 void WebPluginDelegateProxy::OnGetCPBrowsingContext(uint32* context) { | 734 void WebPluginDelegateProxy::OnGetCPBrowsingContext(uint32* context) { |
| 735 *context = render_view_ ? render_view_->GetCPBrowsingContext() : 0; | 735 *context = render_view_ ? render_view_->GetCPBrowsingContext() : 0; |
| 736 } | 736 } |
| 737 | 737 |
| 738 void WebPluginDelegateProxy::PaintSadPlugin(gfx::NativeDrawingContext hdc, | 738 void WebPluginDelegateProxy::PaintSadPlugin(gfx::NativeDrawingContext hdc, |
| 739 const gfx::Rect& rect) { | 739 const gfx::Rect& rect) { |
| 740 #if defined(OS_WIN) | 740 #if defined(OS_WIN) |
| 741 const int width = plugin_rect_.width(); | 741 const int width = plugin_rect_.width(); |
| 742 const int height = plugin_rect_.height(); | 742 const int height = plugin_rect_.height(); |
| 743 | 743 |
| 744 ChromeCanvas canvas(width, height, false); | 744 gfx::Canvas canvas(width, height, false); |
| 745 SkPaint paint; | 745 SkPaint paint; |
| 746 | 746 |
| 747 paint.setStyle(SkPaint::kFill_Style); | 747 paint.setStyle(SkPaint::kFill_Style); |
| 748 paint.setColor(SK_ColorBLACK); | 748 paint.setColor(SK_ColorBLACK); |
| 749 canvas.drawRectCoords(0, 0, SkIntToScalar(width), SkIntToScalar(height), | 749 canvas.drawRectCoords(0, 0, SkIntToScalar(width), SkIntToScalar(height), |
| 750 paint); | 750 paint); |
| 751 | 751 |
| 752 if (!sad_plugin_) { | 752 if (!sad_plugin_) { |
| 753 sad_plugin_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 753 sad_plugin_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 754 IDR_SAD_PLUGIN); | 754 IDR_SAD_PLUGIN); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 plugin_->CancelDocumentLoad(); | 824 plugin_->CancelDocumentLoad(); |
| 825 } | 825 } |
| 826 | 826 |
| 827 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 827 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 828 const std::string& url, const std::string& range_info, | 828 const std::string& url, const std::string& range_info, |
| 829 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 829 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
| 830 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 830 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 831 existing_stream, notify_needed, | 831 existing_stream, notify_needed, |
| 832 notify_data); | 832 notify_data); |
| 833 } | 833 } |
| OLD | NEW |