summaryrefslogtreecommitdiffstats
path: root/base/win
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
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')
-rw-r--r--base/win/win_util.cc27
-rw-r--r--base/win/win_util.h6
2 files changed, 23 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";
diff --git a/base/win/win_util.h b/base/win/win_util.h
index 1fe26c7..66c5016 100644
--- a/base/win/win_util.h
+++ b/base/win/win_util.h
@@ -67,6 +67,12 @@ BASE_EXPORT bool IsAltPressed();
// if the OS is Vista or later.
BASE_EXPORT bool UserAccountControlIsEnabled();
+// Sets the string value for given key in given IPropertyStore.
+BASE_EXPORT bool SetStringValueForPropertyStore(
+ IPropertyStore* property_store,
+ const PROPERTYKEY& property_key,
+ const wchar_t* property_string_value);
+
// Sets the application id in given IPropertyStore. The function is intended
// for tagging application/chromium shortcut, browser window and jump list for
// Win7.