Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: chrome/browser/resources/print_preview/print_preview_utils.js

Issue 7550022: Print Preview: Fixing behavior of event listeners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing kmadhusu's comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/print_preview_utils.js
diff --git a/chrome/browser/resources/print_preview/print_preview_utils.js b/chrome/browser/resources/print_preview/print_preview_utils.js
index 68e52243603b894dbc4cc06aec757c8bae2137f9..d759ed19a977551ed675203e0ce55511fc756e0a 100644
--- a/chrome/browser/resources/print_preview/print_preview_utils.js
+++ b/chrome/browser/resources/print_preview/print_preview_utils.js
@@ -189,3 +189,17 @@ function pageSetToPageRanges(pageSet) {
function getPageSrcURL(id, pageNumber) {
return 'chrome://print/' + id + '/' + pageNumber + '/print.pdf';
}
+
+
+/**
+ * Returns a random integer within the specified range, |endPointA| and
+ * |endPointB| are included.
+ * @param {number} endPointA One end of the desired range.
+ * @param {number} endPointB The other end of the desired range.
+ * @return {number} The random integer.
+ */
+function getRandomIntegerWithinRange(endPointA, endPointB) {
Lei Zhang 2011/08/10 03:26:07 I think most people call this function "randInt()"
dpapad 2011/08/10 15:47:10 Renamed to randomInteger() instead of randInt(). A
+ from = Math.min(endPointA, endPointB);
+ to = Math.max(endPointA, endPointB);
+ return Math.floor(Math.random() * (to - from + 1) + from);
+}
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698