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 98d9e2c5bc9ffbfbe77b4e4fb721508e1844ccc5..11d188069fcaab21b73baf28b127e60faea79923 100644 |
--- a/chrome/browser/web_applications/web_app_win.cc |
+++ b/chrome/browser/web_applications/web_app_win.cc |
@@ -17,6 +17,8 @@ |
#include "base/win/windows_version.h" |
#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/shell_util.h" |
#include "chrome/installer/util/util_constants.h" |
#include "content/public/browser/browser_thread.h" |
#include "ui/gfx/icon_util.h" |
@@ -283,8 +285,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); |
if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
shortcut_paths.push_back(web_app_path); |
@@ -310,38 +312,39 @@ std::vector<base::FilePath> GetShortcutPaths( |
// 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/29 21:34:44
This will already return the StartMenu/Google Chro
calamity
2013/04/30 08:11:28
Done.
|
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| indicates that we are pinning to |
+ // taskbar. This needs to 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, |
+ ShellUtil::CURRENT_USER, |
+ &path)) { |
+ NOTREACHED(); |
continue; |
} |