зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1602195) for toolkit/components/alerts/test/test_alerts.html failures CLOSED TREE
Backed out changeset 399d66c91450 (bug 1602195) Backed out changeset c007b95a362c (bug 1602195)
This commit is contained in:
Родитель
cae1e55d61
Коммит
475dd19c3d
|
@ -9,7 +9,5 @@ interface nsIFile;
|
|||
[scriptable, uuid(fb9b59db-5a91-4e67-92b6-35e7d6e6d3fd)]
|
||||
interface nsIWindowsShellService : nsISupports
|
||||
{
|
||||
void createShortcut(in nsIFile aBinary, in Array<AString> aArguments,
|
||||
in AString aDescription, in nsIFile aIconFile, in AString aAppUserModelId,
|
||||
in nsIFile aTarget);
|
||||
void createShortcut(in nsIFile aBinary, in Array<AString> aArguments, in AString aDescription, in nsIFile aIconFile, in nsIFile aTarget);
|
||||
};
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
|
||||
#include "windows.h"
|
||||
#include "shellapi.h"
|
||||
#include <propvarutil.h>
|
||||
#include <propkey.h>
|
||||
|
||||
#ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
|
@ -703,9 +701,7 @@ NS_IMETHODIMP
|
|||
nsWindowsShellService::CreateShortcut(nsIFile* aBinary,
|
||||
const nsTArray<nsString>& aArguments,
|
||||
const nsAString& aDescription,
|
||||
nsIFile* aIconFile,
|
||||
const nsAString& aAppUserModelId,
|
||||
nsIFile* aTarget) {
|
||||
nsIFile* aIconFile, nsIFile* aTarget) {
|
||||
NS_ENSURE_ARG(aBinary);
|
||||
NS_ENSURE_ARG(aTarget);
|
||||
|
||||
|
@ -734,25 +730,6 @@ nsWindowsShellService::CreateShortcut(nsIFile* aBinary,
|
|||
link->SetIconLocation(icon.get(), 0);
|
||||
}
|
||||
|
||||
if (!aAppUserModelId.IsEmpty()) {
|
||||
RefPtr<IPropertyStore> propStore;
|
||||
hr = link->QueryInterface(IID_IPropertyStore, getter_AddRefs(propStore));
|
||||
NS_ENSURE_HRESULT(hr, NS_ERROR_FAILURE);
|
||||
|
||||
PROPVARIANT pv;
|
||||
if (FAILED(InitPropVariantFromString(
|
||||
PromiseFlatString(aAppUserModelId).get(), &pv))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
hr = propStore->SetValue(PKEY_AppUserModel_ID, pv);
|
||||
PropVariantClear(&pv);
|
||||
NS_ENSURE_HRESULT(hr, NS_ERROR_FAILURE);
|
||||
|
||||
hr = propStore->Commit();
|
||||
NS_ENSURE_HRESULT(hr, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
RefPtr<IPersistFile> persist;
|
||||
hr = link->QueryInterface(IID_IPersistFile, getter_AddRefs(persist));
|
||||
NS_ENSURE_HRESULT(hr, NS_ERROR_FAILURE);
|
||||
|
|
|
@ -25,24 +25,12 @@ const uiUtils = Cc["@mozilla.org/windows-ui-utils;1"].getService(
|
|||
Ci.nsIWindowsUIUtils
|
||||
);
|
||||
|
||||
const taskbar = Cc["@mozilla.org/windows-taskbar;1"].getService(
|
||||
Ci.nsIWinTaskbar
|
||||
);
|
||||
|
||||
const File = Components.Constructor(
|
||||
"@mozilla.org/file/local;1",
|
||||
Ci.nsIFile,
|
||||
"initWithPath"
|
||||
);
|
||||
|
||||
function buildGroupId(id) {
|
||||
try {
|
||||
return `${taskbar.defaultGroupId}.ssb.${id}`;
|
||||
} catch (e) {
|
||||
return `Firefox.ssb.${id}`;
|
||||
}
|
||||
}
|
||||
|
||||
const WindowsSupport = {
|
||||
/**
|
||||
* Installs an SSB by creating a shortcut to launch it on the user's desktop.
|
||||
|
@ -83,7 +71,6 @@ const WindowsSupport = {
|
|||
["-profile", OS.Constants.Path.profileDir, "-start-ssb", ssb.id],
|
||||
ssb.name,
|
||||
iconFile,
|
||||
buildGroupId(ssb.id),
|
||||
new File(link)
|
||||
);
|
||||
},
|
||||
|
@ -154,7 +141,5 @@ const WindowsSupport = {
|
|||
if (icons[0] || icons[1]) {
|
||||
uiUtils.setWindowIcon(window, icons[0], icons[1]);
|
||||
}
|
||||
|
||||
taskbar.setGroupIdForWindow(window, buildGroupId(ssb.id));
|
||||
},
|
||||
};
|
||||
|
|
|
@ -29,10 +29,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
});
|
||||
|
||||
let xreDirProvider = Cc["@mozilla.org/xre/directory-provider;1"].getService(
|
||||
Ci.nsIXREDirProvider
|
||||
);
|
||||
|
||||
const SSB_STORE_PREFIX = "ssb:";
|
||||
|
||||
const uri = spec => Services.io.newURI(spec);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
# include <shlobj.h>
|
||||
# include <urlmon.h>
|
||||
# include "nsILocalFileWin.h"
|
||||
# include "WinTaskbar.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -99,31 +98,6 @@ CFURLRef CreateCFURLFromNSIURI(nsIURI* aURI) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
static void AddToRecentDocs(nsIFile* aTarget, nsAutoString& aPath) {
|
||||
nsString modelId;
|
||||
if (mozilla::widget::WinTaskbar::GetAppUserModelID(modelId)) {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
if (NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(uri), aTarget)) && uri) {
|
||||
nsCString spec;
|
||||
if (NS_SUCCEEDED(uri->GetSpec(spec))) {
|
||||
IShellItem2* psi = nullptr;
|
||||
if (SUCCEEDED(
|
||||
SHCreateItemFromParsingName(NS_ConvertASCIItoUTF16(spec).get(),
|
||||
nullptr, IID_PPV_ARGS(&psi)))) {
|
||||
SHARDAPPIDINFO info = {psi, modelId.get()};
|
||||
::SHAddToRecentDocs(SHARD_APPIDINFO, &info);
|
||||
psi->Release();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::SHAddToRecentDocs(SHARD_PATHW, aPath.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
DownloadPlatform::DownloadPlatform() {
|
||||
mIOThread = new LazyIdleThread(DEFAULT_THREAD_TIMEOUT_MS,
|
||||
NS_LITERAL_CSTRING("DownloadPlatform"));
|
||||
|
@ -164,7 +138,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer,
|
|||
bool addToRecentDocs = Preferences::GetBool(PREF_BDM_ADDTORECENTDOCS);
|
||||
if (addToRecentDocs && !aIsPrivate) {
|
||||
# ifdef XP_WIN
|
||||
AddToRecentDocs(aTarget, path);
|
||||
::SHAddToRecentDocs(SHARD_PATHW, path.get());
|
||||
# elif defined(MOZ_WIDGET_GTK)
|
||||
GtkRecentManager* manager = gtk_recent_manager_get_default();
|
||||
|
||||
|
|
|
@ -24,11 +24,6 @@ SOURCES += [
|
|||
'DownloadPlatform.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
LOCAL_INCLUDES += [
|
||||
'/widget/windows',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'DownloadCore.jsm',
|
||||
'DownloadIntegration.jsm',
|
||||
|
|
|
@ -128,17 +128,6 @@ JumpListBuilder::JumpListBuilder()
|
|||
observerService->AddObserver(this, TOPIC_PROFILE_BEFORE_CHANGE, false);
|
||||
observerService->AddObserver(this, TOPIC_CLEAR_PRIVATE_DATA, false);
|
||||
}
|
||||
|
||||
RefPtr<ICustomDestinationList> jumpListMgr = mJumpListMgr;
|
||||
if (!jumpListMgr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// GetAppUserModelID can only be called once we're back on the main thread.
|
||||
nsString modelId;
|
||||
if (mozilla::widget::WinTaskbar::GetAppUserModelID(modelId)) {
|
||||
jumpListMgr->SetAppID(modelId.get());
|
||||
}
|
||||
}
|
||||
|
||||
JumpListBuilder::~JumpListBuilder() {
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsAppRunner.h"
|
||||
#include "nsXREDirProvider.h"
|
||||
#include <io.h>
|
||||
#include <propvarutil.h>
|
||||
#include <propkey.h>
|
||||
|
@ -204,13 +202,6 @@ WinTaskbar::~WinTaskbar() {
|
|||
|
||||
// static
|
||||
bool WinTaskbar::GetAppUserModelID(nsAString& aDefaultGroupId) {
|
||||
// If an ID has already been set then use that.
|
||||
PWSTR id;
|
||||
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&id))) {
|
||||
aDefaultGroupId.Assign(id);
|
||||
CoTaskMemFree(id);
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
@ -236,43 +227,43 @@ bool WinTaskbar::GetAppUserModelID(nsAString& aDefaultGroupId) {
|
|||
// under (HKLM||HKCU)/Software/Mozilla/Firefox/TaskBarIDs. If for any reason
|
||||
// hash generation operation fails, the installer will not store a value in
|
||||
// the registry or set ids on shortcuts. A lack of an id can also occur for
|
||||
// zipped builds.
|
||||
// zipped builds. We skip setting the global id in this case as well.
|
||||
nsCOMPtr<nsIXULAppInfo> appInfo =
|
||||
do_GetService("@mozilla.org/xre/app-info;1");
|
||||
if (!appInfo) return false;
|
||||
|
||||
nsCString appName;
|
||||
if (appInfo && NS_SUCCEEDED(appInfo->GetName(appName))) {
|
||||
nsAutoString regKey;
|
||||
regKey.AssignLiteral("Software\\Mozilla\\");
|
||||
AppendASCIItoUTF16(appName, regKey);
|
||||
regKey.AppendLiteral("\\TaskBarIDs");
|
||||
if (NS_FAILED(appInfo->GetName(appName))) {
|
||||
// We just won't register then, let Windows handle it.
|
||||
return false;
|
||||
}
|
||||
|
||||
WCHAR path[MAX_PATH];
|
||||
if (GetModuleFileNameW(nullptr, path, MAX_PATH)) {
|
||||
wchar_t* slash = wcsrchr(path, '\\');
|
||||
if (!slash) return false;
|
||||
*slash = '\0'; // no trailing slash
|
||||
nsAutoString regKey;
|
||||
regKey.AssignLiteral("Software\\Mozilla\\");
|
||||
AppendASCIItoUTF16(appName, regKey);
|
||||
regKey.AppendLiteral("\\TaskBarIDs");
|
||||
|
||||
// The hash is short, but users may customize this, so use a respectable
|
||||
// string buffer.
|
||||
wchar_t buf[256];
|
||||
if (WinUtils::GetRegistryKey(HKEY_LOCAL_MACHINE, regKey.get(), path, buf,
|
||||
sizeof buf)) {
|
||||
aDefaultGroupId.Assign(buf);
|
||||
} else if (WinUtils::GetRegistryKey(HKEY_CURRENT_USER, regKey.get(), path,
|
||||
buf, sizeof buf)) {
|
||||
aDefaultGroupId.Assign(buf);
|
||||
}
|
||||
WCHAR path[MAX_PATH];
|
||||
if (GetModuleFileNameW(nullptr, path, MAX_PATH)) {
|
||||
wchar_t* slash = wcsrchr(path, '\\');
|
||||
if (!slash) return false;
|
||||
*slash = '\0'; // no trailing slash
|
||||
|
||||
// The hash is short, but users may customize this, so use a respectable
|
||||
// string buffer.
|
||||
wchar_t buf[256];
|
||||
if (WinUtils::GetRegistryKey(HKEY_LOCAL_MACHINE, regKey.get(), path, buf,
|
||||
sizeof buf)) {
|
||||
aDefaultGroupId.Assign(buf);
|
||||
} else if (WinUtils::GetRegistryKey(HKEY_CURRENT_USER, regKey.get(), path,
|
||||
buf, sizeof buf)) {
|
||||
aDefaultGroupId.Assign(buf);
|
||||
}
|
||||
}
|
||||
|
||||
// If we haven't found an ID yet then use the install hash. In xpcshell tests
|
||||
// the directory provider may not have been initialized so bypass in this
|
||||
// case.
|
||||
if (aDefaultGroupId.IsEmpty() && gDirServiceProvider) {
|
||||
gDirServiceProvider->GetInstallHash(aDefaultGroupId);
|
||||
}
|
||||
|
||||
return !aDefaultGroupId.IsEmpty();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче