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

Side by Side Diff: Source/devtools/front_end/sdk/FileSystemWorkspaceBinding.js

Issue 432753003: DevTools: Fix url assignment when renaming files in workspace (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added a test and fixed correctly Created 6 years, 4 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 | « LayoutTests/inspector/sources/debugger/file-system-project-mapping-expected.txt ('k') | 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 { 315 {
316 if (!success) { 316 if (!success) {
317 callback(false, newName); 317 callback(false, newName);
318 return; 318 return;
319 } 319 }
320 var validNewName = /** @type {string} */ (newName); 320 var validNewName = /** @type {string} */ (newName);
321 console.assert(validNewName); 321 console.assert(validNewName);
322 var slash = filePath.lastIndexOf("/"); 322 var slash = filePath.lastIndexOf("/");
323 var parentPath = filePath.substring(0, slash); 323 var parentPath = filePath.substring(0, slash);
324 filePath = parentPath + "/" + validNewName; 324 filePath = parentPath + "/" + validNewName;
325 filePath = filePath.substr(1);
325 var newURL = this._workspace.urlForPath(this._fileSystem.path(), fil ePath); 326 var newURL = this._workspace.urlForPath(this._fileSystem.path(), fil ePath);
326 var extension = this._extensionForPath(validNewName); 327 var extension = this._extensionForPath(validNewName);
327 var newOriginURL = this._fileSystemURL + filePath 328 var newOriginURL = this._fileSystemURL + filePath
328 var newContentType = this._contentTypeForExtension(extension); 329 var newContentType = this._contentTypeForExtension(extension);
329 callback(true, validNewName, newURL, newOriginURL, newContentType); 330 callback(true, validNewName, newURL, newOriginURL, newContentType);
330 } 331 }
331 }, 332 },
332 333
333 /** 334 /**
334 * @param {string} path 335 * @param {string} path
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 dispose: function() 583 dispose: function()
583 { 584 {
584 this._workspace.removeProject(this._projectId); 585 this._workspace.removeProject(this._projectId);
585 } 586 }
586 } 587 }
587 588
588 /** 589 /**
589 * @type {!WebInspector.FileSystemWorkspaceBinding} 590 * @type {!WebInspector.FileSystemWorkspaceBinding}
590 */ 591 */
591 WebInspector.fileSystemWorkspaceBinding; 592 WebInspector.fileSystemWorkspaceBinding;
OLDNEW
« no previous file with comments | « LayoutTests/inspector/sources/debugger/file-system-project-mapping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698