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

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

Issue 8414006: Make FileManagerDialog::SelectFileImpl() properly accept simple filenames as default path. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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 | chrome/browser/ui/views/file_manager_dialog.cc » ('j') | 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 // 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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 foundRemovable = true; 1267 foundRemovable = true;
1268 } else { // Done enumerating, and we know the answer. 1268 } else { // Done enumerating, and we know the answer.
1269 this.changeDirectory(foundRemovable ? '/' : DOWNLOADS_DIRECTORY, 1269 this.changeDirectory(foundRemovable ? '/' : DOWNLOADS_DIRECTORY,
1270 CD_NO_HISTORY); 1270 CD_NO_HISTORY);
1271 } 1271 }
1272 }.bind(this)); 1272 }.bind(this));
1273 }; 1273 };
1274 1274
1275 FileManager.prototype.setupPath_ = function(path) { 1275 FileManager.prototype.setupPath_ = function(path) {
1276 // Split the dirname from the basename. 1276 // Split the dirname from the basename.
1277 var ary = path.match(/^(.*?)(?:\/([^\/]+))?$/); 1277 var ary = path.match(/^(?:(.*)\/)?([^\/]*)$/);
1278 if (!ary) { 1278 if (!ary) {
1279 console.warn('Unable to split default path: ' + path); 1279 console.warn('Unable to split default path: ' + path);
1280 self.changeDirectory('/', CD_NO_HISTORY); 1280 self.changeDirectory('/', CD_NO_HISTORY);
1281 return; 1281 return;
1282 } 1282 }
1283 1283
1284 var baseName = ary[1]; 1284 var baseName = ary[1];
1285 var leafName = ary[2]; 1285 var leafName = ary[2];
1286 1286
1287 var self = this; 1287 var self = this;
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 3582
3583 if (msg) { 3583 if (msg) {
3584 console.log('no no no'); 3584 console.log('no no no');
3585 this.alert.show(msg, onAccept); 3585 this.alert.show(msg, onAccept);
3586 return false; 3586 return false;
3587 } 3587 }
3588 3588
3589 return true; 3589 return true;
3590 }; 3590 };
3591 })(); 3591 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/file_manager_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698