summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 00:25:01 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 00:25:01 +0000
commit498d7d1f63ebb3585d3d2273e2925c6ef852d6d3 (patch)
treeb4b38dafe832d65d83904cb9b969883717a9b358 /views
parentf4b0e873a3515ad6fb48667275797be9f49209a1 (diff)
downloadchromium_src-498d7d1f63ebb3585d3d2273e2925c6ef852d6d3.zip
chromium_src-498d7d1f63ebb3585d3d2273e2925c6ef852d6d3.tar.gz
chromium_src-498d7d1f63ebb3585d3d2273e2925c6ef852d6d3.tar.bz2
Use FilePath::BaseName instead of the deprecated file_util::GetFilenameFromPath.
BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/6070008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/drag_utils.cc5
-rw-r--r--views/drag_utils.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/views/drag_utils.cc b/views/drag_utils.cc
index 0579ba5..8c00edf 100644
--- a/views/drag_utils.cc
+++ b/views/drag_utils.cc
@@ -53,7 +53,7 @@ void SetURLAndDragImage(const GURL& url,
gfx::Point(prefsize.width() / 2, prefsize.height() / 2), data);
}
-void CreateDragImageForFile(const FilePath::StringType& file_name,
+void CreateDragImageForFile(const FilePath& file_name,
SkBitmap* icon,
OSExchangeData* data_object) {
DCHECK(icon);
@@ -72,15 +72,14 @@ void CreateDragImageForFile(const FilePath::StringType& file_name,
// Paint the icon.
canvas.DrawBitmapInt(*icon, (width - icon->width()) / 2, 0);
+ std::wstring name = file_name.BaseName().ToWStringHack();
#if defined(OS_WIN)
// 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.GetHeight(),
gfx::Canvas::TEXT_ALIGN_CENTER);
#else
- std::wstring name = FilePath(file_name).BaseName().ToWStringHack();
canvas.DrawStringInt(name, font, kFileDragImageTextColor,
0, icon->height() + kLinkDragImageVPadding,
width, font.GetHeight(), gfx::Canvas::TEXT_ALIGN_CENTER);
diff --git a/views/drag_utils.h b/views/drag_utils.h
index 4418504..a8dba30 100644
--- a/views/drag_utils.h
+++ b/views/drag_utils.h
@@ -32,7 +32,7 @@ void SetURLAndDragImage(const GURL& url,
// Chrome (via the download manager, for example). The drag image is set into
// the supplied data_object. 'file_name' can be a full path, but the directory
// portion will be truncated in the drag image.
-void CreateDragImageForFile(const FilePath::StringType& file_name,
+void CreateDragImageForFile(const FilePath& file_name,
SkBitmap* icon,
OSExchangeData* data_object);