add method to push necessary informaiton to implement Meta charset observeration
This commit is contained in:
Родитель
f853998b0b
Коммит
a5f6e74bb4
|
@ -251,8 +251,10 @@ public:
|
|||
|
||||
// nsIWebShellServices
|
||||
NS_IMETHOD LoadDocument(const char* aURL,
|
||||
const char* aCharset,
|
||||
nsCharsetSource aSource);
|
||||
const char* aCharset= nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized);
|
||||
NS_IMETHOD ReloadDocument(const char* aCharset= nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized);
|
||||
NS_IMETHOD StopDocumentLoad(void);
|
||||
NS_IMETHOD SetRendering(PRBool aRender);
|
||||
|
||||
|
@ -358,6 +360,8 @@ public:
|
|||
NS_IMETHOD GetDefaultCharacterSet (const PRUnichar** aDefaultCharacterSet);
|
||||
NS_IMETHOD SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet);
|
||||
|
||||
NS_IMETHOD GetCharacterSetHint (const PRUnichar** oHintCharset, nsCharsetSource* oSource);
|
||||
|
||||
protected:
|
||||
void InitFrameData(PRBool aCompleteInitScrolling);
|
||||
nsresult CheckForTrailingSlash(nsIURL* aURL);
|
||||
|
@ -413,6 +417,10 @@ protected:
|
|||
static nsIPluginManager *mPluginManager;
|
||||
static PRUint32 mPluginInitCnt;
|
||||
PRBool mProcessedEndDocumentLoad;
|
||||
|
||||
// XXX store mHintCharset and mHintCharsetSource here untill we find out a good cood path
|
||||
nsString mHintCharset;
|
||||
nsCharsetSource mHintCharsetSource;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -527,6 +535,8 @@ nsWebShell::nsWebShell()
|
|||
// XXX we should get such mDefaultCharacterSet from pref laster...
|
||||
mDefaultCharacterSet = "ISO-8859-1";
|
||||
mProcessedEndDocumentLoad = PR_FALSE;
|
||||
mHintCharset = "";
|
||||
mHintCharsetSource = kCharsetUninitialized;
|
||||
}
|
||||
|
||||
nsWebShell::~nsWebShell()
|
||||
|
@ -1981,11 +1991,26 @@ nsWebShell::LoadDocument(const char* aURL,
|
|||
const char* aCharset,
|
||||
nsCharsetSource aSource)
|
||||
{
|
||||
// XXX hack. kee the aCharset and aSource wait to pick it up
|
||||
mHintCharset = aCharset;
|
||||
mHintCharsetSource = aSource;
|
||||
|
||||
nsAutoString url(aURL);
|
||||
LoadURL(url.GetUnicode());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ReloadDocument(const char* aCharset,
|
||||
nsCharsetSource aSource)
|
||||
{
|
||||
// XXX hack. kee the aCharset and aSource wait to pick it up
|
||||
mHintCharset = aCharset;
|
||||
mHintCharsetSource= aSource;
|
||||
|
||||
return this->Reload(nsURLReload);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::StopDocumentLoad(void)
|
||||
{
|
||||
|
@ -2908,6 +2933,20 @@ nsWebShell::SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWebShell::GetCharacterSetHint (const PRUnichar** oHintCharset, nsCharsetSource* oSource)
|
||||
{
|
||||
*oSource = mHintCharsetSource;
|
||||
if(kCharsetUninitialized == mHintCharsetSource) {
|
||||
*oHintCharset = nsnull;
|
||||
} else {
|
||||
*oHintCharset = mHintCharset.GetUnicode();
|
||||
// clean up after we access it.
|
||||
mHintCharsetSource = kCharsetUninitialized;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound)
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "nsIContentViewerContainer.h"
|
||||
#include "nsILoadAttribs.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsIParser.h" // for nsCharsetSource only
|
||||
|
||||
|
||||
class nsIDOMElement;
|
||||
class nsIDOMWindow;
|
||||
|
@ -379,6 +381,10 @@ public:
|
|||
|
||||
NS_IMETHOD GetDefaultCharacterSet (const PRUnichar** aDefaultCharacterSet) = 0;
|
||||
NS_IMETHOD SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet) = 0;
|
||||
|
||||
/* the following is the hacky access method */
|
||||
NS_IMETHOD GetCharacterSetHint (const PRUnichar** oHintCharset, nsCharsetSource* oSource) = 0;
|
||||
|
||||
/**
|
||||
* Set/Get the document scale factor
|
||||
*/
|
||||
|
|
|
@ -36,8 +36,10 @@ public:
|
|||
static const nsIID& GetIID() { static nsIID iid = NS_IWEB_SHELL_SERVICES_IID; return iid; }
|
||||
|
||||
NS_IMETHOD LoadDocument(const char* aURL,
|
||||
const char* aCharset,
|
||||
nsCharsetSource aSource) = 0;
|
||||
const char* aCharset= nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized) = 0;
|
||||
NS_IMETHOD ReloadDocument(const char* aCharset = nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized) = 0;
|
||||
NS_IMETHOD StopDocumentLoad(void) = 0;
|
||||
NS_IMETHOD SetRendering(PRBool aRender) = 0;
|
||||
|
||||
|
|
|
@ -251,8 +251,10 @@ public:
|
|||
|
||||
// nsIWebShellServices
|
||||
NS_IMETHOD LoadDocument(const char* aURL,
|
||||
const char* aCharset,
|
||||
nsCharsetSource aSource);
|
||||
const char* aCharset= nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized);
|
||||
NS_IMETHOD ReloadDocument(const char* aCharset= nsnull ,
|
||||
nsCharsetSource aSource = kCharsetUninitialized);
|
||||
NS_IMETHOD StopDocumentLoad(void);
|
||||
NS_IMETHOD SetRendering(PRBool aRender);
|
||||
|
||||
|
@ -358,6 +360,8 @@ public:
|
|||
NS_IMETHOD GetDefaultCharacterSet (const PRUnichar** aDefaultCharacterSet);
|
||||
NS_IMETHOD SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet);
|
||||
|
||||
NS_IMETHOD GetCharacterSetHint (const PRUnichar** oHintCharset, nsCharsetSource* oSource);
|
||||
|
||||
protected:
|
||||
void InitFrameData(PRBool aCompleteInitScrolling);
|
||||
nsresult CheckForTrailingSlash(nsIURL* aURL);
|
||||
|
@ -413,6 +417,10 @@ protected:
|
|||
static nsIPluginManager *mPluginManager;
|
||||
static PRUint32 mPluginInitCnt;
|
||||
PRBool mProcessedEndDocumentLoad;
|
||||
|
||||
// XXX store mHintCharset and mHintCharsetSource here untill we find out a good cood path
|
||||
nsString mHintCharset;
|
||||
nsCharsetSource mHintCharsetSource;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -527,6 +535,8 @@ nsWebShell::nsWebShell()
|
|||
// XXX we should get such mDefaultCharacterSet from pref laster...
|
||||
mDefaultCharacterSet = "ISO-8859-1";
|
||||
mProcessedEndDocumentLoad = PR_FALSE;
|
||||
mHintCharset = "";
|
||||
mHintCharsetSource = kCharsetUninitialized;
|
||||
}
|
||||
|
||||
nsWebShell::~nsWebShell()
|
||||
|
@ -1981,11 +1991,26 @@ nsWebShell::LoadDocument(const char* aURL,
|
|||
const char* aCharset,
|
||||
nsCharsetSource aSource)
|
||||
{
|
||||
// XXX hack. kee the aCharset and aSource wait to pick it up
|
||||
mHintCharset = aCharset;
|
||||
mHintCharsetSource = aSource;
|
||||
|
||||
nsAutoString url(aURL);
|
||||
LoadURL(url.GetUnicode());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ReloadDocument(const char* aCharset,
|
||||
nsCharsetSource aSource)
|
||||
{
|
||||
// XXX hack. kee the aCharset and aSource wait to pick it up
|
||||
mHintCharset = aCharset;
|
||||
mHintCharsetSource= aSource;
|
||||
|
||||
return this->Reload(nsURLReload);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::StopDocumentLoad(void)
|
||||
{
|
||||
|
@ -2908,6 +2933,20 @@ nsWebShell::SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWebShell::GetCharacterSetHint (const PRUnichar** oHintCharset, nsCharsetSource* oSource)
|
||||
{
|
||||
*oSource = mHintCharsetSource;
|
||||
if(kCharsetUninitialized == mHintCharsetSource) {
|
||||
*oHintCharset = nsnull;
|
||||
} else {
|
||||
*oHintCharset = mHintCharset.GetUnicode();
|
||||
// clean up after we access it.
|
||||
mHintCharsetSource = kCharsetUninitialized;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound)
|
||||
|
|
Загрузка…
Ссылка в новой задаче