summaryrefslogtreecommitdiffstats
path: root/chromium/base/win/shortcut.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/base/win/shortcut.cc')
-rw-r--r--chromium/base/win/shortcut.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/chromium/base/win/shortcut.cc b/chromium/base/win/shortcut.cc
index 289f5e6ec14..5d9f102778b 100644
--- a/chromium/base/win/shortcut.cc
+++ b/chromium/base/win/shortcut.cc
@@ -115,7 +115,7 @@ bool CreateOrUpdateShortcutLink(const FilePath& shortcut_path,
}
if (properties.options & ShortcutProperties::PROPERTIES_ARGUMENTS) {
- if (FAILED(i_shell_link->SetArguments(as_wcstr(properties.arguments))))
+ if (FAILED(i_shell_link->SetArguments(properties.arguments.c_str())))
return false;
} else if (old_i_persist_file.Get()) {
wchar_t current_arguments[MAX_PATH] = {0};
@@ -126,7 +126,7 @@ bool CreateOrUpdateShortcutLink(const FilePath& shortcut_path,
}
if ((properties.options & ShortcutProperties::PROPERTIES_DESCRIPTION) &&
- FAILED(i_shell_link->SetDescription(as_wcstr(properties.description)))) {
+ FAILED(i_shell_link->SetDescription(properties.description.c_str()))) {
return false;
}
@@ -225,42 +225,39 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
// Reset |properties|.
properties->options = 0;
- char16 temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
if (options & ShortcutProperties::PROPERTIES_TARGET) {
- if (FAILED(i_shell_link->GetPath(as_writable_wcstr(temp), MAX_PATH, NULL,
- SLGP_UNCPRIORITY))) {
+ if (FAILED(i_shell_link->GetPath(temp, MAX_PATH, NULL, SLGP_UNCPRIORITY))) {
return false;
}
- properties->set_target(FilePath(temp));
+ properties->set_target(FilePath(AsStringPiece16(temp)));
}
if (options & ShortcutProperties::PROPERTIES_WORKING_DIR) {
- if (FAILED(i_shell_link->GetWorkingDirectory(as_writable_wcstr(temp),
- MAX_PATH)))
+ if (FAILED(i_shell_link->GetWorkingDirectory(temp, MAX_PATH)))
return false;
- properties->set_working_dir(FilePath(temp));
+ properties->set_working_dir(FilePath(AsStringPiece16(temp)));
}
if (options & ShortcutProperties::PROPERTIES_ARGUMENTS) {
- if (FAILED(i_shell_link->GetArguments(as_writable_wcstr(temp), MAX_PATH)))
+ if (FAILED(i_shell_link->GetArguments(temp, MAX_PATH)))
return false;
properties->set_arguments(temp);
}
if (options & ShortcutProperties::PROPERTIES_DESCRIPTION) {
// Note: description length constrained by MAX_PATH.
- if (FAILED(i_shell_link->GetDescription(as_writable_wcstr(temp), MAX_PATH)))
+ if (FAILED(i_shell_link->GetDescription(temp, MAX_PATH)))
return false;
properties->set_description(temp);
}
if (options & ShortcutProperties::PROPERTIES_ICON) {
int temp_index;
- if (FAILED(i_shell_link->GetIconLocation(as_writable_wcstr(temp), MAX_PATH,
- &temp_index))) {
+ if (FAILED(i_shell_link->GetIconLocation(temp, MAX_PATH, &temp_index))) {
return false;
}
- properties->set_icon(FilePath(temp), temp_index);
+ properties->set_icon(FilePath(AsStringPiece16(temp)), temp_index);
}
if (options & (ShortcutProperties::PROPERTIES_APP_ID |
@@ -278,10 +275,10 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
}
switch (pv_app_id.get().vt) {
case VT_EMPTY:
- properties->set_app_id(string16());
+ properties->set_app_id(std::wstring());
break;
case VT_LPWSTR:
- properties->set_app_id(WideToUTF16(pv_app_id.get().pwszVal));
+ properties->set_app_id(pv_app_id.get().pwszVal);
break;
default:
NOTREACHED() << "Unexpected variant type: " << pv_app_id.get().vt;
@@ -336,7 +333,7 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
bool ResolveShortcut(const FilePath& shortcut_path,
FilePath* target_path,
- string16* args) {
+ std::wstring* args) {
uint32_t options = 0;
if (target_path)
options |= ShortcutProperties::PROPERTIES_TARGET;