diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 23:53:48 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 23:53:48 +0000 |
commit | c9bb06f4cee992d31f97ee893663a476d4efba0c (patch) | |
tree | 47bd85ad04594bfb9f1f3399b1de68e5500fd77c /base | |
parent | 3d59e8c708383943f572e11e5d833c3d6b10a81b (diff) | |
download | chromium_src-c9bb06f4cee992d31f97ee893663a476d4efba0c.zip chromium_src-c9bb06f4cee992d31f97ee893663a476d4efba0c.tar.gz chromium_src-c9bb06f4cee992d31f97ee893663a476d4efba0c.tar.bz2 |
Ensure existing user pinned chrome shortcuts have correct app id.
On Win7, check if user has pinned chrome shortcuts and ensure they have correct app id.
BUG=28104
TEST=On Win7, install chrome prior 4.0.266.0 and pin chrome shortcut (browser with default profile, browser with non-default profile, web apps etc). Then update to a version with this fix. After update, running chrome should not have duplicate icon spawned.
Review URL: http://codereview.chromium.org/548008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_win.cc | 2 | ||||
-rw-r--r-- | base/win_util.cc | 8 | ||||
-rw-r--r-- | base/win_util.h | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 9133e7b..e066422 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -354,7 +354,7 @@ bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, if (FAILED(i_persist_file.QueryFrom(i_shell_link))) return false; - if (FAILED(i_persist_file->Load(destination, 0))) + if (FAILED(i_persist_file->Load(destination, STGM_READWRITE))) return false; if (source && FAILED(i_shell_link->SetPath(source))) diff --git a/base/win_util.cc b/base/win_util.cc index fa168d0..12cf241 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -21,6 +21,10 @@ namespace win_util { #define NONCLIENTMETRICS_SIZE_PRE_VISTA \ SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(NONCLIENTMETRICS, lfMessageFont) +const PROPERTYKEY kPKEYAppUserModelID = + { { 0x9F4C2855, 0x9F79, 0x4B39, + { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, } }, 5 }; + void GetNonClientMetrics(NONCLIENTMETRICS* metrics) { DCHECK(metrics); @@ -394,10 +398,6 @@ bool SetAppIdForPropertyStore(IPropertyStore* property_store, // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); - static const PROPERTYKEY kPKEYAppUserModelID = - { { 0x9F4C2855, 0x9F79, 0x4B39, - { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, } }, 5 }; - PROPVARIANT property_value; if (FAILED(InitPropVariantFromString(app_id, &property_value))) return false; diff --git a/base/win_util.h b/base/win_util.h index bc10c38..ca550cf 100644 --- a/base/win_util.h +++ b/base/win_util.h @@ -28,6 +28,11 @@ enum WinVersion { WINVERSION_WIN7 = 6, }; +// Property key for System.AppUserModel.ID. +// <http://msdn.microsoft.com/en-us/library/dd391569(VS.85).aspx> +// TODO(xiyuan): Remove this once we compile with Win7 SDK. +extern const PROPERTYKEY kPKEYAppUserModelID; + void GetNonClientMetrics(NONCLIENTMETRICS* metrics); // Returns the running version of Windows. |