/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// See TaskbarProgress::SetPrimaryWindow: if we're running in headless // mode, mPrimaryWindow will be null. if (!mPrimaryWindow) { return NS_OK;
}
gulong progress;
if (aMaxValue == 0) {
progress = 0;
} else { // Rounding down to ensure we don't set to 'full' until the operation // is completely finished.
progress = (gulong)(((double)aCurrentValue / aMaxValue) * 100.0);
}
// Check if the resultant value is the same as the previous call, and // ignore this update if it is.
if (progress == mCurrentProgress) { return NS_OK;
}
// Only nsWindows have a native window, HeadlessWidgets do not. Stop here if // the window does not have one. if (!widget->GetNativeData(NS_NATIVE_WINDOW)) { return NS_OK;
}
// Clear our current progress. We get a forced update from the // DownloadsTaskbar after returning from this function - zeroing out our // progress will make sure the new window gets the property set on it // immediately, rather than waiting for the progress value to change (which // could be a while depending on size.)
mCurrentProgress = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.