~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/embedding/qa/mozembed/src/nsQAWindowCreator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: Mozilla-sample-code 1.0
 
4
 *
 
5
 * Copyright (c) 2002 Netscape Communications Corporation and
 
6
 * other contributors
 
7
 *
 
8
 * Permission is hereby granted, free of charge, to any person obtaining a
 
9
 * copy of this Mozilla sample software and associated documentation files
 
10
 * (the "Software"), to deal in the Software without restriction, including
 
11
 * without limitation the rights to use, copy, modify, merge, publish,
 
12
 * distribute, sublicense, and/or sell copies of the Software, and to permit
 
13
 * persons to whom the Software is furnished to do so, subject to the
 
14
 * following conditions:
 
15
 *
 
16
 * The above copyright notice and this permission notice shall be included
 
17
 * in all copies or substantial portions of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
20
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
22
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
24
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
25
 * DEALINGS IN THE SOFTWARE.
 
26
 *
 
27
 * Contributor(s):
 
28
 *
 
29
 * ***** END LICENSE BLOCK ***** */
 
30
 
 
31
#include "nsCOMPtr.h"
 
32
#include "nsIServiceManagerUtils.h"
 
33
#include "nsIWebBrowserChrome.h"
 
34
#include "nsQAWindowCreator.h"
 
35
#include "nsIQABrowserUIGlue.h"
 
36
#include "nsQABrowserCID.h"
 
37
 
 
38
WindowCreator::WindowCreator()
 
39
{
 
40
}
 
41
 
 
42
WindowCreator::~WindowCreator()
 
43
{
 
44
}
 
45
 
 
46
NS_IMPL_ISUPPORTS1(WindowCreator, nsIWindowCreator)
 
47
 
 
48
NS_IMETHODIMP
 
49
WindowCreator::CreateChromeWindow(nsIWebBrowserChrome *parent,
 
50
                                  PRUint32 chromeFlags,
 
51
                                  nsIWebBrowserChrome **_retval)
 
52
{
 
53
    NS_ENSURE_ARG_POINTER(_retval);
 
54
    nsresult rv;
 
55
    nsCOMPtr<nsIQABrowserUIGlue> glue(do_CreateInstance(NS_QABROWSERUIGLUE_CONTRACTID, &rv));
 
56
    if (glue)
 
57
      glue->CreateNewBrowserWindow(PRInt32(chromeFlags), parent, _retval);
 
58
    //AppCallbacks::CreateBrowserWindow(PRInt32(chromeFlags), parent, _retval);
 
59
    return *_retval ? NS_OK : NS_ERROR_FAILURE;
 
60
}