diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 22:23:12 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 22:23:12 +0000 |
commit | e99ee9cd37864004d9f98f3880405fc651f29b58 (patch) | |
tree | e8d93e091efd2db0006ca5a8928d220a0343ab19 | |
parent | 4b200875a6d0bef1ddf58bf05247f819da7243ae (diff) | |
download | chromium_src-e99ee9cd37864004d9f98f3880405fc651f29b58.zip chromium_src-e99ee9cd37864004d9f98f3880405fc651f29b58.tar.gz chromium_src-e99ee9cd37864004d9f98f3880405fc651f29b58.tar.bz2 |
Revert 165505 - Introduce RemoveChromeTaskbarShortcuts() to delete all pinned-to-taskbar shortcuts owned by the uninstalled Chrome.
TBR=brettw@chromium.org
BUG=158632
TEST=No user-level shortcut Chrome left behind in taskbar post user-level self-destruct.
Review URL: https://chromiumcodereview.appspot.com/11361015
TBR=gab@chromium.org
Review URL: https://codereview.chromium.org/11366047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165524 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base_paths_win.cc | 6 | ||||
-rw-r--r-- | base/base_paths_win.h | 2 | ||||
-rw-r--r-- | chrome/browser/shell_integration_win.cc | 4 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 7 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 28 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.h | 7 |
6 files changed, 2 insertions, 52 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc index a06d908..58c3ea5 100644 --- a/base/base_paths_win.cc +++ b/base/base_paths_win.cc @@ -192,12 +192,6 @@ bool PathProviderWin(int key, FilePath* result) { if (!GetQuickLaunchPath(true, &cur)) return false; break; - case base::DIR_TASKBAR_PINS: - if (!PathService::Get(base::DIR_USER_QUICK_LAUNCH, &cur)) - return false; - cur = cur.AppendASCII("User Pinned"); - cur = cur.AppendASCII("TaskBar"); - break; default: return false; } diff --git a/base/base_paths_win.h b/base/base_paths_win.h index 11bc111..6cbcb2c 100644 --- a/base/base_paths_win.h +++ b/base/base_paths_win.h @@ -40,8 +40,6 @@ enum { DIR_USER_QUICK_LAUNCH, // Directory for the quick launch shortcuts. DIR_DEFAULT_USER_QUICK_LAUNCH, // Directory for the quick launch shortcuts // of the Default user. - DIR_TASKBAR_PINS, // Directory for the shortcuts pinned to taskbar via - // base::win::TaskbarPinShortcutLink(). PATH_WIN_END }; diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index b5e7d56..874faaa 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -209,8 +209,8 @@ void MigrateChromiumShortcutsCallback() { const wchar_t* sub_dir; } kLocations[] = { { - base::DIR_TASKBAR_PINS, - NULL + base::DIR_APP_DATA, + L"Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar" }, { base::DIR_USER_DESKTOP, NULL diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 5c6e6c5..2fb193b 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -307,13 +307,6 @@ void DeleteChromeShortcuts(const InstallerState& installer_state, LOG(WARNING) << "Failed to delete Start Menu shortcuts."; } - // Although the shortcut removal calls above will unpin their shortcut if they - // result in a deletion (i.e. shortcut existed and pointed to |chrome_exe|), - // it is possible for shortcuts to remain pinned while their parent shortcut - // has been deleted or changed to point to another |chrome_exe|. Make sure all - // pinned-to-taskbar shortcuts that point to |chrome_exe| are unpinned. - ShellUtil::RemoveChromeTaskbarShortcuts(chrome_exe); - ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), chrome_exe); } diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 943a07d..6891fcd 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -1847,34 +1847,6 @@ bool ShellUtil::RemoveChromeShortcut( return true; } -void ShellUtil::RemoveChromeTaskbarShortcuts(const string16& chrome_exe) { - FilePath taskbar_pins_path; - if (!PathService::Get(base::DIR_TASKBAR_PINS, &taskbar_pins_path) || - !file_util::PathExists(taskbar_pins_path)) { - LOG(ERROR) << "Couldn't find path to taskbar pins."; - return; - } - - file_util::FileEnumerator shortcuts_enum( - taskbar_pins_path, false, - file_util::FileEnumerator::FILES, FILE_PATH_LITERAL("*.lnk")); - - FilePath chrome_path(chrome_exe); - InstallUtil::ProgramCompare chrome_compare(chrome_path); - for (FilePath shortcut_path = shortcuts_enum.Next(); !shortcut_path.empty(); - shortcut_path = shortcuts_enum.Next()) { - FilePath read_target; - if (!base::win::ResolveShortcut(shortcut_path, &read_target, NULL)) { - NOTREACHED(); - continue; - } - if (chrome_compare.Evaluate(read_target.value())) { - // Unpin this shortcut if it points to |chrome_exe|. - base::win::TaskbarUnpinShortcutLink(shortcut_path.value().c_str()); - } - } -} - void ShellUtil::RemoveChromeStartScreenShortcuts(BrowserDistribution* dist, const string16& chrome_exe) { if (base::win::GetVersion() < base::win::VERSION_WIN8) diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h index 5a4786c..4e121c5 100644 --- a/chrome/installer/util/shell_util.h +++ b/chrome/installer/util/shell_util.h @@ -515,13 +515,6 @@ class ShellUtil { ShellChange level, const string16* shortcut_name); - // Enumerates all shortcuts pinned to the taskbar and deletes those pointing - // to |chrome_exe|. - // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is - // useful on uninstall as the parent shortcut of a pin might no longer exist - // (thus making it impossible to unpin it via that API). - static void RemoveChromeTaskbarShortcuts(const string16& chrome_exe); - // This will remove all secondary tiles from the start screen for |dist|. static void RemoveChromeStartScreenShortcuts(BrowserDistribution* dist, const string16& chrome_exe); |