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 /** | 5 /** |
6 * Namespace for utility functions. | 6 * Namespace for utility functions. |
7 */ | 7 */ |
8 var util = {}; | 8 var util = {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 case VolumeManagerCommon.RootType.DRIVE_SHARED_WITH_ME: | 942 case VolumeManagerCommon.RootType.DRIVE_SHARED_WITH_ME: |
943 return str('DRIVE_SHARED_WITH_ME_COLLECTION_LABEL'); | 943 return str('DRIVE_SHARED_WITH_ME_COLLECTION_LABEL'); |
944 case VolumeManagerCommon.RootType.DRIVE_RECENT: | 944 case VolumeManagerCommon.RootType.DRIVE_RECENT: |
945 return str('DRIVE_RECENT_COLLECTION_LABEL'); | 945 return str('DRIVE_RECENT_COLLECTION_LABEL'); |
946 case VolumeManagerCommon.RootType.DRIVE_OTHER: | 946 case VolumeManagerCommon.RootType.DRIVE_OTHER: |
947 case VolumeManagerCommon.RootType.DOWNLOADS: | 947 case VolumeManagerCommon.RootType.DOWNLOADS: |
948 case VolumeManagerCommon.RootType.ARCHIVE: | 948 case VolumeManagerCommon.RootType.ARCHIVE: |
949 case VolumeManagerCommon.RootType.REMOVABLE: | 949 case VolumeManagerCommon.RootType.REMOVABLE: |
950 case VolumeManagerCommon.RootType.MTP: | 950 case VolumeManagerCommon.RootType.MTP: |
951 case VolumeManagerCommon.RootType.PROVIDED: | 951 case VolumeManagerCommon.RootType.PROVIDED: |
| 952 case VolumeManagerCommon.RootType.PLUGIN_PROVIDED: |
952 return locationInfo.volumeInfo.label; | 953 return locationInfo.volumeInfo.label; |
953 default: | 954 default: |
954 console.error('Unsupported root type: ' + locationInfo.rootType); | 955 console.error('Unsupported root type: ' + locationInfo.rootType); |
955 return locationInfo.volumeInfo.label; | 956 return locationInfo.volumeInfo.label; |
956 } | 957 } |
957 } | 958 } |
958 | 959 |
959 /** | 960 /** |
960 * Returns the localized name of the entry. | 961 * Returns the localized name of the entry. |
961 * | 962 * |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 * @param {!cr.EventTarget} target | 1034 * @param {!cr.EventTarget} target |
1034 * @param {string} type | 1035 * @param {string} type |
1035 * @param {Function} handler | 1036 * @param {Function} handler |
1036 */ | 1037 */ |
1037 util.addEventListenerToBackgroundComponent = function(target, type, handler) { | 1038 util.addEventListenerToBackgroundComponent = function(target, type, handler) { |
1038 target.addEventListener(type, handler); | 1039 target.addEventListener(type, handler); |
1039 window.addEventListener('pagehide', function() { | 1040 window.addEventListener('pagehide', function() { |
1040 target.removeEventListener(type, handler); | 1041 target.removeEventListener(type, handler); |
1041 }); | 1042 }); |
1042 }; | 1043 }; |
OLD | NEW |