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

Unified Diff: ui/file_manager/gallery/js/gallery_item.js

Issue 397543002: Gallery.app: Don't dispatch an event to update when renaming is not done. (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 | « ui/file_manager/gallery/js/gallery.js ('k') | 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/gallery_item.js
diff --git a/ui/file_manager/gallery/js/gallery_item.js b/ui/file_manager/gallery/js/gallery_item.js
index 107dbe532a2bba8215400f3427bdb5672d6cf931..9e510834e9b8d8fe92f579fb00aca52c5c96647c 100644
--- a/ui/file_manager/gallery/js/gallery_item.js
+++ b/ui/file_manager/gallery/js/gallery_item.js
@@ -255,15 +255,15 @@ Gallery.Item.prototype.saveToFile = function(
* Renames the item.
*
* @param {string} displayName New display name (without the extension).
- * @return {Promise} Promise fulfilled after renaming, or rejected with
- * GalleryRenameError.
+ * @return {Promise} Promise fulfilled with when renaming completes, or rejected
+ * with the error message.
*/
Gallery.Item.prototype.rename = function(displayName) {
var newFileName = this.entry_.name.replace(
ImageUtil.getDisplayNameFromName(this.entry_.name), displayName);
if (newFileName === this.entry_.name)
- return Promise.resolve();
+ return Promise.reject('NOT_CHANGED');
if (/^\s*$/.test(displayName))
return Promise.reject(str('ERROR_WHITESPACE_NAME'));
« no previous file with comments | « ui/file_manager/gallery/js/gallery.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698