summaryrefslogtreecommitdiffstats
path: root/base/win/win_util.cc
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 22:07:37 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 22:07:37 +0000
commit2de2d62f73f4e58000055c0522a62af5d6da3cf5 (patch)
tree74be815663f4a0ae103db997e02949ef497e9459 /base/win/win_util.cc
parent72640fb4cac75e9f42fb0e186353bc8b3b196905 (diff)
downloadchromium_src-2de2d62f73f4e58000055c0522a62af5d6da3cf5.zip
chromium_src-2de2d62f73f4e58000055c0522a62af5d6da3cf5.tar.gz
chromium_src-2de2d62f73f4e58000055c0522a62af5d6da3cf5.tar.bz2
Support grouping taskbar icons for panels with regular taskbar icon for Chromium on Windows 7.
Per discussion, we do not want to use different taskbar icon for each panel since they're now managed altogether. We also need to set its icon path so that the taskbar icon will not be changed once all chromium tabbed windows are closed. BUG=none TEST=Manual test by launching panels, closing tabbed window and verifying taskbar icon for panels are grouped together with chrome Review URL: http://codereview.chromium.org/8366026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win/win_util.cc')
-rw-r--r--base/win/win_util.cc27
1 files changed, 17 insertions, 10 deletions
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index 10ae261..15a6445 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -97,21 +97,16 @@ bool UserAccountControlIsEnabled() {
return (uac_enabled != 0);
}
-bool SetAppIdForPropertyStore(IPropertyStore* property_store,
- const wchar_t* app_id) {
+bool SetStringValueForPropertyStore(IPropertyStore* property_store,
+ const PROPERTYKEY& property_key,
+ const wchar_t* property_string_value) {
DCHECK(property_store);
- // App id should be less than 128 chars and contain no space. And recommended
- // format is CompanyName.ProductName[.SubProduct.ProductNumber].
- // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx
- DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL);
-
PROPVARIANT property_value;
- if (FAILED(InitPropVariantFromString(app_id, &property_value)))
+ if (FAILED(InitPropVariantFromString(property_string_value, &property_value)))
return false;
- HRESULT result = property_store->SetValue(PKEY_AppUserModel_ID,
- property_value);
+ HRESULT result = property_store->SetValue(property_key, property_value);
if (S_OK == result)
result = property_store->Commit();
@@ -119,6 +114,18 @@ bool SetAppIdForPropertyStore(IPropertyStore* property_store,
return SUCCEEDED(result);
}
+bool SetAppIdForPropertyStore(IPropertyStore* property_store,
+ const wchar_t* app_id) {
+ // App id should be less than 128 chars and contain no space. And recommended
+ // format is CompanyName.ProductName[.SubProduct.ProductNumber].
+ // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx
+ DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL);
+
+ return SetStringValueForPropertyStore(property_store,
+ PKEY_AppUserModel_ID,
+ app_id);
+}
+
static const char16 kAutoRunKeyPath[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";