EmbedChromeManager.h 1.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * 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 EmbedChromeManager_H_
#define EmbedChromeManager_H_

#include "nsWeakReference.h"
#include "nsIObserver.h"
#include "nsIDOMEventListener.h"
#include "nsIEmbedAppService.h"
#include "EmbedChromeListener.h"
#include "nsCOMArray.h"

class EmbedChromeManager : public nsIObserver,
                           public nsSupportsWeakReference
{
public:
    EmbedChromeManager();

    NS_DECL_ISUPPORTS
    NS_DECL_NSIOBSERVER

    nsresult Init();
private:
28 29
    virtual ~EmbedChromeManager();

30 31 32 33 34 35 36 37 38 39 40
    void WindowCreated(nsIDOMWindow* aWin);
    void WindowDestroyed(nsIDOMWindow* aWin);
    nsCOMPtr<nsIEmbedAppService> mService;
    int mWindowCounter;
    typedef nsCOMArray<EmbedChromeListener> ObserversArray;
    ObserversArray mArray;
};

#define NS_EMBED_CHROME_CONTRACTID "@mozilla.org/embed-chrome-component;1"
#define NS_EMBED_CHROME_SERVICE_CLASSNAME "Embed Chrome Listener Component"
#define NS_EMBED_CHROME_SERVICE_CID \
Tatiana Meshkova's avatar
Tatiana Meshkova committed
41 42 43 44
{ 0xc0e99ee0, \
  0x6e88, \
  0x11e2, \
  { 0xad, 0x40, 0xaf, 0xe0, 0x02, 0x59, 0x55 }}
45 46

#endif /*EmbedChromeManager_H_*/