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 d7bac7f376fa5ca4ec0401e325af1bfb17944b1f..3eff43d63fdf5a1d93af5cf3c25950ec5f4a6ec3 100644 |
--- a/chrome/browser/web_applications/web_app_win.cc |
+++ b/chrome/browser/web_applications/web_app_win.cc |
@@ -18,6 +18,7 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/installer/launcher_support/chrome_launcher_support.h" |
#include "chrome/installer/util/browser_distribution.h" |
+#include "chrome/installer/util/install_util.h" |
#include "chrome/installer/util/util_constants.h" |
#include "content/public/browser/browser_thread.h" |
#include "ui/gfx/icon_util.h" |
@@ -168,7 +169,7 @@ bool CreatePlatformShortcuts( |
// Shortcut paths under which to create shortcuts. |
std::vector<base::FilePath> shortcut_paths = |
- GetShortcutPaths(creation_locations); |
+ GetShortcutPaths(creation_locations, ShellUtil::CURRENT_USER); |
bool pin_to_taskbar = creation_locations.in_quick_launch_bar && |
(base::win::GetVersion() >= base::win::VERSION_WIN7); |
@@ -292,8 +293,8 @@ void DeletePlatformShortcuts( |
all_shortcut_locations.in_applications_menu = true; |
all_shortcut_locations.in_quick_launch_bar = true; |
all_shortcut_locations.on_desktop = true; |
- std::vector<base::FilePath> shortcut_paths = GetShortcutPaths( |
- all_shortcut_locations); |
+ std::vector<base::FilePath> shortcut_paths = |
+ GetShortcutPaths(all_shortcut_locations, ShellUtil::CURRENT_USER); |
if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
shortcut_paths.push_back(web_app_path); |
@@ -313,44 +314,46 @@ void DeletePlatformShortcuts( |
} |
std::vector<base::FilePath> GetShortcutPaths( |
- const ShellIntegration::ShortcutLocations& creation_locations) { |
+ const ShellIntegration::ShortcutLocations& creation_locations, |
+ const ShellUtil::ShellChange install_level) { |
// Shortcut paths under which to create shortcuts. |
std::vector<base::FilePath> shortcut_paths; |
// Locations to add to shortcut_paths. |
struct { |
bool use_this_location; |
- int location_id; |
+ ShellUtil::ShortcutLocation location_id; |
const wchar_t* subdir; |
} locations[] = { |
{ |
creation_locations.on_desktop, |
- base::DIR_USER_DESKTOP, |
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, |
NULL |
}, { |
creation_locations.in_applications_menu, |
- base::DIR_START_MENU, |
+ ShellUtil::SHORTCUT_LOCATION_START_MENU, |
gab
2013/04/26 15:21:03
SHORTCUT_LOCATION_START_MENU_CHROME_DIR sounds goo
calamity
2013/04/29 07:20:05
mgiuca@ is making chrome app start menu shortcuts
|
creation_locations.applications_menu_subdir.empty() ? NULL : |
creation_locations.applications_menu_subdir.c_str() |
}, { |
- creation_locations.in_quick_launch_bar, |
- // For Win7, in_quick_launch_bar means pinning to taskbar. Use |
- // base::PATH_START as a flag for this case. |
- (base::win::GetVersion() >= base::win::VERSION_WIN7) ? |
- base::PATH_START : base::DIR_APP_DATA, |
- (base::win::GetVersion() >= base::win::VERSION_WIN7) ? |
- NULL : L"Microsoft\\Internet Explorer\\Quick Launch" |
+ // For Win7, in_quick_launch_bar means pinning to taskbar. This needs to |
gab
2013/04/26 15:21:03
I don't think that this comment is correct.
Quick
calamity
2013/04/29 07:20:05
Yes, in_quick_launch_bar is used as "pin to taskba
|
+ // be handled by callers. |
+ creation_locations.in_quick_launch_bar && |
+ base::win::GetVersion() < base::win::VERSION_WIN7, |
+ ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, |
+ NULL |
} |
}; |
+ |
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
// Populate shortcut_paths. |
for (int i = 0; i < arraysize(locations); ++i) { |
if (locations[i].use_this_location) { |
base::FilePath path; |
- // Skip the Win7 case. |
- if (locations[i].location_id == base::PATH_START) |
- continue; |
- |
- if (!PathService::Get(locations[i].location_id, &path)) { |
+ if (!ShellUtil::GetShortcutPath(locations[i].location_id, |
+ dist, |
+ install_level, |
+ &path)) { |
+ NOTREACHED(); |
continue; |
} |