From 79ca2d37ebc83fdd4fefa49389e490e8fbb3ce58 Mon Sep 17 00:00:00 2001 From: "gab@chromium.org" Date: Fri, 4 Jan 2013 23:28:05 +0000 Subject: [Fixit-Dec-2012] Also add dual_mode to Start Menu shortcuts in MigrateChromiumShortcuts. Restructured this code quite a bit to use the new shortcut magic. Added tests which turned out to expose edge cases that I think weren't covered by the previous implementation (i.e. would potentially update shortcuts when unecessary -- flashing the desktop in the process -- or not do it when necessary). BUG=142980 TEST=Pin Desktop shortcut to Start Screen or pin chrome.exe directly to the start screen via context menu. Notice that there are now multiple shortcuts of Chrome (non-tiled; 1 for each "Pin to Start" action; upon launching Chrome those should all be merged down to one Chrome tile shortcut (not on the file system, but visually on the Start Screen itself). Note: if you do try this; there is an intentional 15s delay before the migration kicks in to avoid delaying Chrome startup; so be patient, it will work ;)! Review URL: https://chromiumcodereview.appspot.com/11712003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175230 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/shell_integration.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/browser/shell_integration.h') diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h index d230c1b..10a33dc 100644 --- a/chrome/browser/shell_integration.h +++ b/chrome/browser/shell_integration.h @@ -156,6 +156,17 @@ class ShellIntegration { // see http://crbug.com/28104 static void MigrateChromiumShortcuts(); + // Migrates all shortcuts in |path| which point to |chrome_exe| such that they + // have the appropriate AppUserModelId. Also makes sure those shortcuts have + // the dual_mode property set if such is requested by |check_dual_mode|. + // Returns the number of shortcuts migrated. + // This method should not be called prior to Windows 7. + // This method is only public for the sake of tests and shouldn't be called + // externally otherwise. + static int MigrateShortcutsInPathInternal(const FilePath& chrome_exe, + const FilePath& path, + bool check_dual_mode); + // Returns the path to the Start Menu shortcut for the given Chrome. static FilePath GetStartMenuShortcut(const FilePath& chrome_exe); #endif // defined(OS_WIN) -- cgit v1.1