OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
9 * @type {number} | 9 * @type {number} |
10 */ | 10 */ |
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 this.cancelRename_(); | 2623 this.cancelRename_(); |
2624 // Optimistically apply new name immediately to avoid flickering in | 2624 // Optimistically apply new name immediately to avoid flickering in |
2625 // case of success. | 2625 // case of success. |
2626 nameNode.textContent = newName; | 2626 nameNode.textContent = newName; |
2627 | 2627 |
2628 this.directoryModel_.doesExist(entry, newName, function(exists, isFile) { | 2628 this.directoryModel_.doesExist(entry, newName, function(exists, isFile) { |
2629 if (!exists) { | 2629 if (!exists) { |
2630 var onError = function(err) { | 2630 var onError = function(err) { |
2631 this.alert.show(strf('ERROR_RENAMING', entry.name, | 2631 this.alert.show(strf('ERROR_RENAMING', entry.name, |
2632 util.getFileErrorString(err.code))); | 2632 util.getFileErrorString(err.code))); |
2633 }; | 2633 }.bind(this); |
2634 this.directoryModel_.renameEntry(entry, newName, onError.bind(this)); | 2634 this.directoryModel_.renameEntry(entry, newName, onError.bind(this)); |
2635 } else { | 2635 } else { |
2636 nameNode.textContent = entry.name; | 2636 nameNode.textContent = entry.name; |
2637 var message = isFile ? 'FILE_ALREADY_EXISTS' : | 2637 var message = isFile ? 'FILE_ALREADY_EXISTS' : |
2638 'DIRECTORY_ALREADY_EXISTS'; | 2638 'DIRECTORY_ALREADY_EXISTS'; |
2639 this.alert.show(strf(message, newName)); | 2639 this.alert.show(strf(message, newName)); |
2640 } | 2640 } |
2641 }.bind(this)); | 2641 }.bind(this)); |
2642 }; | 2642 }; |
2643 | 2643 |
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3910 * Set the flag expressing whether the ctrl key is pressed or not. | 3910 * Set the flag expressing whether the ctrl key is pressed or not. |
3911 * @param {boolean} flag New value of the flag | 3911 * @param {boolean} flag New value of the flag |
3912 * @private | 3912 * @private |
3913 */ | 3913 */ |
3914 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3914 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3915 this.ctrlKeyPressed_ = flag; | 3915 this.ctrlKeyPressed_ = flag; |
3916 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3916 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3917 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3917 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3918 }; | 3918 }; |
3919 })(); | 3919 })(); |
OLD | NEW |