Commit 5e6204e6 authored by hirono@chromium.org's avatar hirono@chromium.org

Make the Viewport class pure model.

The CL removes the unused scaleControl proeprty in the view port class.

BUG=245926
TEST=None

Review URL: https://codereview.chromium.org/383583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282279 0039d316-1c4b-4281-b951-d872f2087c98
parent b11c08be
...@@ -18,7 +18,6 @@ function Viewport() { ...@@ -18,7 +18,6 @@ function Viewport() {
this.generation_ = 0; this.generation_ = 0;
this.scaleControl_ = null;
this.repaintCallbacks_ = []; this.repaintCallbacks_ = [];
this.update(); this.update();
} }
...@@ -27,20 +26,12 @@ function Viewport() { ...@@ -27,20 +26,12 @@ function Viewport() {
* Viewport modification. * Viewport modification.
*/ */
/**
* @param {Object} scaleControl The UI object responsible for scaling.
*/
Viewport.prototype.setScaleControl = function(scaleControl) {
this.scaleControl_ = scaleControl;
};
/** /**
* @param {number} width Image width. * @param {number} width Image width.
* @param {number} height Image height. * @param {number} height Image height.
*/ */
Viewport.prototype.setImageSize = function(width, height) { Viewport.prototype.setImageSize = function(width, height) {
this.imageBounds_ = new Rect(width, height); this.imageBounds_ = new Rect(width, height);
if (this.scaleControl_) this.scaleControl_.displayImageSize(width, height);
this.invalidateCaches(); this.invalidateCaches();
}; };
...@@ -50,8 +41,6 @@ Viewport.prototype.setImageSize = function(width, height) { ...@@ -50,8 +41,6 @@ Viewport.prototype.setImageSize = function(width, height) {
*/ */
Viewport.prototype.setScreenSize = function(width, height) { Viewport.prototype.setScreenSize = function(width, height) {
this.screenBounds_ = new Rect(width, height); this.screenBounds_ = new Rect(width, height);
if (this.scaleControl_)
this.scaleControl_.setMinScale(this.getFittingScale());
this.invalidateCaches(); this.invalidateCaches();
}; };
...@@ -90,7 +79,6 @@ Viewport.prototype.getScale = function() { return this.scale_; }; ...@@ -90,7 +79,6 @@ Viewport.prototype.getScale = function() { return this.scale_; };
Viewport.prototype.setScale = function(scale, notify) { Viewport.prototype.setScale = function(scale, notify) {
if (this.scale_ == scale) return; if (this.scale_ == scale) return;
this.scale_ = scale; this.scale_ = scale;
if (notify && this.scaleControl_) this.scaleControl_.displayScale(scale);
this.invalidateCaches(); this.invalidateCaches();
}; };
...@@ -110,7 +98,6 @@ Viewport.prototype.getFittingScale = function() { ...@@ -110,7 +98,6 @@ Viewport.prototype.getFittingScale = function() {
*/ */
Viewport.prototype.fitImage = function() { Viewport.prototype.fitImage = function() {
var scale = this.getFittingScale(); var scale = this.getFittingScale();
if (this.scaleControl_) this.scaleControl_.setMinScale(scale);
this.setScale(scale, true); this.setScale(scale, true);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment