Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_tasks.js

Issue 14631019: Remove internal handlers from the Files.app's UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * @param {FileManager} fileManager FileManager instance. 10 * @param {FileManager} fileManager FileManager instance.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 var isOnDrive = false; 130 var isOnDrive = false;
131 for (var index = 0; index < this.urls_.length; ++index) { 131 for (var index = 0; index < this.urls_.length; ++index) {
132 if (FileType.isOnDrive(this.urls_[index])) { 132 if (FileType.isOnDrive(this.urls_[index])) {
133 isOnDrive = true; 133 isOnDrive = true;
134 break; 134 break;
135 } 135 }
136 } 136 }
137 137
138 for (var i = 0; i < tasks.length; i++) { 138 for (var i = 0; i < tasks.length; i++) {
139 var task = tasks[i]; 139 var task = tasks[i];
140 var taskParts = task.taskId.split('|');
140 141
141 // Skip Drive App if the file is not on Drive. 142 // Skip Drive App if the file is not on Drive.
142 if (!isOnDrive && task.driveApp) 143 if (!isOnDrive && task.driveApp)
143 continue; 144 continue;
144 145
146 // Skip internal Files.app's handlers.
147 if (taskParts[0] == id && (taskParts[2] == 'auto-open' ||
148 taskParts[2] == 'select' || taskParts[2] == 'open')) {
149 continue;
150 }
151
145 // Tweak images, titles of internal tasks. 152 // Tweak images, titles of internal tasks.
146 var taskParts = task.taskId.split('|');
147 if (taskParts[0] == id && taskParts[1] == 'file') { 153 if (taskParts[0] == id && taskParts[1] == 'file') {
148 if (taskParts[2] == 'play') { 154 if (taskParts[2] == 'play') {
149 // TODO(serya): This hack needed until task.iconUrl is working 155 // TODO(serya): This hack needed until task.iconUrl is working
150 // (see GetFileTasksFileBrowserFunction::RunImpl). 156 // (see GetFileTasksFileBrowserFunction::RunImpl).
151 task.iconType = 'audio'; 157 task.iconType = 'audio';
152 task.title = loadTimeData.getString('ACTION_LISTEN'); 158 task.title = loadTimeData.getString('ACTION_LISTEN');
153 } else if (taskParts[2] == 'mount-archive') { 159 } else if (taskParts[2] == 'mount-archive') {
154 task.iconType = 'archive'; 160 task.iconType = 'archive';
155 task.title = loadTimeData.getString('MOUNT_ARCHIVE'); 161 task.title = loadTimeData.getString('MOUNT_ARCHIVE');
156 } else if (taskParts[2] == 'gallery') { 162 } else if (taskParts[2] == 'gallery') {
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 items, defaultIdx, 698 items, defaultIdx,
693 function(item) { 699 function(item) {
694 onSuccess(item.task); 700 onSuccess(item.task);
695 }); 701 });
696 }; 702 };
697 703
698 FileTasks.decorate('display'); 704 FileTasks.decorate('display');
699 FileTasks.decorate('updateMenuItem'); 705 FileTasks.decorate('updateMenuItem');
700 FileTasks.decorate('execute'); 706 FileTasks.decorate('execute');
701 FileTasks.decorate('executeDefault'); 707 FileTasks.decorate('executeDefault');
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698