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

Issue 10836247: Refactor ShellUtil shortcut code -- single multi-purpose methods as opposed to many slighlty diffe… (Closed)

Created:
8 years, 4 months ago by gab
Modified:
8 years, 2 months ago
CC:
chromium-reviews, erikwright (departed), grt+watch_chromium.org, brettw-cc_chromium.org, grt (UTC plus 2), Halli, bcwhite
Visibility:
Public.

Description

Refactor ShellUtil shortcut code -- single multi-purpose methods as opposed to many slighlty different methods. Merge Quick Launch + Desktop logic into same call and add start menu shortcut logic in the mix too. Make properties based API (like the one introduced in base/win/shortcut.h) with default values to simplify call sites who just want to create a basic Chrome shortcut. shell_util.h: (CreateChromeDesktopShortcut, CreateChromeQuickLaunchShortcut, UpdateChromeShortcut) => CreateOrUpdateChromeShortcut (GetDesktopPath, GetQuickLaunchPath) => GetShortcutPath (GetChromeShortcutName) => ChromeShortcutProperties::set_shortcut_name() (i.e. default name is GetAppShortcutName() unless set otherwise... special profile shortcut appending logic moved to ProfileShortcutManager::GetShortcutNameForProfile). (RemoveChromeDesktopShortcut, RemoveChromeDesktopShortcutsWithAppendedNames) => RemoveChromeShortcut install.h: (CreateOrUpdateStartMenuAndTaskbarShortcuts, CreateOrUpdateDesktopAndQuickLaunchShortcuts) => CreateOrUpdateShortcuts (and incorporate some of the logic previously handled directly in InstallOrUpdateProduct()). Finally thoroughly tests shell_util and install shortcut methods! BUG=148539 TEST=Install chrome at user and system level with and without create_all_shortcuts master pref and make sure it works as intended in all scenarios. installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest* setup_unittests.exe --gtest_filter=InstallShortcutTest* unit_tests.exe --gtest_filter=ProfileShortcutManagerTest* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=160284

Patch Set 1 : #

Patch Set 2 : fix some comments #

Total comments: 5

Patch Set 3 : add comments to enums #

Patch Set 4 : Fix shell_util_unittests.cc #

Total comments: 4

Patch Set 5 : brand new shell_util shortcut API + TESTS :)! #

Total comments: 36

Patch Set 6 : adress comments about shell_util interface #

Total comments: 18

Patch Set 7 : robert is the king of pool #

Total comments: 6

Patch Set 8 : hazzzzers #

Patch Set 9 : respect microsoft's definition of correct C++ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1281 lines, -873 lines) Patch
M chrome/browser/chrome_browser_main_win.cc View 1 2 3 4 5 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/first_run/first_run_win.cc View 1 2 3 4 5 6 2 chunks +12 lines, -15 lines 0 comments Download
M chrome/browser/profiles/profile_shortcut_manager.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_shortcut_manager_stub.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc View 1 2 3 4 5 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/profiles/profile_shortcut_manager_win.cc View 1 2 3 4 5 6 chunks +45 lines, -42 lines 0 comments Download
M chrome/browser/shell_integration_win.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/installer/setup/install.h View 1 2 3 4 2 chunks +22 lines, -29 lines 0 comments Download
M chrome/installer/setup/install.cc View 1 2 3 4 5 6 7 6 chunks +177 lines, -142 lines 0 comments Download
M chrome/installer/setup/install_unittest.cc View 1 2 3 4 5 3 chunks +283 lines, -0 lines 0 comments Download
M chrome/installer/setup/install_worker.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/setup/uninstall.cc View 1 2 3 4 5 1 chunk +26 lines, -40 lines 0 comments Download
M chrome/installer/util/shell_util.h View 1 2 3 4 5 6 7 8 5 chunks +186 lines, -121 lines 0 comments Download
M chrome/installer/util/shell_util.cc View 1 2 3 4 5 6 7 6 chunks +197 lines, -229 lines 0 comments Download
M chrome/installer/util/shell_util_unittest.cc View 1 2 3 4 5 6 7 3 chunks +309 lines, -244 lines 0 comments Download
M chrome/installer/util/util_constants.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/installer/util/util_constants.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
gab
Here are the code changes, I'll follow up with the test adjustments in this CL, ...
8 years, 4 months ago (2012-08-17 20:53:24 UTC) #1
gab
Uploaded test changes. I'll make another CL for the much needed file_util shortcut test upgrade.
8 years, 4 months ago (2012-08-21 21:48:32 UTC) #2
robertshield
Did a quick pass through for style and such. The shortcut creation scenarios are complicated ...
8 years, 4 months ago (2012-08-22 21:39:06 UTC) #3
gab
Applied your comments and some more over 8 CLs :), see http://crbug.com/148539. PTAL, this now ...
8 years, 2 months ago (2012-10-02 02:44:58 UTC) #4
gab
Updated CL description for guidance in your review. Thanks! Gab
8 years, 2 months ago (2012-10-02 03:46:21 UTC) #5
robertshield
Just a couple of comments from a quick pass, will do a more thorough review ...
8 years, 2 months ago (2012-10-02 13:08:03 UTC) #6
grt (UTC plus 2)
very preliminary drive-by part 1. http://codereview.chromium.org/10836247/diff/23001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): http://codereview.chromium.org/10836247/diff/23001/chrome/installer/util/shell_util.cc#newcode955 chrome/installer/util/shell_util.cc:955: static const wchar_t lnk_ext[] ...
8 years, 2 months ago (2012-10-02 13:22:30 UTC) #7
gab
Comments addressed -- PTAL. Thanks! Gab http://codereview.chromium.org/10836247/diff/23001/chrome/browser/chrome_browser_main_win.cc File chrome/browser/chrome_browser_main_win.cc (right): http://codereview.chromium.org/10836247/diff/23001/chrome/browser/chrome_browser_main_win.cc#newcode132 chrome/browser/chrome_browser_main_win.cc:132: ShellUtil::ChromeShortcutProperties default_properties; On ...
8 years, 2 months ago (2012-10-03 15:14:59 UTC) #8
robertshield
Looking really good. I like this a lot better than what we had before. A ...
8 years, 2 months ago (2012-10-04 00:25:23 UTC) #9
gab
Thanks! PTAL http://codereview.chromium.org/10836247/diff/30001/chrome/browser/first_run/first_run_win.cc File chrome/browser/first_run/first_run_win.cc (right): http://codereview.chromium.org/10836247/diff/30001/chrome/browser/first_run/first_run_win.cc#newcode114 chrome/browser/first_run/first_run_win.cc:114: ShellUtil::ChromeShortcutProperties properties(ShellUtil::CURRENT_USER); On 2012/10/04 00:25:23, robertshield wrote: ...
8 years, 2 months ago (2012-10-04 04:10:32 UTC) #10
grt (UTC plus 2)
rubberstamp lgtm http://codereview.chromium.org/10836247/diff/27003/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): http://codereview.chromium.org/10836247/diff/27003/chrome/installer/util/shell_util.cc#newcode1100 chrome/installer/util/shell_util.cc:1100: if (dir_key == -1 || !PathService::Get(dir_key, path) ...
8 years, 2 months ago (2012-10-04 14:31:22 UTC) #11
robertshield
LGTM
8 years, 2 months ago (2012-10-04 15:41:51 UTC) #12
gab
Addressed grt's comments. http://codereview.chromium.org/10836247/diff/27003/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): http://codereview.chromium.org/10836247/diff/27003/chrome/installer/util/shell_util.cc#newcode1100 chrome/installer/util/shell_util.cc:1100: if (dir_key == -1 || !PathService::Get(dir_key, ...
8 years, 2 months ago (2012-10-04 16:39:23 UTC) #13
gab
+sail for chrome/browser/profiles/* OWNER approval +jhawkins for OWNER rubberstamp for side-effects on chrome/browser/chrome_browser_main_win.cc and chrome/browser/first_run/first_run_win.cc ...
8 years, 2 months ago (2012-10-04 16:42:51 UTC) #14
James Hawkins
My files lgtm
8 years, 2 months ago (2012-10-04 16:44:47 UTC) #15
sail
profiles/* LGTM looks much nicer now!
8 years, 2 months ago (2012-10-04 16:51:34 UTC) #16
gab
On 2012/10/04 16:51:34, sail wrote: > profiles/* LGTM > looks much nicer now! Thanks!
8 years, 2 months ago (2012-10-04 18:40:13 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/10836247/28003
8 years, 2 months ago (2012-10-04 18:40:27 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/10836247/23003
8 years, 2 months ago (2012-10-04 20:18:29 UTC) #19
commit-bot: I haz the power
8 years, 2 months ago (2012-10-05 01:34:07 UTC) #20
Change committed as 160284

Powered by Google App Engine
This is Rietveld 408576698