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

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

Issue 7065061: Merge 87732 - file manager: Fix okButton updating. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/782/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 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 * 1640 *
1642 * @param {cr.Event} event The directory-changed event. 1641 * @param {cr.Event} event The directory-changed event.
1643 */ 1642 */
1644 FileManager.prototype.onDirectoryChanged_ = function(event) { 1643 FileManager.prototype.onDirectoryChanged_ = function(event) {
1645 if (event.saveHistory) { 1644 if (event.saveHistory) {
1646 history.pushState(this.currentDirEntry_.fullPath, 1645 history.pushState(this.currentDirEntry_.fullPath,
1647 this.currentDirEntry_.fullPath, 1646 this.currentDirEntry_.fullPath,
1648 location.href); 1647 location.href);
1649 } 1648 }
1650 1649
1650 this.updateOkButton_();
1651 // New folder should never be enabled in the root or media/ directories. 1651 // New folder should never be enabled in the root or media/ directories.
1652 this.newFolderButton_.disabled = 1652 this.newFolderButton_.disabled =
1653 (this.currentDirEntry_.fullPath == '/' || 1653 (this.currentDirEntry_.fullPath == '/' ||
1654 this.currentDirEntry_.fullPath == MEDIA_DIRECTORY); 1654 this.currentDirEntry_.fullPath == MEDIA_DIRECTORY);
1655 1655
1656 this.document_.title = this.currentDirEntry_.fullPath; 1656 this.document_.title = this.currentDirEntry_.fullPath;
1657 this.rescanDirectory_(); 1657 this.rescanDirectory_();
1658 }; 1658 };
1659 1659
1660 /** 1660 /**
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { 2110 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) {
2111 if (!this.selection.leadEntry.isFile) 2111 if (!this.selection.leadEntry.isFile)
2112 throw new Error('Selected entry is not a file!'); 2112 throw new Error('Selected entry is not a file!');
2113 } 2113 }
2114 2114
2115 chrome.fileBrowserPrivate.selectFile(ary[0], 0); 2115 chrome.fileBrowserPrivate.selectFile(ary[0], 0);
2116 window.close(); 2116 window.close();
2117 }; 2117 };
2118 2118
2119 })(); 2119 })();
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