Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: chrome/browser/web_applications/web_app_win.cc

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: rebase, move app launcher and chrome app strings into the installer Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f101f6996d15d73898d206f72288402923399f91..1456528abeafa174a4ad6756a454d8157d1d6aba 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -18,6 +18,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"
@@ -294,16 +296,15 @@ void DeletePlatformShortcuts(
// Get all possible locations for shortcuts.
ShellIntegration::ShortcutLocations all_shortcut_locations;
- all_shortcut_locations.in_applications_menu = true;
all_shortcut_locations.in_quick_launch_bar = true;
all_shortcut_locations.on_desktop = true;
// Delete shortcuts from the Chrome Apps subdirectory.
// This matches the subdir name set by CreateApplicationShortcutView::Accept
// for Chrome apps (not URL apps, but this function does not apply for them).
+ all_shortcut_locations.in_applications_menu_chrome_apps_subdir = true;
string16 start_menu_subdir = GetAppShortcutsSubdirName();
Matt Giuca 2013/05/15 05:19:45 Move this line below to line 325 (start_menu_subdi
gab 2013/05/15 21:26:38 In fact delete this line (see comment below).
calamity 2013/08/27 07:59:35 Done.
- all_shortcut_locations.applications_menu_subdir = start_menu_subdir;
- 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);
@@ -337,43 +338,43 @@ std::vector<base::FilePath> GetShortcutPaths(
// Locations to add to shortcut_paths.
struct {
bool use_this_location;
- int location_id;
- const wchar_t* subdir;
+ ShellUtil::ShortcutLocation location_id;
} locations[] = {
{
creation_locations.on_desktop,
- base::DIR_USER_DESKTOP,
- NULL
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP
}, {
creation_locations.in_applications_menu,
- base::DIR_START_MENU,
- creation_locations.applications_menu_subdir.empty() ? NULL :
- creation_locations.applications_menu_subdir.c_str()
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT
+ }, {
+ creation_locations.in_applications_menu_chrome_subdir,
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR,
+ }, {
+ creation_locations.in_applications_menu_chrome_apps_subdir,
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR,
}, {
- 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
}
};
+
+ 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;
}
- if (locations[i].subdir != NULL)
- path = path.Append(locations[i].subdir);
shortcut_paths.push_back(path);
}
}

Powered by Google App Engine
This is Rietveld 408576698