| 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 * Namespace for utility functions. | 8 * Namespace for utility functions. |
| 9 */ | 9 */ |
| 10 var util = {}; | 10 var util = {}; |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 return loadTimeData.getStringF.apply(loadTimeData, arguments); | 718 return loadTimeData.getStringF.apply(loadTimeData, arguments); |
| 719 } | 719 } |
| 720 | 720 |
| 721 /** | 721 /** |
| 722 * Adapter object that abstracts away the the difference between Chrome app APIs | 722 * Adapter object that abstracts away the the difference between Chrome app APIs |
| 723 * v1 and v2. Is only necessary while the migration to v2 APIs is in progress. | 723 * v1 and v2. Is only necessary while the migration to v2 APIs is in progress. |
| 724 * TODO(mtomasz): Clean up this. crbug.com/240606. | 724 * TODO(mtomasz): Clean up this. crbug.com/240606. |
| 725 */ | 725 */ |
| 726 util.platform = { | 726 util.platform = { |
| 727 /** | 727 /** |
| 728 * @return {boolean} True if Files.app is running via "chrome://files", open | 728 * @return {boolean} True if Files.app is running as an open files or a select |
| 729 * files or select folder dialog. False otherwise. | 729 * folder dialog. False otherwise. |
| 730 */ | 730 */ |
| 731 runningInBrowser: function() { | 731 runningInBrowser: function() { |
| 732 return !window.appID; | 732 return !window.appID; |
| 733 }, | 733 }, |
| 734 | 734 |
| 735 /** | 735 /** |
| 736 * @param {function(Object)} callback Function accepting a preference map. | 736 * @param {function(Object)} callback Function accepting a preference map. |
| 737 */ | 737 */ |
| 738 getPreferences: function(callback) { | 738 getPreferences: function(callback) { |
| 739 chrome.storage.local.get(callback); | 739 chrome.storage.local.get(callback); |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 /** | 1203 /** |
| 1204 * The type of each volume. | 1204 * The type of each volume. |
| 1205 * @enum {string} | 1205 * @enum {string} |
| 1206 */ | 1206 */ |
| 1207 util.VolumeType = Object.freeze({ | 1207 util.VolumeType = Object.freeze({ |
| 1208 DRIVE: 'drive', | 1208 DRIVE: 'drive', |
| 1209 DOWNLOADS: 'downloads', | 1209 DOWNLOADS: 'downloads', |
| 1210 REMOVABLE: 'removable', | 1210 REMOVABLE: 'removable', |
| 1211 ARCHIVE: 'archive' | 1211 ARCHIVE: 'archive' |
| 1212 }); | 1212 }); |
| OLD | NEW |