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 object encapsulates everything related to tasks execution. | 8 * This object encapsulates everything related to tasks execution. |
9 * | 9 * |
10 * TODO(hirono): Pass each component instead of the entire FileManager. | 10 * TODO(hirono): Pass each component instead of the entire FileManager. |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 galleryFrame.onload = function() { | 695 galleryFrame.onload = function() { |
696 galleryFrame.contentWindow.ImageUtil.metrics = metrics; | 696 galleryFrame.contentWindow.ImageUtil.metrics = metrics; |
697 | 697 |
698 // TODO(haruki): isOnReadonlyDirectory() only checks the permission for the | 698 // TODO(haruki): isOnReadonlyDirectory() only checks the permission for the |
699 // root. We should check more granular permission to know whether the file | 699 // root. We should check more granular permission to know whether the file |
700 // is writable or not. | 700 // is writable or not. |
701 var readonly = fm.isOnReadonlyDirectory(); | 701 var readonly = fm.isOnReadonlyDirectory(); |
702 var currentDir = fm.getCurrentDirectoryEntry(); | 702 var currentDir = fm.getCurrentDirectoryEntry(); |
703 var downloadsVolume = | 703 var downloadsVolume = |
704 fm.volumeManager.getCurrentProfileVolumeInfo(RootType.DOWNLOADS); | 704 fm.volumeManager.getCurrentProfileVolumeInfo(RootType.DOWNLOADS); |
705 var downloadsDir = downloadsVolume && downloadsVolume.root; | 705 var downloadsDir = downloadsVolume && downloadsVolume.fileSystem.root; |
706 var readonlyDirName = null; | 706 var readonlyDirName = null; |
707 if (readonly && currentDir) { | 707 if (readonly && currentDir) { |
708 // TODO(mtomasz): Pass Entry instead of localized name. Conversion to a | 708 // TODO(mtomasz): Pass Entry instead of localized name. Conversion to a |
709 // display string should be done in gallery.js. | 709 // display string should be done in gallery.js. |
710 var locationInfo = fm.volumeManager.getLocationInfo(currentDir); | 710 var locationInfo = fm.volumeManager.getLocationInfo(currentDir); |
711 if (locationInfo && locationInfo.isRootEntry) { | 711 if (locationInfo && locationInfo.isRootEntry) { |
712 readonlyDirName = PathUtil.getRootTypeLabel(currentDir.rootType) || | 712 readonlyDirName = PathUtil.getRootTypeLabel(currentDir.rootType) || |
713 currentDir.name; | 713 currentDir.name; |
714 } else { | 714 } else { |
715 readonlyDirName = currentDir.name; | 715 readonlyDirName = currentDir.name; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 this.pendingInvocations_.push([privateMethod, arguments]); | 872 this.pendingInvocations_.push([privateMethod, arguments]); |
873 } | 873 } |
874 return this; | 874 return this; |
875 }; | 875 }; |
876 }; | 876 }; |
877 | 877 |
878 FileTasks.decorate('display'); | 878 FileTasks.decorate('display'); |
879 FileTasks.decorate('updateMenuItem'); | 879 FileTasks.decorate('updateMenuItem'); |
880 FileTasks.decorate('execute'); | 880 FileTasks.decorate('execute'); |
881 FileTasks.decorate('executeDefault'); | 881 FileTasks.decorate('executeDefault'); |
OLD | NEW |