Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / dom / base / nsDOMWindowList.h
blobd33e37e0b87f4297df3c627d45034158e9113964
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsDOMWindowList_h___
7 #define nsDOMWindowList_h___
9 #include "nsCOMPtr.h"
10 #include <stdint.h>
11 #include "nsIDocShell.h"
13 class nsIDocShell;
14 class nsIDOMWindow;
16 class nsDOMWindowList final {
17 public:
18 explicit nsDOMWindowList(nsIDocShell* aDocShell);
20 NS_INLINE_DECL_REFCOUNTING(nsDOMWindowList)
22 uint32_t GetLength();
23 already_AddRefed<nsPIDOMWindowOuter> IndexedGetter(uint32_t aIndex);
24 already_AddRefed<nsPIDOMWindowOuter> NamedItem(const nsAString& aName);
26 // local methods
27 void SetDocShell(nsIDocShell* aDocShell);
28 already_AddRefed<nsIDocShellTreeItem> GetDocShellTreeItemAt(uint32_t aIndex) {
29 EnsureFresh();
30 nsCOMPtr<nsIDocShellTreeItem> item;
31 if (mDocShellNode) {
32 mDocShellNode->GetChildAt(aIndex, getter_AddRefs(item));
34 return item.forget();
37 protected:
38 ~nsDOMWindowList();
40 // Note: this function may flush and cause mDocShellNode to become null.
41 void EnsureFresh();
43 nsIDocShell* mDocShellNode; // Weak Reference
46 #endif // nsDOMWindowList_h___