Index: third_party/WebKit/WebCore/platform/graphics/chromium/IconChromium.cpp |
=================================================================== |
--- third_party/WebKit/WebCore/platform/graphics/chromium/IconChromium.cpp (revision 51395) |
+++ third_party/WebKit/WebCore/platform/graphics/chromium/IconChromium.cpp (working copy) |
@@ -31,42 +31,37 @@ |
#include "config.h" |
#include "Icon.h" |
-#include <windows.h> |
-#include <shellapi.h> |
- |
#include "GraphicsContext.h" |
-#include "PlatformContextSkia.h" |
#include "PlatformString.h" |
-#include "SkiaUtils.h" |
namespace WebCore { |
-Icon::Icon(const PlatformIcon& icon) |
+Icon::Icon(PassRefPtr<PlatformIcon> icon) |
: m_icon(icon) |
{ |
} |
Icon::~Icon() |
{ |
- if (m_icon) |
- DestroyIcon(m_icon); |
} |
+#if 0 |
PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames) |
{ |
- // FIXME: We can't access icons directly from renderer processes. |
- // http://code.google.com/p/chromium/issues/detail?id=4092 |
+ // It's hard to support for synchronous icon loading because of the sandbox. |
+ // Chrome::iconForFiles() will load icons asynchronously instead. |
return 0; |
} |
+#endif |
void Icon::paint(GraphicsContext* context, const IntRect& rect) |
{ |
if (context->paintingDisabled()) |
return; |
- HDC hdc = context->platformContext()->canvas()->beginPlatformPaint(); |
- DrawIconEx(hdc, rect.x(), rect.y(), m_icon, rect.width(), rect.height(), 0, 0, DI_NORMAL); |
- context->platformContext()->canvas()->endPlatformPaint(); |
+ // An Icon doesn't know the color space of the file upload control. |
+ // So use DeviceColorSpace. |
+ context->drawImage(m_icon.get(), DeviceColorSpace, rect); |
} |
} // namespace WebCore |