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

Unified Diff: chrome/browser/resources/file_manager/js/mock_chrome.js

Issue 10828092: [File Manager] Better message when trying to open unsupported files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_tasks.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/mock_chrome.js
diff --git a/chrome/browser/resources/file_manager/js/mock_chrome.js b/chrome/browser/resources/file_manager/js/mock_chrome.js
index 6595bdab4dd84e665458982034b56f4c1a3bc24b..e9bad561cbe5dc75bc1ceca0cdecfda1a064254a 100644
--- a/chrome/browser/resources/file_manager/js/mock_chrome.js
+++ b/chrome/browser/resources/file_manager/js/mock_chrome.js
@@ -67,12 +67,17 @@ chrome.fileBrowserPrivate = {
/**
* View multiple files.
*/
- viewFiles: function(selectedFiles) {
- console.log('viewFiles called: ' + selectedFiles.length +
- ' files selected');
- for (var i = 0; i != selectedFiles.length; i++) {
- window.open(selectedFiles[i]);
+ viewFiles: function(urls, actionId, callback) {
+ var success = true;
+ for (var i = 0; i != urls.length; i++) {
+ var url = urls[i];
+ if (!url.match(/\.(pdf|txt)$/i)) {
+ success = false;
+ break;
+ }
+ window.open(url);
}
+ callback(success);
},
/**
@@ -588,7 +593,7 @@ chrome.fileBrowserPrivate = {
OPEN_LABEL: 'Open',
SAVE_LABEL: 'Save',
OK_LABEL: 'OK',
- NO_ACTION_FOR_FILE: "To view this file, convert it to a format that's viewable on the web. <a target='_blank' href='$1'>Learn More.</a>",
+ NO_ACTION_FOR_FILE: "This file type is not supported. Please visit the <a target='_blank' href='$1'>Chrome Web Store</a> to find an app that can open this type of file. <a target='_blank' href='$2'>Learn More.</a>",
SeRya 2012/07/31 12:25:00 PLease split this to several lines to fox 80 chars
Vladislav Kaznacheev 2012/07/31 12:41:37 Done.
DEFAULT_NEW_FOLDER_NAME: 'New Folder',
MORE_FILES: 'Show all files',
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_tasks.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698