Bug 1794893 - WebGLMemoryTracker ensured-registered in WebGLContext::ctor. r=gfx...
[gecko.git] / toolkit / components / alerts / nsAlertsUtils.h
blobc126769de7f973d786677646b1174e6ae94f7df9
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"
9 #include "nsString.h"
11 class nsAlertsUtils final {
12 private:
13 nsAlertsUtils() = delete;
15 public:
16 /**
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);
23 /**
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 */