зеркало из https://github.com/mozilla/gecko-dev.git
Bug 224209 - Correct filename on title when viewing an image from a PHP file. r=bz
This commit is contained in:
Родитель
5f99a47be9
Коммит
bf4efd8320
|
@ -781,7 +781,7 @@ ImageDocument::UpdateTitleAndCharset()
|
|||
"ImageTitleWithDimensions2AndFile",
|
||||
};
|
||||
|
||||
MediaDocument::UpdateTitleAndCharset(typeStr, formatNames,
|
||||
MediaDocument::UpdateTitleAndCharset(typeStr, mChannel, formatNames,
|
||||
mImageWidth, mImageHeight, status);
|
||||
}
|
||||
|
||||
|
|
|
@ -278,10 +278,16 @@ MediaDocument::StartLayout()
|
|||
}
|
||||
|
||||
void
|
||||
MediaDocument::GetFileName(nsAString& aResult)
|
||||
MediaDocument::GetFileName(nsAString& aResult, nsIChannel* aChannel)
|
||||
{
|
||||
aResult.Truncate();
|
||||
|
||||
if (aChannel) {
|
||||
aChannel->GetContentDispositionFilename(aResult);
|
||||
if (!aResult.IsEmpty())
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURL> url = do_QueryInterface(mDocumentURI);
|
||||
if (!url)
|
||||
return;
|
||||
|
@ -339,12 +345,13 @@ MediaDocument::LinkStylesheet(const nsAString& aStylesheet)
|
|||
|
||||
void
|
||||
MediaDocument::UpdateTitleAndCharset(const nsACString& aTypeStr,
|
||||
nsIChannel* aChannel,
|
||||
const char* const* aFormatNames,
|
||||
int32_t aWidth, int32_t aHeight,
|
||||
const nsAString& aStatus)
|
||||
{
|
||||
nsXPIDLString fileStr;
|
||||
GetFileName(fileStr);
|
||||
GetFileName(fileStr, aChannel);
|
||||
|
||||
NS_ConvertASCIItoUTF16 typeStr(aTypeStr);
|
||||
nsXPIDLString title;
|
||||
|
|
|
@ -48,7 +48,7 @@ protected:
|
|||
friend class MediaDocumentStreamListener;
|
||||
nsresult StartLayout();
|
||||
|
||||
void GetFileName(nsAString& aResult);
|
||||
void GetFileName(nsAString& aResult, nsIChannel* aChannel);
|
||||
|
||||
nsresult LinkStylesheet(const nsAString& aStylesheet);
|
||||
|
||||
|
@ -64,6 +64,7 @@ protected:
|
|||
// but could be in other units for other 'media', in which case you have to
|
||||
// define format names accordingly.
|
||||
void UpdateTitleAndCharset(const nsACString& aTypeStr,
|
||||
nsIChannel* aChannel,
|
||||
const char* const* aFormatNames = sFormatNames,
|
||||
int32_t aWidth = 0,
|
||||
int32_t aHeight = 0,
|
||||
|
|
|
@ -185,7 +185,7 @@ PluginDocument::StartDocumentLoad(const char* aCommand,
|
|||
return rv;
|
||||
}
|
||||
|
||||
MediaDocument::UpdateTitleAndCharset(mMimeType);
|
||||
MediaDocument::UpdateTitleAndCharset(mMimeType, aChannel);
|
||||
|
||||
mStreamListener = new PluginStreamListener(this);
|
||||
NS_ASSERTION(aDocListener, "null aDocListener");
|
||||
|
|
|
@ -128,7 +128,7 @@ VideoDocument::UpdateTitle(nsIChannel* aChannel)
|
|||
return;
|
||||
|
||||
nsAutoString fileName;
|
||||
GetFileName(fileName);
|
||||
GetFileName(fileName, aChannel);
|
||||
SetTitle(fileName);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче