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

Unified Diff: ui/file_manager/gallery/js/image_editor/viewport.js

Issue 383583003: Make the Viewport class pure model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/image_editor/viewport.js
diff --git a/ui/file_manager/gallery/js/image_editor/viewport.js b/ui/file_manager/gallery/js/image_editor/viewport.js
index 1ba7a4037d5bb6cba0e0916c408d0608179cae92..7b52f5e0243f5065de704b952cf3b228cbde3009 100644
--- a/ui/file_manager/gallery/js/image_editor/viewport.js
+++ b/ui/file_manager/gallery/js/image_editor/viewport.js
@@ -18,7 +18,6 @@ function Viewport() {
this.generation_ = 0;
- this.scaleControl_ = null;
this.repaintCallbacks_ = [];
this.update();
}
@@ -28,19 +27,11 @@ function Viewport() {
*/
/**
- * @param {Object} scaleControl The UI object responsible for scaling.
- */
-Viewport.prototype.setScaleControl = function(scaleControl) {
- this.scaleControl_ = scaleControl;
-};
-
-/**
* @param {number} width Image width.
* @param {number} height Image height.
*/
Viewport.prototype.setImageSize = function(width, height) {
this.imageBounds_ = new Rect(width, height);
- if (this.scaleControl_) this.scaleControl_.displayImageSize(width, height);
this.invalidateCaches();
};
@@ -50,8 +41,6 @@ Viewport.prototype.setImageSize = function(width, height) {
*/
Viewport.prototype.setScreenSize = function(width, height) {
this.screenBounds_ = new Rect(width, height);
- if (this.scaleControl_)
- this.scaleControl_.setMinScale(this.getFittingScale());
this.invalidateCaches();
};
@@ -90,7 +79,6 @@ Viewport.prototype.getScale = function() { return this.scale_; };
Viewport.prototype.setScale = function(scale, notify) {
if (this.scale_ == scale) return;
this.scale_ = scale;
- if (notify && this.scaleControl_) this.scaleControl_.displayScale(scale);
this.invalidateCaches();
};
@@ -110,7 +98,6 @@ Viewport.prototype.getFittingScale = function() {
*/
Viewport.prototype.fitImage = function() {
var scale = this.getFittingScale();
- if (this.scaleControl_) this.scaleControl_.setMinScale(scale);
this.setScale(scale, true);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698