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

Side by Side 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, 4 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 | « chrome/browser/resources/file_manager/js/file_tasks.js ('k') | 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 function MockEventSource() { 5 function MockEventSource() {
6 this.listeners_ = []; 6 this.listeners_ = [];
7 } 7 }
8 8
9 /** 9 /**
10 * Add a listener. 10 * Add a listener.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 */ 60 */
61 requestLocalFileSystem: function(callback) { 61 requestLocalFileSystem: function(callback) {
62 window.webkitRequestFileSystem(window.PERSISTENT, 16 * 1024 * 1024, 62 window.webkitRequestFileSystem(window.PERSISTENT, 16 * 1024 * 1024,
63 callback, 63 callback,
64 util.ferr('Error requesting filesystem')); 64 util.ferr('Error requesting filesystem'));
65 }, 65 },
66 66
67 /** 67 /**
68 * View multiple files. 68 * View multiple files.
69 */ 69 */
70 viewFiles: function(selectedFiles) { 70 viewFiles: function(urls, actionId, callback) {
71 console.log('viewFiles called: ' + selectedFiles.length + 71 var success = true;
72 ' files selected'); 72 for (var i = 0; i != urls.length; i++) {
73 for (var i = 0; i != selectedFiles.length; i++) { 73 var url = urls[i];
74 window.open(selectedFiles[i]); 74 if (!url.match(/\.(pdf|txt)$/i)) {
75 success = false;
76 break;
77 }
78 window.open(url);
75 } 79 }
80 callback(success);
76 }, 81 },
77 82
78 /** 83 /**
79 * Select multiple files. 84 * Select multiple files.
80 */ 85 */
81 selectFiles: function(selectedFiles) { 86 selectFiles: function(selectedFiles) {
82 console.log('selectFiles called: ' + selectedFiles.length + 87 console.log('selectFiles called: ' + selectedFiles.length +
83 ' files selected'); 88 ' files selected');
84 }, 89 },
85 90
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 PASTE_ITEMS_REMAINING: 'Transferring $1 items', 586 PASTE_ITEMS_REMAINING: 'Transferring $1 items',
582 PASTE_CANCELLED: 'Transfer cancelled.', 587 PASTE_CANCELLED: 'Transfer cancelled.',
583 PASTE_TARGET_EXISTS_ERROR: 'Transfer failed, item exists: "$1"', 588 PASTE_TARGET_EXISTS_ERROR: 'Transfer failed, item exists: "$1"',
584 PASTE_FILESYSTEM_ERROR: 'Transfer failed. $1', 589 PASTE_FILESYSTEM_ERROR: 'Transfer failed. $1',
585 PASTE_UNEXPECTED_ERROR: 'Transfer failed, unexpected error: $1', 590 PASTE_UNEXPECTED_ERROR: 'Transfer failed, unexpected error: $1',
586 591
587 CANCEL_LABEL: 'Cancel', 592 CANCEL_LABEL: 'Cancel',
588 OPEN_LABEL: 'Open', 593 OPEN_LABEL: 'Open',
589 SAVE_LABEL: 'Save', 594 SAVE_LABEL: 'Save',
590 OK_LABEL: 'OK', 595 OK_LABEL: 'OK',
591 NO_ACTION_FOR_FILE: "To view this file, convert it to a format that's view able on the web. <a target='_blank' href='$1'>Learn More.</a>", 596 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.
592 597
593 DEFAULT_NEW_FOLDER_NAME: 'New Folder', 598 DEFAULT_NEW_FOLDER_NAME: 'New Folder',
594 MORE_FILES: 'Show all files', 599 MORE_FILES: 'Show all files',
595 600
596 SELECT_FOLDER_TITLE: 'Select a folder to open', 601 SELECT_FOLDER_TITLE: 'Select a folder to open',
597 SELECT_OPEN_FILE_TITLE: 'Select a file to open', 602 SELECT_OPEN_FILE_TITLE: 'Select a file to open',
598 SELECT_OPEN_MULTI_FILE_TITLE: 'Select one or more files', 603 SELECT_OPEN_MULTI_FILE_TITLE: 'Select one or more files',
599 SELECT_SAVEAS_FILE_TITLE: 'Save file as', 604 SELECT_SAVEAS_FILE_TITLE: 'Save file as',
600 605
601 COMPUTING_SELECTION: 'Computing selection...', 606 COMPUTING_SELECTION: 'Computing selection...',
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 compare: function(a, b) { 821 compare: function(a, b) {
817 if (a > b) return 1; 822 if (a > b) return 1;
818 if (a < b) return -1; 823 if (a < b) return -1;
819 return 0; 824 return 0;
820 } 825 }
821 }; 826 };
822 }; 827 };
823 828
824 return v8Intl; 829 return v8Intl;
825 }()); 830 }());
OLDNEW
« 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