mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
PHOTON BUILD only
Fixes some compile issues.
This commit is contained in:
parent
c18bef674f
commit
840203786f
@ -58,6 +58,7 @@ EmbedContentListener::OnStartURIOpen(nsIURI *aURI,
|
||||
PtCallbackList_t *cb = NULL;
|
||||
PtCallbackInfo_t cbinfo;
|
||||
PtMozillaUrlCb_t url;
|
||||
nsCAutoString specString;
|
||||
|
||||
if (!moz->open_cb)
|
||||
return NS_OK;
|
||||
@ -66,7 +67,9 @@ EmbedContentListener::OnStartURIOpen(nsIURI *aURI,
|
||||
cbinfo.cbdata = &url;
|
||||
cbinfo.reason = Pt_CB_MOZ_OPEN;
|
||||
cb = moz->open_cb;
|
||||
aURI->GetSpec(&(url.url));
|
||||
|
||||
aURI->GetSpec(specString);
|
||||
url.url = (char *) specString.get();
|
||||
|
||||
if (PtInvokeCallbackList(cb, (PtWidget_t *) moz, &cbinfo) == Pt_END)
|
||||
{
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include <nsIChromeEventHandler.h>
|
||||
#include <nsIContentViewer.h>
|
||||
#include <nsIContentViewerEdit.h>
|
||||
#include <nsIWebBrowserSetup.h>
|
||||
#include "nsIWebBrowserPrint.h"
|
||||
#include "nsIClipboardCommands.h"
|
||||
#include "docshell/nsCDefaultURIFixup.h"
|
||||
@ -64,6 +65,7 @@
|
||||
|
||||
// for profiles
|
||||
#include <nsMPFileLocProvider.h>
|
||||
#include "nsIWebBrowserPrint.h"
|
||||
#include "nsIPrintOptions.h"
|
||||
|
||||
// all of our local includes
|
||||
@ -208,6 +210,11 @@ EmbedPrivate::Setup()
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
// Configure what the web browser can and cannot do
|
||||
PRBool aAllowPlugins = PR_TRUE;
|
||||
nsCOMPtr<nsIWebBrowserSetup> webBrowserAsSetup(do_QueryInterface(webBrowser));
|
||||
webBrowserAsSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_PLUGINS, aAllowPlugins);
|
||||
|
||||
// get a handle on the navigation object
|
||||
mNavigation = do_QueryInterface(webBrowser);
|
||||
|
||||
@ -234,9 +241,9 @@ EmbedPrivate::Setup()
|
||||
uriListener = do_QueryInterface(mContentListenerGuard);
|
||||
webBrowser->SetParentURIContentListener(uriListener);
|
||||
|
||||
nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(webBrowser));
|
||||
nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(webBrowser));
|
||||
if (print)
|
||||
print->GetPrintSettings(getter_AddRefs(m_PrintSettings));
|
||||
print->GetNewPrintSettings(getter_AddRefs(m_PrintSettings));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -521,11 +528,12 @@ EmbedPrivate::Clear()
|
||||
void
|
||||
EmbedPrivate::Print(PpPrintContext_t *pc)
|
||||
{
|
||||
nsCOMPtr<nsIWebBrowserPrint> print = do_GetInterface(mWindow->mWebBrowser);
|
||||
if (print) {
|
||||
m_PrintSettings->SetEndPageRange((PRInt32) pc);
|
||||
print->Print(m_PrintSettings, mPrint);
|
||||
}
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
mWindow->mWebBrowser->GetContentDOMWindow(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIWebBrowserPrint> print( do_GetInterface( mWindow->mWebBrowser ) );
|
||||
|
||||
m_PrintSettings->SetEndPageRange((PRInt32) pc);
|
||||
print->Print(m_PrintSettings, mPrint);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <nsILocalFile.h>
|
||||
#include <nsIRequestObserver.h>
|
||||
#include <nsISocketTransportService.h>
|
||||
#include <netCore.h>
|
||||
#include "nsGfxCIID.h"
|
||||
|
||||
#include "EmbedWindow.h"
|
||||
@ -75,11 +76,13 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
|
||||
PtMozillaWidget_t *moz = (PtMozillaWidget_t *) mOwner->mOwningWidget;
|
||||
PtCallbackList_t *cb = NULL;
|
||||
PtCallbackInfo_t cbinfo;
|
||||
PRUnichar *url;
|
||||
PtMozillaNetStateCb_t state;
|
||||
|
||||
aRequest->GetName( &url );
|
||||
nsString surl( url );
|
||||
// get the uri for this request
|
||||
nsXPIDLCString uriString;
|
||||
RequestToURIString(aRequest, getter_Copies(uriString));
|
||||
nsString tmpString;
|
||||
tmpString.AssignWithConversion(uriString);
|
||||
|
||||
if( ( aStateFlags & STATE_IS_NETWORK ) && NS_FAILED( aStatus ) )
|
||||
{
|
||||
@ -92,10 +95,7 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
|
||||
cbinfo.cbdata = &cbw;
|
||||
|
||||
memset( &cbw, 0, sizeof( PtWebErrorCallback_t ) );
|
||||
char *s = ToNewCString(surl);
|
||||
strcpy( cbw.url, s );
|
||||
free( s );
|
||||
|
||||
strcpy(cbw.url, (const char *)uriString);
|
||||
|
||||
cbw.type = WWW_ERROR_TOPVIEW;
|
||||
switch( aStatus )
|
||||
@ -183,9 +183,7 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
|
||||
cbinfo.reason = Pt_CB_MOZ_COMPLETE;
|
||||
cbinfo.cbdata = &cbcomplete;
|
||||
memset( &cbcomplete, 0, sizeof( PtWebCompleteCallback_t ) );
|
||||
char *s = ToNewCString(surl);
|
||||
strcpy( cbcomplete.url, s );
|
||||
free( s );
|
||||
strcpy(cbcomplete.url, (const char *)uriString);
|
||||
|
||||
if( ( cb = moz->complete_cb ) )
|
||||
PtInvokeCallbackList(cb, (PtWidget_t *) moz, &cbinfo);
|
||||
@ -197,7 +195,7 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
|
||||
cbinfo.cbdata = &state;
|
||||
state.flags = aStateFlags;
|
||||
state.status = aStatus;
|
||||
state.url = (char *)ToNewCString(surl);
|
||||
state.url = (const char *)uriString;
|
||||
char *statusMessage = "";
|
||||
PRInt32 flags = aStateFlags;
|
||||
|
||||
@ -270,10 +268,10 @@ EmbedProgress::OnLocationChange(nsIWebProgress *aWebProgress,
|
||||
PtCallbackList_t *cb = NULL;
|
||||
PtCallbackInfo_t cbinfo;
|
||||
PtMozillaUrlCb_t url;
|
||||
char *uri;
|
||||
nsCAutoString newURI;
|
||||
|
||||
aLocation->GetSpec(&uri);
|
||||
mOwner->SetURI(uri);
|
||||
aLocation->GetSpec(newURI);
|
||||
mOwner->SetURI(newURI.get());
|
||||
|
||||
if (!moz->url_cb)
|
||||
return NS_OK;
|
||||
@ -281,7 +279,8 @@ EmbedProgress::OnLocationChange(nsIWebProgress *aWebProgress,
|
||||
memset(&cbinfo, 0, sizeof(cbinfo));
|
||||
cbinfo.cbdata = &url;
|
||||
cbinfo.reason = Pt_CB_MOZ_URL;
|
||||
aLocation->GetSpec(&(url.url));
|
||||
url.url = (char *) newURI.get();
|
||||
// aLocation->GetSpec(&(url.url));
|
||||
cb = moz->url_cb;
|
||||
PtInvokeCallbackList(cb, (PtWidget_t *) moz, &cbinfo);
|
||||
|
||||
@ -330,21 +329,19 @@ EmbedProgress::OnSecurityChange(nsIWebProgress *aWebProgress,
|
||||
void
|
||||
EmbedProgress::RequestToURIString(nsIRequest *aRequest, char **aString)
|
||||
{
|
||||
// is it a channel
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
channel = do_QueryInterface(aRequest);
|
||||
if (!channel)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
channel->GetURI(getter_AddRefs(uri));
|
||||
if (!uri)
|
||||
return;
|
||||
|
||||
nsXPIDLCString uriString;
|
||||
uri->GetSpec(getter_Copies(uriString));
|
||||
if (!uriString)
|
||||
return;
|
||||
// is it a channel
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
channel = do_QueryInterface(aRequest);
|
||||
if (!channel)
|
||||
return;
|
||||
|
||||
*aString = nsCRT::strdup((const char *)uriString);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
channel->GetURI(getter_AddRefs(uri));
|
||||
if (!uri)
|
||||
return;
|
||||
|
||||
nsCAutoString uriString;
|
||||
uri->GetSpec(uriString);
|
||||
|
||||
*aString = strdup(uriString.get());
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Christopher Blizzard <blizzard@mozilla.org>
|
||||
* Brian Edmond <briane@qnx.com>
|
||||
*/
|
||||
|
||||
#include <nsIPipe.h>
|
||||
@ -69,12 +68,9 @@ EmbedStream::Init(void)
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mInputStream = do_QueryInterface(bufInStream, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
mOutputStream = do_QueryInterface(bufOutStream, &rv);
|
||||
return rv;
|
||||
mInputStream = bufInStream;
|
||||
mOutputStream = bufOutStream;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
@ -121,7 +117,8 @@ EmbedStream::OpenStream(const char *aBaseURI, const char *aContentType)
|
||||
// create a new input stream channel
|
||||
rv = NS_NewInputStreamChannel(getter_AddRefs(mChannel), uri,
|
||||
NS_STATIC_CAST(nsIInputStream *, this),
|
||||
aContentType,
|
||||
nsDependentCString(aContentType),
|
||||
NS_LITERAL_CSTRING(""),
|
||||
1024); /* len */
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
@ -175,7 +172,7 @@ EmbedStream::OpenStream(const char *aBaseURI, const char *aContentType)
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
EmbedStream::AppendToStream(const char *aData, PRInt32 aLen)
|
||||
EmbedStream::AppendToStream(const char *aData, int aLen)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Christopher Blizzard <blizzard@mozilla.org>
|
||||
* Brian Edmond <briane@qnx.com>
|
||||
*/
|
||||
|
||||
#include <nsISupports.h>
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIHistoryEntry.h"
|
||||
|
||||
#include "nsIWebBrowserPrint.h"
|
||||
#include "nsIPrintOptions.h"
|
||||
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
@ -307,21 +308,20 @@ mozilla_modify( PtWidget_t *widget, PtArg_t const *argt )
|
||||
moz->EmbedRef->Back();
|
||||
else
|
||||
{
|
||||
PhDim_t dim;
|
||||
PhDim_t dim;
|
||||
|
||||
PtWidgetDim(widget, &dim);
|
||||
dim.w = (argt->value * dim.w)/100;
|
||||
dim.h = (argt->value * dim.h)/100;
|
||||
printf("Scroll: V: %d P: (%d, %d) \n", argt->value, dim.w, dim.h);
|
||||
PtWidgetDim(widget, &dim);
|
||||
dim.w = (argt->value * dim.w)/100;
|
||||
dim.h = (argt->value * dim.h)/100;
|
||||
|
||||
if (argt->value == WWW_DIRECTION_UP)
|
||||
moz->EmbedRef->ScrollUp(dim.h);
|
||||
else if (argt->value == WWW_DIRECTION_DOWN)
|
||||
moz->EmbedRef->ScrollDown(dim.h);
|
||||
else if (argt->value == WWW_DIRECTION_LEFT)
|
||||
moz->EmbedRef->ScrollLeft(dim.w);
|
||||
else if (argt->value == WWW_DIRECTION_RIGHT)
|
||||
moz->EmbedRef->ScrollRight(dim.w);
|
||||
if (argt->value == WWW_DIRECTION_UP)
|
||||
moz->EmbedRef->ScrollUp(dim.h);
|
||||
else if (argt->value == WWW_DIRECTION_DOWN)
|
||||
moz->EmbedRef->ScrollDown(dim.h);
|
||||
else if (argt->value == WWW_DIRECTION_LEFT)
|
||||
moz->EmbedRef->ScrollLeft(dim.w);
|
||||
else if (argt->value == WWW_DIRECTION_RIGHT)
|
||||
moz->EmbedRef->ScrollRight(dim.w);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -500,7 +500,6 @@ mozilla_get_info(PtWidget_t *widget, PtArg_t *argt)
|
||||
{
|
||||
PtMozillaWidget_t *moz = (PtMozillaWidget_t *) widget;
|
||||
nsIPref *pref = moz->EmbedRef->GetPrefs();
|
||||
int retval;
|
||||
|
||||
switch (argt->type)
|
||||
{
|
||||
@ -555,9 +554,9 @@ mozilla_get_info(PtWidget_t *widget, PtArg_t *argt)
|
||||
strncpy( HistoryReplyBuf[j].title, ToNewCString(stitle), 127 );
|
||||
HistoryReplyBuf[j].title[127] = '\0';
|
||||
|
||||
char *urlspec;
|
||||
url->GetSpec( &urlspec );
|
||||
strcpy( HistoryReplyBuf[j].url, urlspec );
|
||||
nsCAutoString specString;
|
||||
url->GetSpec(specString);
|
||||
strcpy( HistoryReplyBuf[j].url, (char *) specString.get() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1015,7 +1014,8 @@ StartupEmbedding()
|
||||
|
||||
profile_dir = (char *)alloca(strlen(getenv("HOME")) + strlen("/.ph") + 1);
|
||||
sprintf(profile_dir, "%s/.ph", getenv("HOME"));
|
||||
rv = StartupProfile(profile_dir, "mozilla");
|
||||
//rv = StartupProfile(profile_dir, "mozilla");
|
||||
rv = StartupProfile("/home/briane", ".mozilla");
|
||||
if (NS_FAILED(rv))
|
||||
NS_WARNING("Warning: Failed to start up profiles.\n");
|
||||
|
||||
@ -1097,7 +1097,7 @@ PtWidgetClass_t *PtCreateMozillaClass( void )
|
||||
if (StartupEmbedding() == -1)
|
||||
return (NULL);
|
||||
|
||||
Init_nsUnknownContentTypeHandler_Factory( );
|
||||
// Init_nsUnknownContentTypeHandler_Factory( );
|
||||
|
||||
nsCOMPtr<nsIFactory> promptFactory;
|
||||
NS_NewPromptServiceFactory(getter_AddRefs(promptFactory));
|
||||
|
@ -174,7 +174,7 @@ typedef struct mozilla_net_state_t
|
||||
{
|
||||
int flags;
|
||||
unsigned int status;
|
||||
char *url;
|
||||
const char *url;
|
||||
char *message;
|
||||
} PtMozillaNetStateCb_t;
|
||||
|
||||
|
@ -100,8 +100,11 @@ NS_IMETHODIMP nsUnknownContentTypeHandler::Show( nsIHelperAppLauncher *aLauncher
|
||||
PRInt64 dummy;
|
||||
nsCOMPtr<nsIFile> aFile;
|
||||
aLauncher->GetDownloadInfo( getter_AddRefs(aSourceUrl), &dummy, getter_AddRefs(aFile) );
|
||||
|
||||
char *url;
|
||||
aSourceUrl->GetSpec( &url );
|
||||
nsCAutoString specString;
|
||||
aSourceUrl->GetSpec(specString);
|
||||
url = (char *) specString.get();
|
||||
|
||||
PtCallbackInfo_t cbinfo;
|
||||
PtWebUnknownCallback_t cb;
|
||||
@ -226,7 +229,7 @@ NS_IMETHODIMP className::QueryInterface( REFNSIID anIID, void **anInstancePtr )
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR( nsUnknownContentTypeHandler )
|
||||
|
||||
// The list of components we register
|
||||
static const nsModuleComponentInfo info[] = {
|
||||
static nsModuleComponentInfo info[] = {
|
||||
"nsUnknownContentTypeHandler",
|
||||
NS_IHELPERAPPLAUNCHERDIALOG_IID,
|
||||
NS_IHELPERAPPLAUNCHERDLG_CONTRACTID,
|
||||
|
Loading…
Reference in New Issue
Block a user