Remove uses of deprecated version of FileUtil::ResolveShortcut.
BUG=None
TEST=run base_unittests.exe
Review URL: http://codereview.chromium.org/173181
Patch from Thiago Farina <thiago.farina@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24208 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: fd061a6017827421b66782eb576b480b939627e3
diff --git a/base/file_util.h b/base/file_util.h
index 1c1a79f..cbca470 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -229,11 +229,10 @@
#if defined(OS_WIN)
// Resolve Windows shortcut (.LNK file)
-// Argument path specifies a valid LNK file. On success, return true and put
-// the URL into path. If path is a invalid .LNK file, return false.
+// This methods tries to resolve a shortcut .LNK file. If the |path| is valid
+// returns true and puts the target into the |path|, otherwise returns
+// false leaving the path as it is.
bool ResolveShortcut(FilePath* path);
-// Deprecated temporary compatibility function.
-bool ResolveShortcut(std::wstring* path);
// Create a Windows shortcut (.LNK file)
// This method creates a shortcut link using the information given. Ensure
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index b1f7822..cf9dda1 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -712,16 +712,15 @@
shell->Release();
bool is_solved;
- std::wstring link_file_str = link_file.value();
- is_solved = file_util::ResolveShortcut(&link_file_str);
+ is_solved = file_util::ResolveShortcut(&link_file);
EXPECT_TRUE(is_solved);
std::wstring contents;
- contents = ReadTextFile(FilePath(link_file_str));
+ contents = ReadTextFile(link_file);
EXPECT_EQ(L"This is the target.", contents);
// Cleaning
DeleteFile(target_file.value().c_str());
- DeleteFile(link_file_str.c_str());
+ DeleteFile(link_file.value().c_str());
CoUninitialize();
}
@@ -736,9 +735,9 @@
EXPECT_TRUE(file_util::CreateShortcutLink(target_file.value().c_str(),
link_file.value().c_str(),
NULL, NULL, NULL, NULL, 0));
- std::wstring resolved_name = link_file.value();
+ FilePath resolved_name = link_file;
EXPECT_TRUE(file_util::ResolveShortcut(&resolved_name));
- std::wstring read_contents = ReadTextFile(FilePath(resolved_name));
+ std::wstring read_contents = ReadTextFile(resolved_name);
EXPECT_EQ(file_contents, read_contents);
DeleteFile(target_file.value().c_str());