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

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: Rebase 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 af4ccf456fd6a5b12e4bc26aff7a996172d4ff31..dcd28d16c74e77cea73233010ce35c113811354b 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,10 @@ 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>',
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