| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * @return {string} | 102 * @return {string} |
| 103 */ | 103 */ |
| 104 originURL: function() | 104 originURL: function() |
| 105 { | 105 { |
| 106 return this._originURL; | 106 return this._originURL; |
| 107 }, | 107 }, |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * @param {string} url | 110 * @param {string} newName |
| 111 */ | 111 */ |
| 112 urlChanged: function(url) | 112 rename: function(newName) |
| 113 { | 113 { |
| 114 this._url = url; | 114 if (!this._path.length) |
| 115 this._originURL = url; | 115 return; |
| 116 this._path[this._path.length - 1] = newName; |
| 117 this._url = newName; |
| 118 this._originURL = newName; |
| 116 this._parsedURL = new WebInspector.ParsedURL(url); | 119 this._parsedURL = new WebInspector.ParsedURL(url); |
| 117 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.TitleChan
ged, null); | 120 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.TitleChan
ged, null); |
| 118 }, | 121 }, |
| 119 | 122 |
| 120 /** | 123 /** |
| 121 * @return {WebInspector.ParsedURL} | 124 * @return {WebInspector.ParsedURL} |
| 122 */ | 125 */ |
| 123 get parsedURL() | 126 get parsedURL() |
| 124 { | 127 { |
| 125 return this._parsedURL; | 128 return this._parsedURL; |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 function persist() | 895 function persist() |
| 893 { | 896 { |
| 894 window.localStorage[key] = this._content; | 897 window.localStorage[key] = this._content; |
| 895 window.localStorage["revision-history"] = JSON.stringify(registry); | 898 window.localStorage["revision-history"] = JSON.stringify(registry); |
| 896 } | 899 } |
| 897 | 900 |
| 898 // Schedule async storage. | 901 // Schedule async storage. |
| 899 setTimeout(persist.bind(this), 0); | 902 setTimeout(persist.bind(this), 0); |
| 900 } | 903 } |
| 901 } | 904 } |
| OLD | NEW |