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

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

Issue 10870098: [FileBrowser] Fixed default action context menu item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 /** 5 /**
6 * FileManager constructor. 6 * FileManager constructor.
7 * 7 *
8 * FileManager objects encapsulate the functionality of the file selector 8 * FileManager objects encapsulate the functionality of the file selector
9 * dialogs, as well as the full screen file manager application (though the 9 * dialogs, as well as the full screen file manager application (though the
10 * latter is not yet implemented). 10 * latter is not yet implemented).
(...skipping 4165 matching lines...) Expand 10 before | Expand all | Expand 10 after
4176 4176
4177 this.gdataSpaceInfoBar_.style.display = ''; 4177 this.gdataSpaceInfoBar_.style.display = '';
4178 this.gdataSpaceInfoBar_.style.width = 4178 this.gdataSpaceInfoBar_.style.width =
4179 (100 * usedSpace / result.totalSizeKB) + '%'; 4179 (100 * usedSpace / result.totalSizeKB) + '%';
4180 } else { 4180 } else {
4181 this.gdataSpaceInfoBar_.style.display = 'none'; 4181 this.gdataSpaceInfoBar_.style.display = 'none';
4182 this.gdataSpaceInfoLabel_.textContent = 4182 this.gdataSpaceInfoLabel_.textContent =
4183 str('GDATA_FAILED_SPACE_INFO'); 4183 str('GDATA_FAILED_SPACE_INFO');
4184 } 4184 }
4185 }.bind(this)); 4185 }.bind(this));
4186 } 4186 };
4187 4187
4188 /** 4188 /**
4189 * Updates default action menu item to match passed taskItem(icon, 4189 * Updates default action menu item to match passed taskItem(icon,
4190 * label and action). 4190 * label and action).
4191 * @param {Object} taskItem - taskItem to match. 4191 * @param {Object} taskItem - taskItem to match.
4192 */ 4192 */
4193 FileManager.prototype.setDefaultActionMenuItem = function(taskItem) { 4193 FileManager.prototype.setDefaultActionMenuItem = function(defaultItem) {
4194 if (taskItem) { 4194 if (defaultItem) {
4195 this.defaultActionMenuItem_.iconUrl = taskItem.iconUrl; 4195
4196 this.defaultActionMenuItem_.label = taskItem.title; 4196 if (defaultItem.iconType) {
4197 this.defaultActionMenuItem_.taskId = taskItem.taskId; 4197 this.defaultActionMenuItem_.style.backgroundImage = '';
4198 this.defaultActionMenuItem_.setAttribute('file-type-icon',
4199 defaultItem.iconType);
4200 } else if (defaultItem.iconUrl) {
4201 this.defaultActionMenuItem_.style.backgroundImage =
4202 'url(' + defaultItem.iconUrl + ')';
4203 } else {
4204 this.actionNode_.style.backgroundImage = '';
dgozman 2012/08/27 13:07:10 actionNode_ ?
4205 }
4206
4207 this.defaultActionMenuItem_.label = defaultItem.title;
4208 this.defaultActionMenuItem_.taskId = defaultItem.taskId;
4198 } 4209 }
4199 4210
4200 var defaultActionSeparator = 4211 var defaultActionSeparator =
4201 this.dialogDom_.querySelector('#default-action-separator'); 4212 this.dialogDom_.querySelector('#default-action-separator');
4202 4213
4203 this.defaultActionMenuItem_.hidden = !taskItem; 4214 this.defaultActionMenuItem_.hidden = !defaultItem;
4204 defaultActionSeparator.hidden = !taskItem; 4215 defaultActionSeparator.hidden = !defaultItem;
4205 } 4216 };
4206 })(); 4217 })();
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