mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 43714 Tooltip for the 'Home' button not updated when setting page via prefs
r=biesi, sr=bzbarsky Register a pref callback in navigator.js.
This commit is contained in:
parent
3745f63a12
commit
6fd77937f3
@ -114,6 +114,21 @@ const gTabStripPrefListener =
|
||||
}
|
||||
};
|
||||
|
||||
const gHomepagePrefListener =
|
||||
{
|
||||
domain: "browser.startup.homepage",
|
||||
observe: function(subject, topic, prefName)
|
||||
{
|
||||
// verify that we're changing the home page pref
|
||||
if (topic != "nsPref:changed")
|
||||
return;
|
||||
|
||||
var homePage = getHomePage();
|
||||
if (homePage)
|
||||
setTooltipText("home-button", homePage);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Pref listener handler functions.
|
||||
* Both functions assume that observer.domain is set to
|
||||
@ -361,6 +376,7 @@ function Startup()
|
||||
|
||||
addPrefListener(gButtonPrefListener);
|
||||
addPrefListener(gTabStripPrefListener);
|
||||
addPrefListener(gHomepagePrefListener);
|
||||
|
||||
window.browserContentListener =
|
||||
new nsBrowserContentListener(window, getBrowser());
|
||||
@ -558,6 +574,7 @@ function Shutdown()
|
||||
// unregister us as a pref listener
|
||||
removePrefListener(gButtonPrefListener);
|
||||
removePrefListener(gTabStripPrefListener);
|
||||
removePrefListener(gHomepagePrefListener);
|
||||
|
||||
window.browserContentListener.close();
|
||||
// Close the app core.
|
||||
|
@ -154,7 +154,6 @@ function openHomeDialog(aURL)
|
||||
|
||||
if (pressedVal == 0) {
|
||||
nsPreferences.setUnicharPref("browser.startup.homepage", aURL);
|
||||
setTooltipText("home-button", aURL);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user