summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:16:55 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:16:55 +0000
commitb2721b0739bae858df9758e0c2046b267c8e7112 (patch)
tree7741e204bbb40a20570a8276d9823b2bc121c137 /chrome/installer/util
parent35601c5500d4e69dfdcefb091cb72a8f55cb8b98 (diff)
downloadchromium_src-b2721b0739bae858df9758e0c2046b267c8e7112.zip
chromium_src-b2721b0739bae858df9758e0c2046b267c8e7112.tar.gz
chromium_src-b2721b0739bae858df9758e0c2046b267c8e7112.tar.bz2
Delete Chrome's secondary tiles on Windows 8 when uninstalling.
The Windows secondary tiles deletion functions are only available to Chrome itself when running in metro mode. To get around this, the folder containing the installation's secondarty tiles is removed entirely. BUG=140559 Review URL: https://chromiumcodereview.appspot.com/10876057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/shell_util.cc27
-rw-r--r--chrome/installer/util/shell_util.h4
2 files changed, 31 insertions, 0 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 37ed8c2..69fd7aa 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1626,6 +1626,33 @@ bool ShellUtil::RemoveChromeQuickLaunchShortcut(BrowserDistribution* dist,
return ret;
}
+void ShellUtil::RemoveChromeStartScreenShortcuts(BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ return;
+
+ FilePath app_shortcuts_path;
+ if (!PathService::Get(base::DIR_APP_SHORTCUTS, &app_shortcuts_path)) {
+ LOG(ERROR) << "Could not get application shortcuts location to delete"
+ << " start screen shortcuts.";
+ return;
+ }
+
+ app_shortcuts_path = app_shortcuts_path.Append(
+ GetBrowserModelId(dist, chrome_exe));
+ if (!file_util::DirectoryExists(app_shortcuts_path)) {
+ VLOG(1) << "No start screen shortcuts to delete.";
+ return;
+ }
+
+ VLOG(1) << "Removing start screen shortcuts from "
+ << app_shortcuts_path.value();
+ if (!file_util::Delete(app_shortcuts_path, true)) {
+ LOG(ERROR) << "Failed to remove start screen shortcuts from "
+ << app_shortcuts_path.value();
+ }
+}
+
bool ShellUtil::UpdateChromeShortcut(BrowserDistribution* dist,
const string16& chrome_exe,
const string16& shortcut,
diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h
index 1f8cab8..bc3bf8a 100644
--- a/chrome/installer/util/shell_util.h
+++ b/chrome/installer/util/shell_util.h
@@ -391,6 +391,10 @@ class ShellUtil {
static bool RemoveChromeQuickLaunchShortcut(BrowserDistribution* dist,
int shell_change);
+ // This will remove all secondary tiles from the start screen for |dist|.
+ static void RemoveChromeStartScreenShortcuts(BrowserDistribution* dist,
+ const string16& chrome_exe);
+
enum ChromeShortcutOptions {
SHORTCUT_NO_OPTIONS = 0,
// Set DualMode property for Windows 8 Metro-enabled shortcuts.