Backing out part of last checkin that wasn't supposed to be checked in.

This commit is contained in:
jst%netscape.com 2001-09-21 04:33:47 +00:00
parent 3610e1ce49
commit fcbfe8e3e8
3 changed files with 28 additions and 0 deletions

View File

@ -78,6 +78,7 @@ interface nsIDOMWindowInternal : nsIDOMWindow
// XXX: The setter that takes a string argument needs to be special
// cased!
readonly attribute nsIDOMLocation location;
attribute DOMString title;
attribute long innerWidth;
attribute long innerHeight;

View File

@ -1130,6 +1130,32 @@ NS_IMETHODIMP GlobalWindowImpl::SetName(const nsAReadableString& aName)
return result;
}
NS_IMETHODIMP
GlobalWindowImpl::GetTitle(nsAWritableString& aTitle)
{
aTitle = mTitle;
return NS_OK;
}
NS_IMETHODIMP
GlobalWindowImpl::SetTitle(const nsAReadableString& aTitle)
{
mTitle = aTitle;
if(mDocShell) {
// See if we're a chrome shell.
PRInt32 type;
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mDocShell));
docShellAsItem->GetItemType(&type);
if(type == nsIDocShellTreeItem::typeChrome) {
nsCOMPtr<nsIBaseWindow> docShellAsWin(do_QueryInterface(mDocShell));
if(docShellAsWin) {
docShellAsWin->SetTitle(PromiseFlatString(mTitle).get());
}
}
}
return NS_OK;
}
NS_IMETHODIMP GlobalWindowImpl::GetInnerWidth(PRInt32* aInnerWidth)
{
FlushPendingNotifications();

View File

@ -252,6 +252,7 @@ protected:
PRPackedBool mIsDocumentLoaded; // true between onload and onunload events
nsString mStatus;
nsString mDefaultStatus;
nsString mTitle;
nsIScriptGlobalObjectOwner* mGlobalObjectOwner; // Weak Reference
nsIDocShell* mDocShell; // Weak Reference