summaryrefslogtreecommitdiffstats
path: root/views/drag_utils.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 21:42:58 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 21:42:58 +0000
commitb6d432335f59500e092de2be4fcf42ed303ae1c5 (patch)
tree0dae24ec6c0f89442ee37d18aeb17f5dcf48d6e0 /views/drag_utils.cc
parent599ea9fd7f5f029661916c191ff89b7358719f81 (diff)
downloadchromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.zip
chromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.tar.gz
chromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.tar.bz2
Implements file contents support in OSExchangeData and DropTarget
for gtk. Makes html and file contents support in OSExchangeData only for windows (as that is the only place we need it), and makes dragging files work. BUG=none TEST=none Review URL: http://codereview.chromium.org/232002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/drag_utils.cc')
-rw-r--r--views/drag_utils.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/views/drag_utils.cc b/views/drag_utils.cc
index 7ba6a86..f1d9717 100644
--- a/views/drag_utils.cc
+++ b/views/drag_utils.cc
@@ -55,7 +55,7 @@ void SetURLAndDragImage(const GURL& url,
data);
}
-void CreateDragImageForFile(const std::wstring& file_name,
+void CreateDragImageForFile(const FilePath::StringType& file_name,
SkBitmap* icon,
OSExchangeData* data_object) {
DCHECK(icon);
@@ -74,15 +74,18 @@ void CreateDragImageForFile(const std::wstring& file_name,
// Paint the icon.
canvas.DrawBitmapInt(*icon, (width - icon->width()) / 2, 0);
- // Paint the file name. We inset it one pixel to allow room for the halo.
#if defined(OS_WIN)
- const std::wstring& name = file_util::GetFilenameFromPath(file_name);
+ // Paint the file name. We inset it one pixel to allow room for the halo.
+ std::wstring name = file_util::GetFilenameFromPath(file_name);
canvas.DrawStringWithHalo(name, font, kFileDragImageTextColor, SK_ColorWHITE,
1, icon->height() + kLinkDragImageVPadding + 1,
width - 2, font.height(),
gfx::Canvas::TEXT_ALIGN_CENTER);
#else
- NOTIMPLEMENTED();
+ std::wstring name = file_util::GetFilenameFromPath(UTF8ToWide(file_name));
+ canvas.DrawStringInt(name, font, kFileDragImageTextColor,
+ 0, icon->height() + kLinkDragImageVPadding,
+ width, font.height(), gfx::Canvas::TEXT_ALIGN_CENTER);
#endif
SetDragImageOnDataObject(canvas, width, height, width / 2,