NOT PART OF BUILD. Add sample licence, fix window creator
git-svn-id: svn://10.0.0.236/trunk@144104 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "BrowserFrame.h"
|
||||
@@ -24,7 +55,10 @@ BrowserFrame::BrowserFrame(wxWindow* aParent) :
|
||||
mGeckoWnd = (GeckoWindow *) FindWindowById(XRCID("gecko"), this);
|
||||
if (mGeckoWnd)
|
||||
{
|
||||
GeckoContainer *geckoContainer = new GeckoContainer(this);
|
||||
// Note we pass in 'browser' as the role so that when the content
|
||||
// wants to open a popup the window creator can say okay but deny it
|
||||
// for other roles such as 'mail' or whatever.
|
||||
GeckoContainer *geckoContainer = new GeckoContainer(this, "browser");
|
||||
if (geckoContainer)
|
||||
{
|
||||
mGeckoWnd->SetGeckoContainer(geckoContainer);
|
||||
@@ -128,6 +162,18 @@ void BrowserFrame::OnBrowserHome(wxCommandEvent & WXUNUSED(event))
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// GeckoContainerUI overrides
|
||||
|
||||
nsresult BrowserFrame::CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
nsIWebBrowserChrome *aParent, nsIWebBrowserChrome **aNewWindow)
|
||||
{
|
||||
// Create the main frame window
|
||||
BrowserFrame* frame = new BrowserFrame(NULL);
|
||||
if (!frame)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
frame->Show(TRUE);
|
||||
GeckoContainer *container = frame->mGeckoWnd->GetGeckoContainer();
|
||||
return container->QueryInterface(NS_GET_IID(nsIWebBrowserChrome), (void **) aNewWindow);
|
||||
}
|
||||
|
||||
void BrowserFrame::UpdateStatusBarText(const PRUnichar* aStatusText)
|
||||
{
|
||||
SetStatusText(aStatusText);
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef BROWSERFRAME_H
|
||||
#define BROWSERFRAME_H
|
||||
|
||||
@@ -25,8 +56,10 @@ public :
|
||||
nsCOMPtr<nsIWebBrowser> mWebbrowser;
|
||||
|
||||
// GeckoContainerUI overrides
|
||||
void UpdateStatusBarText(const PRUnichar* aStatusText);
|
||||
void UpdateCurrentURI();
|
||||
virtual nsresult CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
nsIWebBrowserChrome *aParent, nsIWebBrowserChrome **aNewWindow);
|
||||
virtual void UpdateStatusBarText(const PRUnichar* aStatusText);
|
||||
virtual void UpdateCurrentURI();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,11 +1,44 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "nsIProfile.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
#include "BrowserFrame.h"
|
||||
#include "MailFrame.h"
|
||||
#include "GeckoProtocolHandler.h"
|
||||
#include "GeckoWindowCreator.h"
|
||||
|
||||
class FooCallback : public GeckoChannelCallback
|
||||
{
|
||||
@@ -67,7 +100,6 @@ bool EmbedApp::OnInit()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
@@ -76,12 +108,28 @@ bool EmbedApp::OnInit()
|
||||
rv = profileService->SetCurrentProfile(L"wxEmbed");
|
||||
if (NS_FAILED(rv)) return FALSE;
|
||||
|
||||
GeckoProtocolHandler::RegisterHandler("foo", "Test handler", new FooCallback);
|
||||
|
||||
|
||||
// create an nsWindowCreator and give it to the WindowWatcher service
|
||||
GeckoWindowCreator *creatorCallback = new GeckoWindowCreator();
|
||||
if (creatorCallback)
|
||||
{
|
||||
nsCOMPtr<nsIWindowCreator> windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback));
|
||||
if (windowCreator)
|
||||
{
|
||||
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
||||
if (wwatch)
|
||||
{
|
||||
wwatch->SetWindowCreator(windowCreator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create the main frame window
|
||||
BrowserFrame* frame = new BrowserFrame(NULL);
|
||||
frame->Show(TRUE);
|
||||
|
||||
GeckoProtocolHandler::RegisterHandler("foo", "Test handler", new FooCallback);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// Mozilla Includes
|
||||
@@ -154,6 +156,11 @@ NS_IMETHODIMP GeckoContainer::GetRole(nsACString &aRole)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GeckoContainer::GetContainerUI(GeckoContainerUI **pUI)
|
||||
{
|
||||
*pUI = mUI;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// GeckoContainer::nsIInterfaceRequestor
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef __WebBrowserChrome__
|
||||
@@ -64,6 +66,7 @@ public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IGECKOCONTAINER_IID)
|
||||
|
||||
NS_IMETHOD GetRole(nsACString &aRole) = 0;
|
||||
NS_IMETHOD GetContainerUI(GeckoContainerUI **pUI) = 0;
|
||||
};
|
||||
|
||||
#define NS_DECL_NSIGECKOCONTAINER
|
||||
@@ -101,7 +104,7 @@ public:
|
||||
|
||||
// nsIGeckoContainer
|
||||
NS_IMETHOD GetRole(nsACString &aRole);
|
||||
|
||||
NS_IMETHOD GetContainerUI(GeckoContainerUI **pUI);
|
||||
|
||||
nsresult CreateBrowser(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nativeWindow aParent,
|
||||
nsIWebBrowser **aBrowser);
|
||||
@@ -128,10 +131,9 @@ protected:
|
||||
class GeckoContainerUI
|
||||
{
|
||||
public:
|
||||
static nsresult CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
GeckoContainer *aParent,
|
||||
GeckoContainer **aNewWindow);
|
||||
|
||||
// Called by the window creator when a new browser window is requested
|
||||
virtual nsresult CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
nsIWebBrowserChrome *aParent, nsIWebBrowserChrome **aNewWindow);
|
||||
// Called when the content wants to be destroyed (e.g. a window.close() happened)
|
||||
virtual void Destroy();
|
||||
// Called when the Gecko has been torn down, allowing dangling references to be released
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "global.h"
|
||||
|
||||
@@ -5,8 +35,7 @@
|
||||
|
||||
|
||||
nsresult GeckoContainerUI::CreateBrowserWindow(PRUint32 aChromeFlags,
|
||||
GeckoContainer *aParent,
|
||||
GeckoContainer **aNewWindow)
|
||||
nsIWebBrowserChrome *aParent, nsIWebBrowserChrome **aNewWindow)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* adamlock@netscape.com
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "GeckoProtocolHandler.h"
|
||||
|
||||
#include "nsString.h"
|
||||
@@ -50,6 +81,42 @@ public:
|
||||
static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
||||
};
|
||||
|
||||
|
||||
class GeckoProtocolChannel :
|
||||
public nsIChannel,
|
||||
public nsIStreamListener
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIREQUEST
|
||||
NS_DECL_NSICHANNEL
|
||||
NS_DECL_NSIREQUESTOBSERVER
|
||||
NS_DECL_NSISTREAMLISTENER
|
||||
|
||||
GeckoProtocolChannel();
|
||||
nsresult Init(nsIURI *aURI);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIURI> mURI;
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsIProgressEventSink> mProgressSink;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
||||
nsCOMPtr<nsIStreamListener> mListener;
|
||||
nsCOMPtr<nsISupports> mListenerContext;
|
||||
nsCOMPtr<nsIInputStream> mContentStream;
|
||||
nsCString mContentType;
|
||||
nsCString mContentCharset;
|
||||
PRUint32 mLoadFlags;
|
||||
nsresult mStatus;
|
||||
PRUint32 mContentLength;
|
||||
void * mData;
|
||||
nsCOMPtr<nsIInputStreamPump> mPump;
|
||||
|
||||
virtual ~GeckoProtocolChannel();
|
||||
};
|
||||
|
||||
nsresult GeckoProtocolHandler::RegisterHandler(const char *aScheme, const char *aDescription, GeckoChannelCallback *aCallback)
|
||||
{
|
||||
if (!aScheme || !aCallback)
|
||||
@@ -97,45 +164,10 @@ nsresult GeckoProtocolHandler::RegisterHandler(const char *aScheme, const char *
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
class GeckoProtocolChannel :
|
||||
public nsIChannel,
|
||||
public nsIStreamListener
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIREQUEST
|
||||
NS_DECL_NSICHANNEL
|
||||
NS_DECL_NSIREQUESTOBSERVER
|
||||
NS_DECL_NSISTREAMLISTENER
|
||||
|
||||
GeckoProtocolChannel();
|
||||
nsresult Init(nsIURI *aURI);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIURI> mURI;
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsIProgressEventSink> mProgressSink;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
||||
nsCOMPtr<nsIStreamListener> mListener;
|
||||
nsCOMPtr<nsISupports> mListenerContext;
|
||||
nsCOMPtr<nsIInputStream> mContentStream;
|
||||
nsCString mContentType;
|
||||
nsCString mContentCharset;
|
||||
PRUint32 mLoadFlags;
|
||||
nsresult mStatus;
|
||||
PRUint32 mContentLength;
|
||||
void * mData;
|
||||
nsCOMPtr<nsIInputStreamPump> mPump;
|
||||
|
||||
virtual ~GeckoProtocolChannel();
|
||||
};
|
||||
|
||||
GeckoProtocolChannel::GeckoProtocolChannel() :
|
||||
mContentLength(0),
|
||||
mData(nsnull),
|
||||
mStatus(NS_OK),
|
||||
mStatus(NS_ERROR_FAILURE),
|
||||
mLoadFlags(LOAD_NORMAL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef GECKOPROTOCOLHANDLER_H
|
||||
#define GECKOPROTOCOLHANDLER_H
|
||||
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "GeckoWindow.h"
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef GECKOWND_H_270B94BB_E0EE_44bd_8983_CC43BFA39996
|
||||
#define GECKOWND_H_270B94BB_E0EE_44bd_8983_CC43BFA39996
|
||||
|
||||
@@ -17,6 +48,7 @@ public:
|
||||
GeckoWindow();
|
||||
virtual ~GeckoWindow();
|
||||
void SetGeckoContainer(GeckoContainer *aGeckoContainer);
|
||||
GeckoContainer *GetGeckoContainer() const { return mGeckoContainer; }
|
||||
};
|
||||
|
||||
#endif /* GECKOWND_H_270B94BB_E0EE_44bd_8983_CC43BFA39996 */
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "GeckoWindowCreator.h"
|
||||
#include "GeckoContainer.h"
|
||||
|
||||
@@ -19,8 +50,27 @@ GeckoWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *parent,
|
||||
nsIWebBrowserChrome **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
// AppCallbacks::CreateBrowserWindow(PRInt32(chromeFlags), parent, _retval);
|
||||
// TODO QI nsIGeckoContainer
|
||||
|
||||
*_retval = nsnull;
|
||||
return *_retval ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIGeckoContainer> geckoContainer = do_QueryInterface(parent);
|
||||
if (!geckoContainer)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCAutoString role;
|
||||
geckoContainer->GetRole(role);
|
||||
if (role.EqualsIgnoreCase("browser"))
|
||||
{
|
||||
GeckoContainerUI *pUI = NULL;
|
||||
geckoContainer->GetContainerUI(&pUI);
|
||||
if (pUI)
|
||||
{
|
||||
return pUI->CreateBrowserWindow(chromeFlags, parent, _retval);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef GECKOWINDOWCREATOR_H
|
||||
#define GECKOWINDOWCREATOR_H
|
||||
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "MailFrame.h"
|
||||
@@ -63,7 +94,6 @@ MailFrame::MailFrame(wxWindow* aParent) :
|
||||
gMailChannelCallbackRegistered = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Set up the article pane
|
||||
wxListCtrl *articleListCtrl = (wxListCtrl *) FindWindowById(XRCID("articles"), this);
|
||||
if (articleListCtrl)
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef MAILFRAME_H
|
||||
#define MAILFRAME_H
|
||||
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef GLOBAL_H_D5809FA6_E3E6_4726_9CD4_DE7330D9C2A1
|
||||
#define GLOBAL_H_D5809FA6_E3E6_4726_9CD4_DE7330D9C2A1
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ MOZINC = \
|
||||
-I$(MOZSDK)\include\profile \
|
||||
-I$(MOZSDK)\include\webbrwsr \
|
||||
-I$(MOZSDK)\include\embed_base \
|
||||
-I$(MOZSDK)\include\windowwatcher \
|
||||
$(NULL)
|
||||
|
||||
# This isn't much better either!
|
||||
|
||||
Reference in New Issue
Block a user