Skip to content

Commit

Permalink
Files.app: Add missing JSdoc for member methods/variables chromium#1.
Browse files Browse the repository at this point in the history
All the changes are in comment. No semantics are changed.

BUG=175657
TEST=none
TBR=mtomasz@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182242 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
yoshiki@chromium.org committed Feb 13, 2013
1 parent c9ee1e8 commit e0bd37c
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,37 @@ ImageEditor.Mode.Adjust.prototype.cleanUpUI = function() {
this.hidePreview();
};

//TODO(JSDOC)
/**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.hidePreview = function() {
if (this.canvas_) {
this.canvas_.parentNode.removeChild(this.canvas_);
this.canvas_ = null;
}
};

//TODO(JSDOC)
/**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.cleanUpCaches = function() {
this.filter_ = null;
this.previewImageData_ = null;
};

//TODO(JSDOC)
/**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.reset = function() {
ImageEditor.Mode.prototype.reset.call(this);
this.hidePreview();
this.cleanUpCaches();
};

//TODO(JSDOC)
/**
* TODO(JSDOC)
* @param {Object} options //TODO(JSDOC).
*/
ImageEditor.Mode.Adjust.prototype.update = function(options) {
ImageEditor.Mode.prototype.update.apply(this, arguments);

Expand Down Expand Up @@ -90,7 +99,11 @@ ImageEditor.Mode.Adjust.prototype.updatePreviewImage = function() {
* Own methods
*/

//TODO(JSDOC)
/**
* TODO(JSDOC)
* @param {Object} options //TODO(JSDOC).
* @return {function(ImageData,ImageData,number,number)} Created function.
*/
ImageEditor.Mode.Adjust.prototype.createFilter = function(options) {
return filter.create(this.name, options);
};
Expand All @@ -106,6 +119,11 @@ ImageEditor.Mode.ColorFilter = function() {
ImageEditor.Mode.ColorFilter.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype};

/**
* TODO(JSDOC)
* @return {{r: Array.<number>, g: Array.<number>, b: Array.<number>}}
* histogram.
*/
ImageEditor.Mode.ColorFilter.prototype.getHistogram = function() {
return filter.getHistogram(this.getImageView().getThumbnail());
};
Expand All @@ -121,6 +139,10 @@ ImageEditor.Mode.Exposure = function() {
ImageEditor.Mode.Exposure.prototype =
{__proto__: ImageEditor.Mode.ColorFilter.prototype};

/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Exposure.prototype.createTools = function(toolbar) {
toolbar.addRange('brightness', -1, 0, 1, 100);
toolbar.addRange('contrast', -1, 0, 1, 100);
Expand All @@ -138,16 +160,27 @@ ImageEditor.Mode.Autofix = function() {
ImageEditor.Mode.Autofix.prototype =
{__proto__: ImageEditor.Mode.ColorFilter.prototype};

/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Autofix.prototype.createTools = function(toolbar) {
var self = this;
toolbar.addButton('Apply', this.apply.bind(this));
};

/**
* TODO(JSDOC)
* @return {boolean} //TODO(JSDOC)
*/
ImageEditor.Mode.Autofix.prototype.isApplicable = function() {
return this.getImageView().hasValidImage() &&
filter.autofix.isApplicable(this.getHistogram());
};

/**
* TODO(JSDOC)
*/
ImageEditor.Mode.Autofix.prototype.apply = function() {
this.update({histogram: this.getHistogram()});
};
Expand All @@ -164,6 +197,9 @@ ImageEditor.Mode.InstantAutofix = function() {
ImageEditor.Mode.InstantAutofix.prototype =
{__proto__: ImageEditor.Mode.Autofix.prototype};

/**
* TODO(JSDOC)
*/
ImageEditor.Mode.InstantAutofix.prototype.setUp = function() {
ImageEditor.Mode.Autofix.prototype.setUp.apply(this, arguments);
this.apply();
Expand All @@ -180,6 +216,10 @@ ImageEditor.Mode.Blur = function() {
ImageEditor.Mode.Blur.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype};

/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Blur.prototype.createTools = function(toolbar) {
toolbar.addRange('strength', 0, 0, 1, 100);
toolbar.addRange('radius', 1, 1, 3);
Expand All @@ -196,6 +236,10 @@ ImageEditor.Mode.Sharpen = function() {
ImageEditor.Mode.Sharpen.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype};

/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Sharpen.prototype.createTools = function(toolbar) {
toolbar.addRange('strength', 0, 0, 1, 100);
toolbar.addRange('radius', 1, 1, 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function ImageBuffer() {
this.overlays_ = [];
}

//TODO(JSDOC)
/**
* TODO(JSDOC).
* @param {ImageBuffer.Overlay} overlay //TODO(JSDOC).
*/
ImageBuffer.prototype.addOverlay = function(overlay) {
var zIndex = overlay.getZIndex();
// Store the overlays in the ascending Z-order.
Expand All @@ -24,7 +27,10 @@ ImageBuffer.prototype.addOverlay = function(overlay) {
this.overlays_.splice(i, 0, overlay);
};

//TODO(JSDOC)
/**
* TODO(JSDOC).
* @param {ImageBuffer.Overlay} overlay //TODO(JSDOC).
*/
ImageBuffer.prototype.removeOverlay = function(overlay) {
for (var i = 0; i != this.overlays_.length; i++) {
if (this.overlays_[i] == overlay) {
Expand Down Expand Up @@ -119,25 +125,58 @@ ImageBuffer.DoubleTapAction = {
* and the behavior of the ImageBuffer instance.
* @class
*/
//TODO(JSDOC)
ImageBuffer.Overlay = function() {};

//TODO(JSDOC)
/**
* TODO(JSDOC).
* @return {number} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.getZIndex = function() { return 0 };

//TODO(JSDOC)
/**
* TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.draw = function() {};

//TODO(JSDOC)
ImageBuffer.Overlay.prototype.getCursorStyle = function() { return null };
/**
* TODO(JSDOC).
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} mouseDown If mouse button is down.
* @return {?string} A value for style.cursor CSS property or null for
* default.
*/
ImageBuffer.Overlay.prototype.getCursorStyle = function(x, y, mouseDown) {
return null;
};

//TODO(JSDOC)
ImageBuffer.Overlay.prototype.onClick = function() { return false };
/**
* TODO(JSDOC).
* @param {number} x //TODO(JSDOC).
* @param {number} y //TODO(JSDOC).
* @return {boolean} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.onClick = function(x, y) {
return false;
};

//TODO(JSDOC)
ImageBuffer.Overlay.prototype.getDragHandler = function() { return null };
/**
* TODO(JSDOC).
* @param {number} x Event X coordinate.
* @param {number} y Event Y coordinate.
* @param {boolean} touch True if it's a touch event, false if mouse.
* @return {function(number,number)} A function to be called on mouse drag.
*/
ImageBuffer.Overlay.prototype.getDragHandler = function(x, y, touch) {
return null;
};

//TODO(JSDOC)
/**
* TODO(JSDOC).
* @param {number} x //TODO(JSDOC).
* @param {number} y //TODO(JSDOC).
* @return {ImageBuffer.DoubleTapAction} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.getDoubleTapAction = function(x, y) {
return ImageBuffer.DoubleTapAction.NOTHING;
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
*/
function ImageEncoder() {}

//TODO(JSDOC)
/**
* @type {Array.<Object>}
*/
ImageEncoder.metadataEncoders = {};

//TODO(JSDOC)
/**
* @param {function(new:ImageEncoder.MetadataEncoder)} constructor
* //TODO(JSDOC).
* @param {string} mimeType //TODO(JSDOC).
*/
ImageEncoder.registerMetadataEncoder = function(constructor, mimeType) {
ImageEncoder.metadataEncoders[mimeType] = constructor;
};
Expand Down Expand Up @@ -141,6 +147,13 @@ ImageEncoder.createThumbnail = function(canvas, opt_shrinkage) {
return thumbnailCanvas;
};

/**
* TODO(JSDOC)
* @param {string} string //TODO(JSDOC).
* @param {number} from //TODO(JSDOC).
* @param {number} to //TODO(JSDOC).
* @return {ArrayBuffer} //TODO(JSDOC).
*/
ImageEncoder.stringToArrayBuffer = function(string, from, to) {
var size = to - from;
var array = new Uint8Array(size);
Expand Down Expand Up @@ -168,6 +181,10 @@ ImageEncoder.MetadataEncoder = function(original_metadata) {
}
};

/**
* TODO(JSDOC)
* @return {Object} //TODO(JSDOC).
*/
ImageEncoder.MetadataEncoder.prototype.getMetadata = function() {
return this.metadata_;
};
Expand Down
Loading

0 comments on commit e0bd37c

Please sign in to comment.