Bug 463253 - Application name displayed in title bar; r=mconnor

This commit is contained in:
Ehsan Akhgari 2008-12-06 14:14:32 +03:30
parent 33a6e0cc53
commit e4f3e7f491
5 changed files with 22 additions and 20 deletions

View File

@ -6911,16 +6911,10 @@ let gPrivateBrowsingUI = {
if (!this._privateBrowsingAutoStarted) {
// Adjust the window's title
let docElement = document.documentElement;
#ifdef XP_MACOSX // see bug 411929 comment 38 for the reason behind this
docElement.setAttribute("titlemodifier",
docElement.getAttribute("titlemodifier_privatebrowsing"));
docElement.setAttribute("titledefault", "");
#else
docElement.setAttribute("title",
docElement.getAttribute("title_privatebrowsing"));
docElement.setAttribute("titlemodifier",
docElement.getAttribute("titlemodifier_privatebrowsing"));
#endif
docElement.setAttribute("browsingmode", "private");
}
else {
@ -6945,16 +6939,10 @@ let gPrivateBrowsingUI = {
if (!this._privateBrowsingAutoStarted) {
// Adjust the window's title
let docElement = document.documentElement;
#ifdef XP_MACOSX // see bug 411929 comment 38 for the reason behind this
docElement.setAttribute("titlemodifier", "");
docElement.setAttribute("titledefault",
docElement.getAttribute("titlemodifier_normal"));
#else
docElement.setAttribute("title",
docElement.getAttribute("title_normal"));
docElement.setAttribute("titlemodifier",
docElement.getAttribute("titlemodifier_normal"));
#endif
docElement.setAttribute("browsingmode", "normal");
}
else

View File

@ -30,6 +30,7 @@
# Dean Tessman <dean_tessman@hotmail.com>
# Johnathan Nightingale <johnath@mozilla.com>
# Dão Gottwald <dao@mozilla.com>
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -67,10 +68,18 @@
onload="BrowserStartup()" onunload="BrowserShutdown()" onclose="return WindowIsClosing();"
title="&mainWindow.title;"
title_normal="&mainWindow.title;"
title_privatebrowsing="&mainWindowPrivateBrowsing.titlemodifier;"
#ifdef XP_MACOSX
title_privatebrowsing="&mainWindow.title;&mainWindow.titlemodifiermenuseparator;&mainWindow.titlePrivateBrowsingSuffix;"
titledefault="&mainWindow.title;"
titlemodifier=""
titlemodifier_normal=""
titlemodifier_privatebrowsing="&mainWindow.titlePrivateBrowsingSuffix;"
#else
title_privatebrowsing="&mainWindow.titlemodifierPrivateBrowsing;"
titlemodifier="&mainWindow.titlemodifier;"
titlemodifier_normal="&mainWindow.titlemodifier;"
titlemodifier_privatebrowsing="&mainWindowPrivateBrowsing.titlemodifier;"
titlemodifier_privatebrowsing="&mainWindow.titlemodifierPrivateBrowsing;"
#endif
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
windowtype="navigator:browser"
screenX="4" screenY="4"

View File

@ -49,7 +49,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
#ifdef XP_MACOSX
<title></title>
#else
<title>&privatebrowsingpage.tabtitle;</title>
#endif
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
<link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
<link rel="icon" type="image/png" href="chrome://browser/skin/Privacy-16.png"/>

View File

@ -56,11 +56,10 @@ function test() {
getService(Ci.nsIObserverService);
os.addObserver(observer, "private-browsing", false);
let pbMenuItem = document.getElementById("privateBrowsingItem");
// add a new blank tab to ensure the title
// add a new blank tab to ensure the title can be meaningfully compared later
let blankTab = gBrowser.addTab();
gBrowser.selectedTab = blankTab;
let originalTitle = document.title;
let privateBrowsingTitle = document.documentElement.getAttribute("titlemodifier_privatebrowsing");
// test the gPrivateBrowsingUI object
ok(gPrivateBrowsingUI, "The gPrivateBrowsingUI object exists");
@ -83,7 +82,7 @@ function test() {
// check to see if the Private Browsing mode was activated successfully
is(observer.data, "enter", "Private Browsing mode was activated using the command object");
// check to see that the window title has been changed correctly
is(document.title, privateBrowsingTitle, "Private browsing mode has correctly changed the title");
isnot(document.title, originalTitle, "Private browsing mode has correctly changed the title");
func.call(cmd);
// check to see if the Private Browsing mode was deactivated successfully
is(observer.data, "exit", "Private Browsing mode was deactivated using the command object");

View File

@ -7,9 +7,11 @@
<!ENTITY mainWindow.titlemodifier "&brandFullName;">
<!-- LOCALIZATION NOTE (mainWindow.titlemodifiermenuseparator): DONT_TRANSLATE -->
<!ENTITY mainWindow.titlemodifiermenuseparator " - ">
<!-- LOCALIZATION NOTE (mainWindowPrivateBrowsing.titlemodifier): This will be appended to the window's title
inside the private browsing mode -->
<!ENTITY mainWindowPrivateBrowsing.titlemodifier "&mainWindow.titlemodifier; (Private Browsing)">
<!-- LOCALIZATION NOTE (mainWindow.titlePrivateBrowsingSuffix): This will be appended to the window's title
inside the private browsing mode -->
<!ENTITY mainWindow.titlePrivateBrowsingSuffix "(Private Browsing)">
<!-- LOCALIZATION NOTE (mainWindowPrivateBrowsing.titlemodifier): DONT_TRANSLATE -->
<!ENTITY mainWindow.titlemodifierPrivateBrowsing "&mainWindow.titlemodifier; &mainWindow.titlePrivateBrowsingSuffix;">
<!ENTITY tabCmd.label "New Tab">
<!ENTITY tabCmd.accesskey "T">