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

Unified Diff: chrome/test/data/webui/print_preview/plugin_stub.js

Issue 2969383003: Print Preview: Finish removing global Javascript functions. (Closed)
Patch Set: Address comments Created 3 years, 5 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
Index: chrome/test/data/webui/print_preview/plugin_stub.js
diff --git a/chrome/test/data/webui/print_preview/plugin_stub.js b/chrome/test/data/webui/print_preview/plugin_stub.js
index 1c141b928627d7b020d6888aacc81c01a0a05fd3..6e3d3394bb17cfcc7d138e4602cca2ed41097888 100644
--- a/chrome/test/data/webui/print_preview/plugin_stub.js
+++ b/chrome/test/data/webui/print_preview/plugin_stub.js
@@ -17,15 +17,6 @@ cr.define('print_preview', function() {
*/
this.loadCallback_ = null;
- /** @private {!EventTracker} The plugin stub's event tracker. */
- this.tracker_ = new EventTracker();
-
- // Call documentLoadComplete as soon as the preview area starts the
- // preview.
- this.tracker_.add(
- area,
- print_preview.PreviewArea.EventType.PREVIEW_GENERATION_IN_PROGRESS,
- this.documentLoadComplete.bind(this));
}
/**
@@ -36,11 +27,6 @@ cr.define('print_preview', function() {
this.loadCallback_ = callback;
}
- documentLoadComplete() {
- if (this.loadCallback_)
- this.loadCallback_();
- }
-
/**
* Stubbed out since some tests result in a call.
* @param {string} url The url to initialize the plugin to.
@@ -49,6 +35,17 @@ cr.define('print_preview', function() {
* @param {boolean} modifiable Whether the source document is modifiable.
*/
resetPrintPreviewMode(url, color, pages, modifiable) {}
+
+ /**
+ * Called when the preview area wants the plugin to load a preview page.
+ * Immediately calls loadCallback_().
+ * @param {string} url The preview URL
+ * @param {number} index The index of the page number to load.
+ */
+ loadPreviewPage(url, index) {
+ if (this.loadCallback_)
+ this.loadCallback_();
+ }
}
return {PDFPluginStub: PDFPluginStub};

Powered by Google App Engine
This is Rietveld 408576698