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

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

Issue 8357009: Print Preview Cleanup: Creating enum with all custom events used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments. 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/margin_settings.js
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js
index 819d79fc0ede01d2eef1fc6b049990a3c7752efe..8a0c295b61840660a709cb82ffb345cb2ee64d62 100644
--- a/chrome/browser/resources/print_preview/margin_settings.js
+++ b/chrome/browser/resources/print_preview/margin_settings.js
@@ -286,13 +286,14 @@ cr.define('print_preview', function() {
*/
addEventListeners_: function() {
this.marginList_.onchange = this.onMarginsChanged_.bind(this);
- document.addEventListener('PDFLoaded', this.onPDFLoaded_.bind(this));
- document.addEventListener('PDFGenerationError',
+ document.addEventListener(customEvents.PDF_LOADED,
+ this.onPDFLoaded_.bind(this));
+ document.addEventListener(customEvents.PDF_GENERATION_ERROR,
this.onPDFGenerationError_.bind(this));
},
/**
- * Executes when an 'PDFGenerationError' event occurs.
+ * Executes when a |customEvents.PDF_GENERATION_ERROR| event occurs.
* @private
*/
onPDFGenerationError_: function() {
@@ -303,10 +304,10 @@ cr.define('print_preview', function() {
},
/**
- * Executes whenever a "DragEvent" occurs.
+ * Executes whenever a |customEvents.MARGINS_LINE_DRAG| occurs.
* @param {cr.Event} e The event that triggered this listener.
*/
- onDragEvent_: function(e) {
+ onMarginsLineDrag_: function(e) {
var dragDeltaInPoints = this.convertDragDeltaToPoints_(e.dragDelta);
this.marginsUI.lastClickedMarginsUIPair.updateWhileDragging(
dragDeltaInPoints, e.destinationPoint);
@@ -424,8 +425,10 @@ cr.define('print_preview', function() {
addCustomMarginEventListeners_: function() {
$('mainview').onmouseover = this.onMainviewMouseOver_.bind(this);
$('sidebar').onmouseover = this.onSidebarMouseOver_.bind(this);
- this.eventTracker_.add(
- this.marginsUI, 'DragEvent', this.onDragEvent_.bind(this), false);
+ this.eventTracker_.add(this.marginsUI,
+ customEvents.MARGINS_LINE_DRAG,
+ this.onMarginsLineDrag_.bind(this),
+ false);
},
/**
@@ -435,7 +438,7 @@ cr.define('print_preview', function() {
removeCustomMarginEventListeners_: function() {
$('mainview').onmouseover = null;
$('sidebar').onmouseover = null;
- this.eventTracker_.remove(this.marginsUI, 'DragEvent');
+ this.eventTracker_.remove(this.marginsUI, customEvents.MARGINS_LINE_DRAG);
this.marginsUI.hide();
},
@@ -594,7 +597,7 @@ cr.define('print_preview', function() {
},
/**
- * Executes when a PDFLoaded event occurs.
+ * Executes when a |customEvents.PDF_LOADED| event occurs.
* @private
*/
onPDFLoaded_: function() {

Powered by Google App Engine
This is Rietveld 408576698