1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsAlertsUtils_h
6 #define nsAlertsUtils_h
8 #include "nsIPrincipal.h"
11 class nsAlertsUtils final
{
13 nsAlertsUtils() = delete;
17 * Indicates whether an alert from |aPrincipal| should include the source
18 * string and action buttons. Returns false if |aPrincipal| is |nullptr|, or
19 * a system, expanded, or null principal.
21 static bool IsActionablePrincipal(nsIPrincipal
* aPrincipal
);
24 * Sets |aHostPort| to the host and port from |aPrincipal|'s URI, or an
25 * empty string if |aPrincipal| is not actionable.
27 static void GetSourceHostPort(nsIPrincipal
* aPrincipal
, nsAString
& aHostPort
);
29 #endif /* nsAlertsUtils_h */