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

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

Issue 7054047: Merge 87732 - file manager: Fix okButton updating. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 6 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) 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 // WK Bug 55728 is fixed on the chrome 12 branch but not on the trunk. 5 // WK Bug 55728 is fixed on the chrome 12 branch but not on the trunk.
6 // TODO(rginda): Enable this everywhere once we have a trunk-worthy fix. 6 // TODO(rginda): Enable this everywhere once we have a trunk-worthy fix.
7 const ENABLE_EXIF_READER = navigator.userAgent.match(/chrome\/12\.0/i); 7 const ENABLE_EXIF_READER = navigator.userAgent.match(/chrome\/12\.0/i);
8 8
9 // Thumbnail view is painful without the exif reader. 9 // Thumbnail view is painful without the exif reader.
10 const ENABLE_THUMBNAIL_VIEW = ENABLE_EXIF_READER; 10 const ENABLE_THUMBNAIL_VIEW = ENABLE_EXIF_READER;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 this.addEventListener('directory-changed', 65 this.addEventListener('directory-changed',
66 this.onDirectoryChanged_.bind(this)); 66 this.onDirectoryChanged_.bind(this));
67 this.addEventListener('selection-summarized', 67 this.addEventListener('selection-summarized',
68 this.onSelectionSummarized_.bind(this)); 68 this.onSelectionSummarized_.bind(this));
69 69
70 this.initCommands_(); 70 this.initCommands_();
71 this.initDom_(); 71 this.initDom_();
72 this.initDialogType_(); 72 this.initDialogType_();
73 73
74 this.summarizeSelection_(); 74 this.summarizeSelection_();
75 this.updateOkButton_();
76 this.updatePreview_(); 75 this.updatePreview_();
77 76
78 chrome.fileBrowserPrivate.onDiskChanged.addListener( 77 chrome.fileBrowserPrivate.onDiskChanged.addListener(
79 this.onDiskChanged_.bind(this)); 78 this.onDiskChanged_.bind(this));
80 79
81 this.table_.list_.focus(); 80 this.table_.list_.focus();
82 81
83 if (ENABLE_EXIF_READER) { 82 if (ENABLE_EXIF_READER) {
84 this.exifReader = new Worker('js/exif_reader.js'); 83 this.exifReader = new Worker('js/exif_reader.js');
85 this.exifReader.onmessage = this.onExifReaderMessage_.bind(this); 84 this.exifReader.onmessage = this.onExifReaderMessage_.bind(this);
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 * 1649 *
1651 * @param {cr.Event} event The directory-changed event. 1650 * @param {cr.Event} event The directory-changed event.
1652 */ 1651 */
1653 FileManager.prototype.onDirectoryChanged_ = function(event) { 1652 FileManager.prototype.onDirectoryChanged_ = function(event) {
1654 if (event.saveHistory) { 1653 if (event.saveHistory) {
1655 history.pushState(this.currentDirEntry_.fullPath, 1654 history.pushState(this.currentDirEntry_.fullPath,
1656 this.currentDirEntry_.fullPath, 1655 this.currentDirEntry_.fullPath,
1657 location.href); 1656 location.href);
1658 } 1657 }
1659 1658
1659 this.updateOkButton_();
1660 // New folder should never be enabled in the root or media/ directories. 1660 // New folder should never be enabled in the root or media/ directories.
1661 this.newFolderButton_.disabled = 1661 this.newFolderButton_.disabled =
1662 (this.currentDirEntry_.fullPath == '/' || 1662 (this.currentDirEntry_.fullPath == '/' ||
1663 this.currentDirEntry_.fullPath == MEDIA_DIRECTORY); 1663 this.currentDirEntry_.fullPath == MEDIA_DIRECTORY);
1664 1664
1665 this.document_.title = this.currentDirEntry_.fullPath; 1665 this.document_.title = this.currentDirEntry_.fullPath;
1666 this.rescanDirectory_(); 1666 this.rescanDirectory_();
1667 }; 1667 };
1668 1668
1669 /** 1669 /**
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { 2117 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) {
2118 if (!this.selection.leadEntry.isFile) 2118 if (!this.selection.leadEntry.isFile)
2119 throw new Error('Selected entry is not a file!'); 2119 throw new Error('Selected entry is not a file!');
2120 } 2120 }
2121 2121
2122 chrome.fileBrowserPrivate.selectFile(ary[0], 0); 2122 chrome.fileBrowserPrivate.selectFile(ary[0], 0);
2123 // Window closed by above call. 2123 // Window closed by above call.
2124 }; 2124 };
2125 2125
2126 })(); 2126 })();
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