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

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

Issue 8233030: Print Preview: Making margin lines draggable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 2 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/browser/resources/print_preview/preview_area.js
diff --git a/chrome/browser/resources/print_preview/preview_area.js b/chrome/browser/resources/print_preview/preview_area.js
index 88a419230af7e9077574722a1e00611660eea51b..af191ae7c7c1c9ab5ad1711096b910a4ca36c534 100644
--- a/chrome/browser/resources/print_preview/preview_area.js
+++ b/chrome/browser/resources/print_preview/preview_area.js
@@ -24,6 +24,12 @@ cr.define('print_preview', function() {
// before a new preview is requested so that the scroll amount can be
// restored later.
this.pageOffset_ = null;
+
+ // @type {print_preview.Rect} A rectangle describing the postion of the
+ // most visible page normalized with respect to the total height and width
+ // of the plugin.
+ this.pageLocationNormalized = null;
+
this.addEventListeners_();
}
@@ -78,17 +84,19 @@ cr.define('print_preview', function() {
},
/**
- * @return {print_preview.Rect} A rectangle describing the postion of the
- * most visible page normalized with respect to the total height and width
- * of the plugin.
+ * Queries the plugin for the location of the most visible page and updates
+ * |this.pageLocationNormalized|.
*/
- getPageLocationNormalized: function() {
+ update: function() {
+ if (!this.pdfLoaded_)
+ return;
var pluginLocation =
this.pdfPlugin_.getPageLocationNormalized().split(';');
- return new print_preview.Rect(parseFloat(pluginLocation[0]),
- parseFloat(pluginLocation[1]),
- parseFloat(pluginLocation[2]),
- parseFloat(pluginLocation[3]));
+ this.pageLocationNormalized = new print_preview.Rect(
+ parseFloat(pluginLocation[0]),
+ parseFloat(pluginLocation[1]),
+ parseFloat(pluginLocation[2]),
+ parseFloat(pluginLocation[3]));
},
/**
« no previous file with comments | « chrome/browser/resources/print_preview/margins_ui_pair.js ('k') | chrome/browser/resources/print_preview/print_preview.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698