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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/image_editor.js

Issue 7828044: [filebrowser] First step to image editor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed commented code. Created 9 years, 3 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/file_manager/js/image_editor/image_editor.js
===================================================================
--- chrome/browser/resources/file_manager/js/image_editor/image_editor.js (revision 100141)
+++ chrome/browser/resources/file_manager/js/image_editor/image_editor.js (working copy)
@@ -8,8 +8,9 @@
* @param {HTMLElement} container
* @param {function(Blob)} saveCallback
* @param {function()} closeCallback
+ * @param {HTMLElement} toolbarContainer
*/
-function ImageEditor(container, saveCallback, closeCallback) {
+function ImageEditor(container, toolbarContainer, saveCallback, closeCallback) {
this.container_ = container;
this.saveCallback_ = saveCallback;
this.closeCallback_ = closeCallback;
@@ -29,13 +30,12 @@
this.buffer_ = new ImageBuffer(canvas);
- this.scaleControl_ = new ImageEditor.ScaleControl(
- this.canvasWrapper_, this.getBuffer().getViewport());
+ // TODO(dgozman): consider adding a ScaleControl in v2.
this.panControl_ = new ImageEditor.MouseControl(canvas, this.getBuffer());
- this.toolbar_ =
- new ImageEditor.Toolbar(container, this.onOptionsChange.bind(this));
+ this.toolbar_ = new ImageEditor.Toolbar(toolbarContainer,
+ this.onOptionsChange.bind(this));
this.initToolbar();
}
@@ -52,7 +52,8 @@
*/
ImageEditor.open = function(saveCallback, closeCallback, source, opt_metadata) {
var container = document.getElementsByClassName('image-editor')[0];
- var editor = new ImageEditor(container, saveCallback, closeCallback);
+ var toolbar = document.getElementsByClassName('toolbar-container')[0];
+ var editor = new ImageEditor(container, toolbar, saveCallback, closeCallback);
if (ImageEditor.resizeListener) {
// Make sure we do not leak the previous instance.
window.removeEventListener('resize', ImageEditor.resizeListener, false);
@@ -117,7 +118,6 @@
this.createModeButtons();
this.toolbar_.addButton('Save', this.save.bind(this, true));
- this.toolbar_.addButton('Close', this.close.bind(this, false));
};
/**

Powered by Google App Engine
This is Rietveld 408576698