mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
Bug #33156 --> finish new nsIWebProgress work --> implement real progress as a percentage of the document download.
This commit is contained in:
parent
c298286ee9
commit
fefb1bfe79
@ -199,6 +199,22 @@ nsXULBrowserWindow.prototype =
|
||||
overLink = link;
|
||||
UpdateStatusField();
|
||||
},
|
||||
onProgress : function (channel, current, max)
|
||||
{
|
||||
if(!statusMeter)
|
||||
statusMeter = document.getElementById("statusbar-icon");
|
||||
var percentage = 0;
|
||||
if (max > 0)
|
||||
{
|
||||
percentage = (current * 100) / max ;
|
||||
statusMeter.setAttribute("mode", "normal");
|
||||
statusMeter.value = percentage;
|
||||
statusMeter.progresstext = Math.round(percentage) + "%";
|
||||
}
|
||||
else
|
||||
statusMeter.setAttribute("mode","undetermined");
|
||||
|
||||
},
|
||||
onStatusChange : function(channel, status)
|
||||
{
|
||||
if(!throbberElement)
|
||||
@ -227,8 +243,10 @@ nsXULBrowserWindow.prototype =
|
||||
defaultStatus = msg;
|
||||
UpdateStatusField();
|
||||
window.XULBrowserWindow.setDefaultStatus(msg);
|
||||
// Turn progress meter off.
|
||||
statusMeter.setAttribute("mode","normal");
|
||||
// Turn progress meter off.
|
||||
statusMeter.setAttribute("mode","normal");
|
||||
statusMeter.value = 0; // be sure to clear the progress bar
|
||||
statusMeter.progresstext = "";
|
||||
throbberElement.setAttribute("busy", false);
|
||||
}
|
||||
else if(status & Components.interfaces.nsIWebProgress.flag_net_dns)
|
||||
|
Loading…
Reference in New Issue
Block a user