Commit c47cc4cb authored by fukino's avatar fukino Committed by Commit bot

Remove the warning for converting entries to URLs.

- Removed the warning for the call of util.entriesToURLs.
- Made sure that all private-API call using entriesToURLs have TODO comments.
- Added issue ID for the TODO comments.

BUG=411790
TEST=manually confirmed

Review URL: https://codereview.chromium.org/546413002

Cr-Commit-Position: refs/heads/master@{#293704}
parent 0e0d095c
......@@ -341,8 +341,8 @@ fileOperationUtil.copyTo = function(
*/
fileOperationUtil.zipSelection = function(
sources, parent, newName, successCallback, errorCallback) {
// TODO(mtomasz): Pass Entries instead of URLs. Entries can be converted to
// URLs in custom bindings.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
chrome.fileBrowserPrivate.zipSelection(
parent.toURL(),
util.entriesToURLs(sources),
......
......@@ -1088,9 +1088,6 @@ util.getCurrentLocaleOrDefault = function() {
* @return {Array.<string>} Output array of URLs.
*/
util.entriesToURLs = function(entries) {
// TODO(mtomasz): Make all callers use entries instead of URLs, and then
// remove this utility function.
console.warn('Converting entries to URLs is deprecated.');
return entries.map(function(entry) {
return entry.toURL();
});
......
......@@ -1772,6 +1772,8 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
FileManager.prototype.onDefaultTaskDone_ = function(task) {
// TODO(dgozman): move this method closer to tasks.
var selection = this.getSelection();
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
chrome.fileBrowserPrivate.setDefaultTask(
task.taskId,
util.entriesToURLs(selection.entries),
......
......@@ -90,6 +90,7 @@ FileTasks.prototype.init = function(entries, opt_mimeTypes) {
this.mimeTypes_ = opt_mimeTypes || [];
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
if (urls.length > 0)
chrome.fileBrowserPrivate.getFileTasks(urls, this.onTasks_.bind(this));
......@@ -397,7 +398,8 @@ FileTasks.prototype.executeDefaultInternal_ = function(entries, opt_callback) {
}.bind(this);
this.checkAvailability_(function() {
// TODO(mtomasz): Pass entries instead.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
var taskId = chrome.runtime.id + '|file|view-in-browser';
chrome.fileBrowserPrivate.executeTask(taskId, urls, onViewFiles);
......@@ -431,7 +433,8 @@ FileTasks.prototype.executeInternal_ = function(taskId, entries) {
var taskParts = taskId.split('|');
this.executeInternalTask_(taskParts[2], entries);
} else {
// TODO(mtomasz): Pass entries instead.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
chrome.fileBrowserPrivate.executeTask(taskId, urls, function(result) {
if (result !== 'message_sent')
......@@ -539,7 +542,8 @@ FileTasks.prototype.executeInternalTask_ = function(id, entries) {
// in the directory.
entries = fm.getAllEntriesInCurrentDirectory().filter(FileType.isAudio);
}
// TODO(mtomasz): Pass entries instead.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
var position = urls.indexOf(selectedEntry.toURL());
chrome.fileBrowserPrivate.getProfiles(function(profiles,
......@@ -581,7 +585,8 @@ FileTasks.prototype.mountArchivesInternal_ = function(entries) {
var tracker = fm.directoryModel.createDirectoryChangeTracker();
tracker.start();
// TODO(mtomasz): Pass Entries instead of URLs.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
fm.resolveSelectResults_(urls, function(resolvedURLs) {
for (var index = 0; index < resolvedURLs.length; ++index) {
......
......@@ -262,6 +262,8 @@ FileTransferController.prototype = {
// Check all file entries and keeps only those need sharing operation.
var processFileEntries = function(entries) {
return new Promise(function(callback) {
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var urls = util.entriesToURLs(entries);
chrome.fileBrowserPrivate.getEntryProperties(urls, callback);
}).
......
......@@ -839,7 +839,8 @@ ExternalProvider.prototype.callApi_ = function() {
this.callbacks_ = [];
var self = this;
// TODO(mtomasz): Make getEntryProperties accept Entry instead of URL.
// TODO(mtomasz): Move conversion from entry to url to custom bindings.
// crbug.com/345527.
var entryURLs = util.entriesToURLs(entries);
chrome.fileBrowserPrivate.getEntryProperties(
entryURLs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment