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

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

Issue 7108066: CrOS - Fix crash when pressing Enter in file browser dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ensure we look up the right browser instance 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
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_METADATA = true; 7 const ENABLE_METADATA = true;
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_METADATA; 10 const ENABLE_THUMBNAIL_VIEW = ENABLE_METADATA;
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 if (path && path != '/') { 2005 if (path && path != '/') {
2006 var path = path.replace(/\/[^\/]+$/, ''); 2006 var path = path.replace(/\/[^\/]+$/, '');
2007 this.changeDirectory(path || '/'); 2007 this.changeDirectory(path || '/');
2008 } 2008 }
2009 break; 2009 break;
2010 2010
2011 case 13: // Enter => Change directory or complete dialog. 2011 case 13: // Enter => Change directory or complete dialog.
2012 if (this.selection.totalCount == 1 && 2012 if (this.selection.totalCount == 1 &&
2013 this.selection.leadEntry.isDirectory && 2013 this.selection.leadEntry.isDirectory &&
2014 this.dialogType_ != FileManager.SELECT_FOLDER) { 2014 this.dialogType_ != FileManager.SELECT_FOLDER) {
2015 event.preventDefault();
achuithb 2011/06/10 22:09:40 Run this by rginda to make sure this is fine.
2015 this.changeDirectory(this.selection.leadEntry.fullPath); 2016 this.changeDirectory(this.selection.leadEntry.fullPath);
2016 } else if (!this.okButton_.disabled) { 2017 } else if (!this.okButton_.disabled) {
2018 event.preventDefault();
2017 this.onOk_(); 2019 this.onOk_();
2018 } 2020 }
2019 break; 2021 break;
2020 2022
2021 case 27: // Escape => Cancel dialog. 2023 case 27: // Escape => Cancel dialog.
2022 event.preventDefault(); 2024 event.preventDefault();
2023 this.onCancel_(); 2025 this.onCancel_();
2024 break; 2026 break;
2025 2027
2026 case 32: // Ctrl-Space => New Folder. 2028 case 32: // Ctrl-Space => New Folder.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { 2129 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) {
2128 if (!this.selection.leadEntry.isFile) 2130 if (!this.selection.leadEntry.isFile)
2129 throw new Error('Selected entry is not a file!'); 2131 throw new Error('Selected entry is not a file!');
2130 } 2132 }
2131 2133
2132 chrome.fileBrowserPrivate.selectFile(ary[0], 0); 2134 chrome.fileBrowserPrivate.selectFile(ary[0], 0);
2133 window.close(); 2135 window.close();
2134 }; 2136 };
2135 2137
2136 })(); 2138 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698