fune/toolkit/components/windowwatcher/nsOpenWindowInfo.h
Emilio Cobos Álvarez 4e68e78542 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
In order to avoid over/under-counting, we need to treat window.print()
specially. The new UI was using aOpenWindowInfo.isForPrintPreview for
that, but that doesn't quite work for the old UI (because it will
trigger a regular print, not a preview).

But since isForPrintPreview was only really needed to distinguish
window.print(), just rename it and set it to true when the old UI is
triggered by window.print() as well.

Differential Revision: https://phabricator.services.mozilla.com/D92925
2020-10-09 14:59:46 +00:00

50 lines
1.5 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsOpenWindowInfo_h
#define nsOpenWindowInfo_h
#include "nsIOpenWindowInfo.h"
#include "nsISupportsImpl.h"
#include "mozilla/OriginAttributes.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/ClientOpenWindowUtils.h"
class nsOpenWindowInfo : public nsIOpenWindowInfo {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOPENWINDOWINFO
bool mForceNoOpener = false;
bool mIsRemote = false;
bool mIsForPrinting = false;
bool mIsForWindowDotPrint = false;
RefPtr<mozilla::dom::BrowserParent> mNextRemoteBrowser;
mozilla::OriginAttributes mOriginAttributes;
RefPtr<mozilla::dom::BrowsingContext> mParent;
RefPtr<nsIBrowsingContextReadyCallback> mBrowsingContextReadyCallback;
private:
virtual ~nsOpenWindowInfo() = default;
};
class nsBrowsingContextReadyCallback : public nsIBrowsingContextReadyCallback {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBROWSINGCONTEXTREADYCALLBACK
explicit nsBrowsingContextReadyCallback(
RefPtr<mozilla::dom::BrowsingContextCallbackReceivedPromise::Private>
aPromise);
private:
virtual ~nsBrowsingContextReadyCallback();
RefPtr<mozilla::dom::BrowsingContextCallbackReceivedPromise::Private>
mPromise;
};
#endif // nsOpenWindowInfo_h