Index: chrome/browser/web_applications/web_app_win.cc |
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc |
index 9e3c5ee255a0743155f2e3cb85ad95d99150d60b..094c959931b2ceb48cea27dd5326891ed5e33078 100644 |
--- a/chrome/browser/web_applications/web_app_win.cc |
+++ b/chrome/browser/web_applications/web_app_win.cc |
@@ -137,7 +137,8 @@ std::vector<base::FilePath> MatchingShortcutsForProfileAndExtension( |
bool CreateShortcutsInPaths( |
const base::FilePath& web_app_path, |
const ShellIntegration::ShortcutInfo& shortcut_info, |
- const std::vector<base::FilePath>& shortcut_paths) { |
+ const std::vector<base::FilePath>& shortcut_paths, |
+ std::vector<base::FilePath>* out_filenames) { |
// Ensure web_app_path exists. |
if (!file_util::PathExists(web_app_path) && |
!file_util::CreateDirectory(web_app_path)) { |
@@ -215,6 +216,8 @@ bool CreateShortcutsInPaths( |
success = base::win::CreateOrUpdateShortcutLink( |
shortcut_file, shortcut_properties, |
base::win::SHORTCUT_CREATE_ALWAYS) && success; |
+ if (out_filenames) |
+ out_filenames->push_back(shortcut_file); |
} |
return success; |
@@ -286,6 +289,17 @@ void GetShortcutLocationsAndDeleteShortcuts( |
namespace web_app { |
+base::FilePath CreateShortcutInWebAppDir( |
+ const base::FilePath& web_app_dir, |
+ const ShellIntegration::ShortcutInfo& shortcut_info) { |
+ std::vector<base::FilePath> paths; |
+ paths.push_back(web_app_dir); |
+ std::vector<base::FilePath> out_filenames; |
+ CreateShortcutsInPaths(web_app_dir, shortcut_info, paths, &out_filenames); |
+ DCHECK_EQ(out_filenames.size(), 1u); |
+ return out_filenames[0]; |
+} |
+ |
namespace internals { |
// Saves |image| to |icon_file| if the file is outdated and refresh shell's |
@@ -331,7 +345,8 @@ bool CreatePlatformShortcuts( |
if (shortcut_paths.empty()) |
return false; |
- if (!CreateShortcutsInPaths(web_app_path, shortcut_info, shortcut_paths)) |
+ if (!CreateShortcutsInPaths(web_app_path, shortcut_info, shortcut_paths, |
+ NULL)) |
return false; |
if (pin_to_taskbar) { |
@@ -367,7 +382,7 @@ void UpdatePlatformShortcuts( |
GetShortcutLocationsAndDeleteShortcuts( |
web_app_path, shortcut_info.profile_path, old_app_title, |
&was_pinned_to_taskbar, &shortcut_paths); |
- CreateShortcutsInPaths(web_app_path, shortcut_info, shortcut_paths); |
+ CreateShortcutsInPaths(web_app_path, shortcut_info, shortcut_paths, NULL); |
// If the shortcut was pinned to the taskbar, |
// GetShortcutLocationsAndDeleteShortcuts will have deleted it. In that |
// case, re-pin it. |