FxRWindowManager.h (1038B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #pragma once 7 #include <cstdint> 8 9 class nsPIDOMWindowOuter; 10 class nsWindow; 11 12 // FxRWindowManager is a singleton that is responsible for tracking all of 13 // the top-level windows created for Firefox Reality on Desktop. Only a 14 // single window is initially supported. 15 class FxRWindowManager final { 16 public: 17 static FxRWindowManager* GetInstance(); 18 19 void AddWindow(nsPIDOMWindowOuter* aWindow); 20 bool IsFxRWindow(uint64_t aOuterWindowID); 21 bool IsFxRWindow(const nsWindow* aWindow) const; 22 uint64_t GetWindowID() const; 23 24 private: 25 FxRWindowManager(); 26 27 // Only a single window is supported for tracking. Support for multiple 28 // windows will require a data structure to collect windows as they are 29 // created. 30 nsPIDOMWindowOuter* mWindow; 31 };