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

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

Issue 382143004: Remove repaint callbacks from Viewport. (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
Index: ui/file_manager/gallery/js/image_editor/image_view.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_view.js b/ui/file_manager/gallery/js/image_editor/image_view.js
index ea6080f0943db01afbf0f813bb5b459947c832fd..23b32704c3f9d623041e8f76ee57e15dabab5a00 100644
--- a/ui/file_manager/gallery/js/image_editor/image_view.js
+++ b/ui/file_manager/gallery/js/image_editor/image_view.js
@@ -10,8 +10,11 @@
* @param {HTMLElement} container The container element.
* @param {Viewport} viewport The viewport.
* @constructor
+ * @extends {ImageBuffer.Overlay}
*/
function ImageView(container, viewport) {
+ ImageBuffer.Overlay.call(this);
+
this.container_ = container;
this.viewport_ = viewport;
this.document_ = container.ownerDocument;
@@ -89,13 +92,12 @@ ImageView.LOAD_TYPE_TOTAL = 5;
ImageView.prototype = {__proto__: ImageBuffer.Overlay.prototype};
/**
- * Draws below overlays with the default zIndex.
- * @return {number} Z-index.
+ * @override
*/
ImageView.prototype.getZIndex = function() { return -1; };
/**
- * Draws the image on screen.
+ * @override
*/
ImageView.prototype.draw = function() {
if (!this.contentCanvas_) // Do nothing if the image content is not set.
@@ -124,36 +126,6 @@ ImageView.prototype.draw = function() {
};
/**
- * @param {number} x X pointer position.
- * @param {number} y Y pointer position.
- * @param {boolean} mouseDown True if mouse is down.
- * @return {string} CSS cursor style.
- */
-ImageView.prototype.getCursorStyle = function(x, y, mouseDown) {
- // Indicate that the image is draggable.
- if (this.viewport_.isClipped() &&
- this.viewport_.getScreenClipped().inside(x, y))
- return 'move';
-
- return null;
-};
-
-/**
- * @param {number} x X pointer position.
- * @param {number} y Y pointer position.
- * @return {function} The closure to call on drag.
- */
-ImageView.prototype.getDragHandler = function(x, y) {
- var cursor = this.getCursorStyle(x, y);
- if (cursor === 'move') {
- // Return the handler that drags the entire image.
- return this.viewport_.createOffsetSetter(x, y);
- }
-
- return null;
-};
-
-/**
* @return {number} The cache generation.
*/
ImageView.prototype.getCacheGeneration = function() {
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_editor.js ('k') | ui/file_manager/gallery/js/image_editor/viewport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698