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

Unified Diff: third_party/WebKit/WebCore/platform/graphics/chromium/IconChromium.cpp

Issue 174318: Introduce new async IPC message to get file icons (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698