mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
merge fx-team to m-c
This commit is contained in:
commit
443e44fc32
@ -62,6 +62,7 @@
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include <io.h>
|
||||
#include <propvarutil.h>
|
||||
#include <propkey.h>
|
||||
@ -274,6 +275,28 @@ WinTaskbar::~WinTaskbar() {
|
||||
// static
|
||||
bool
|
||||
WinTaskbar::GetAppUserModelID(nsAString & aDefaultGroupId) {
|
||||
// If marked as such in prefs, use a hash of the profile path for the id
|
||||
// instead of the install path hash setup by the installer.
|
||||
bool useProfile =
|
||||
Preferences::GetBool("taskbar.grouping.useprofile", false);
|
||||
if (useProfile) {
|
||||
nsCOMPtr<nsIFile> profileDir;
|
||||
NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_50_DIR,
|
||||
getter_AddRefs(profileDir));
|
||||
bool exists = false;
|
||||
if (profileDir && NS_SUCCEEDED(profileDir->Exists(&exists)) && exists) {
|
||||
nsCAutoString path;
|
||||
if (NS_SUCCEEDED(profileDir->GetNativePath(path))) {
|
||||
nsAutoString id;
|
||||
id.AppendInt(HashString(path));
|
||||
if (!id.IsEmpty()) {
|
||||
aDefaultGroupId.Assign(id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The default value is set by the installer and is stored in the registry
|
||||
// under (HKLM||HKCU)/Software/Mozilla/Firefox/TaskBarIDs. If for any reason
|
||||
// hash generation operation fails, the installer will not store a value in
|
||||
|
Loading…
Reference in New Issue
Block a user