OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 23 matching lines...) Expand all Loading... |
34 */ | 34 */ |
35 WebInspector.FileManager = function() | 35 WebInspector.FileManager = function() |
36 { | 36 { |
37 this._savedURLsSetting = WebInspector.settings.createLocalSetting("savedURLs
", {}); | 37 this._savedURLsSetting = WebInspector.settings.createLocalSetting("savedURLs
", {}); |
38 | 38 |
39 /** @type {!Object.<string, ?function(boolean)>} */ | 39 /** @type {!Object.<string, ?function(boolean)>} */ |
40 this._saveCallbacks = {}; | 40 this._saveCallbacks = {}; |
41 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.SavedURL, this._savedURL, this); | 41 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.SavedURL, this._savedURL, this); |
42 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.CanceledSaveURL, this._canceledSaveURL, this); | 42 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.CanceledSaveURL, this._canceledSaveURL, this); |
43 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.AppendedToURL, this._appendedToURL, this); | 43 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.AppendedToURL, this._appendedToURL, this); |
44 } | 44 }; |
45 | 45 |
46 /** @enum {symbol} */ | 46 /** @enum {symbol} */ |
47 WebInspector.FileManager.Events = { | 47 WebInspector.FileManager.Events = { |
48 SavedURL: Symbol("SavedURL"), | 48 SavedURL: Symbol("SavedURL"), |
49 AppendedToURL: Symbol("AppendedToURL") | 49 AppendedToURL: Symbol("AppendedToURL") |
50 } | 50 }; |
51 | 51 |
52 WebInspector.FileManager.prototype = { | 52 WebInspector.FileManager.prototype = { |
53 /** | 53 /** |
54 * @param {string} url | 54 * @param {string} url |
55 * @param {string} content | 55 * @param {string} content |
56 * @param {boolean} forceSaveAs | 56 * @param {boolean} forceSaveAs |
57 * @param {function(boolean)=} callback | 57 * @param {function(boolean)=} callback |
58 */ | 58 */ |
59 save: function(url, content, forceSaveAs, callback) | 59 save: function(url, content, forceSaveAs, callback) |
60 { | 60 { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 /** | 130 /** |
131 * @param {!WebInspector.Event} event | 131 * @param {!WebInspector.Event} event |
132 */ | 132 */ |
133 _appendedToURL: function(event) | 133 _appendedToURL: function(event) |
134 { | 134 { |
135 var url = /** @type {string} */ (event.data); | 135 var url = /** @type {string} */ (event.data); |
136 this.dispatchEventToListeners(WebInspector.FileManager.Events.AppendedTo
URL, url); | 136 this.dispatchEventToListeners(WebInspector.FileManager.Events.AppendedTo
URL, url); |
137 }, | 137 }, |
138 | 138 |
139 __proto__: WebInspector.Object.prototype | 139 __proto__: WebInspector.Object.prototype |
140 } | 140 }; |
141 | 141 |
142 /** | 142 /** |
143 * @type {?WebInspector.FileManager} | 143 * @type {?WebInspector.FileManager} |
144 */ | 144 */ |
145 WebInspector.fileManager = null; | 145 WebInspector.fileManager = null; |
OLD | NEW |