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

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

Issue 7828044: [filebrowser] First step to image editor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Setting the src of an img to an empty string can crash the browser, so we 5 // Setting the src of an img to an empty string can crash the browser, so we
6 // use an empty 1x1 gif instead. 6 // use an empty 1x1 gif instead.
7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,'
8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D';
9 9
10 var g_slideshow_data = null; 10 var g_slideshow_data = null;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 this.commands_ = {}; 58 this.commands_ = {};
59 59
60 this.document_ = dialogDom.ownerDocument; 60 this.document_ = dialogDom.ownerDocument;
61 this.dialogType_ = this.params_.type || FileManager.DialogType.FULL_PAGE; 61 this.dialogType_ = this.params_.type || FileManager.DialogType.FULL_PAGE;
62 62
63 this.alert = new cr.ui.dialogs.AlertDialog(this.dialogDom_); 63 this.alert = new cr.ui.dialogs.AlertDialog(this.dialogDom_);
64 this.confirm = new cr.ui.dialogs.ConfirmDialog(this.dialogDom_); 64 this.confirm = new cr.ui.dialogs.ConfirmDialog(this.dialogDom_);
65 this.prompt = new cr.ui.dialogs.PromptDialog(this.dialogDom_); 65 this.prompt = new cr.ui.dialogs.PromptDialog(this.dialogDom_);
66 66
67 this.gallery_ = new Gallery(this.dialogDom_);
68
67 // TODO(dgozman): This will be changed to LocaleInfo. 69 // TODO(dgozman): This will be changed to LocaleInfo.
68 this.locale_ = new v8Locale(navigator.language); 70 this.locale_ = new v8Locale(navigator.language);
69 71
70 // TODO(rginda): 6/22/11: Remove this test when createDateTimeFormat is 72 // TODO(rginda): 6/22/11: Remove this test when createDateTimeFormat is
71 // available in all chrome trunk builds. 73 // available in all chrome trunk builds.
72 if ('createDateTimeFormat' in this.locale_) { 74 if ('createDateTimeFormat' in this.locale_) {
73 this.shortDateFormatter_ = 75 this.shortDateFormatter_ =
74 this.locale_.createDateTimeFormat({'dateType': 'medium'}); 76 this.locale_.createDateTimeFormat({'dateType': 'medium'});
75 } else { 77 } else {
76 this.shortDateFormatter_ = { 78 this.shortDateFormatter_ = {
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 } else if (task_parts[1] == 'enqueue') { 1674 } else if (task_parts[1] == 'enqueue') {
1673 task.iconUrl = 1675 task.iconUrl =
1674 chrome.extension.getURL('images/icon_add_to_queue_16x16.png'); 1676 chrome.extension.getURL('images/icon_add_to_queue_16x16.png');
1675 task.title = str('ENQUEUE'); 1677 task.title = str('ENQUEUE');
1676 } else if (task_parts[1] == 'mount-archive') { 1678 } else if (task_parts[1] == 'mount-archive') {
1677 task.iconUrl = 1679 task.iconUrl =
1678 chrome.extension.getURL('images/icon_mount_archive_16x16.png'); 1680 chrome.extension.getURL('images/icon_mount_archive_16x16.png');
1679 task.title = str('MOUNT_ARCHIVE'); 1681 task.title = str('MOUNT_ARCHIVE');
1680 if (str('ENABLE_ARCHIVES') != 'true') 1682 if (str('ENABLE_ARCHIVES') != 'true')
1681 continue; 1683 continue;
1684 } else if (task_parts[1] == 'gallery') {
zel 2011/09/02 17:11:58 how's gallery different from the slideshow?
dgozman 2011/09/06 14:18:47 I will remove slideshow once this gallery will be
1685 task.iconUrl =
1686 chrome.extension.getURL('images/icon_preview_16x16.png');
1687 task.title = str('GALLERY');
1682 } 1688 }
1683 } 1689 }
1684 this.renderTaskButton_(task); 1690 this.renderTaskButton_(task);
1685 } 1691 }
1686 this.maybeRenderUnmountTask_(selection); 1692 this.maybeRenderUnmountTask_(selection);
1687 // This needs to be done in separate function, as check requires 1693 // This needs to be done in separate function, as check requires
1688 // asynchronous function calls. 1694 // asynchronous function calls.
1689 this.maybeRenderFormattingTask_(selection); 1695 this.maybeRenderFormattingTask_(selection);
1690 }; 1696 };
1691 1697
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 chrome.fileBrowserPrivate.addMount(urls[index], 'file', {}); 1865 chrome.fileBrowserPrivate.addMount(urls[index], 'file', {});
1860 } 1866 }
1861 } else if (id == 'unmount-archive') { 1867 } else if (id == 'unmount-archive') {
1862 for (var index = 0; index < urls.length; ++index) { 1868 for (var index = 0; index < urls.length; ++index) {
1863 chrome.fileBrowserPrivate.removeMount(urls[index]); 1869 chrome.fileBrowserPrivate.removeMount(urls[index]);
1864 } 1870 }
1865 } else if (id == 'format-device') { 1871 } else if (id == 'format-device') {
1866 this.confirm.show(str('FORMATTING_WARNING'), function() { 1872 this.confirm.show(str('FORMATTING_WARNING'), function() {
1867 chrome.fileBrowserPrivate.formatDevice(urls[0]); 1873 chrome.fileBrowserPrivate.formatDevice(urls[0]);
1868 }); 1874 });
1875 } else if (id == 'gallery') {
1876 this.gallery_.show(this.currentDirEntry_, details.entries);
1869 } 1877 }
1870 }; 1878 };
1871 1879
1872 FileManager.prototype.getDeviceNumber = function(entry) { 1880 FileManager.prototype.getDeviceNumber = function(entry) {
1873 if (!entry.isDirectory) return false; 1881 if (!entry.isDirectory) return false;
1874 for (var i = 0; i < this.mountPoints_.length; i++) { 1882 for (var i = 0; i < this.mountPoints_.length; i++) {
1875 if (normalizeAbsolutePath(entry.fullPath) == 1883 if (normalizeAbsolutePath(entry.fullPath) ==
1876 normalizeAbsolutePath(this.mountPoints_[i].mountPath)) { 1884 normalizeAbsolutePath(this.mountPoints_[i].mountPath)) {
1877 return i; 1885 return i;
1878 } 1886 }
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 3274
3267 if (msg) { 3275 if (msg) {
3268 console.log('no no no'); 3276 console.log('no no no');
3269 this.alert.show(msg, onAccept); 3277 this.alert.show(msg, onAccept);
3270 return false; 3278 return false;
3271 } 3279 }
3272 3280
3273 return true; 3281 return true;
3274 }; 3282 };
3275 })(); 3283 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698