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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 */ | 33 */ |
34 WebInspector.WorkspaceController = function(workspace) | 34 WebInspector.WorkspaceController = function(workspace) |
35 { | 35 { |
36 this._workspace = workspace; | 36 this._workspace = workspace; |
37 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); | 37 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); |
| 38 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.FrameAdded, this._frameAdded, this); |
38 } | 39 } |
39 | 40 |
40 WebInspector.WorkspaceController.prototype = { | 41 WebInspector.WorkspaceController.prototype = { |
41 _mainFrameNavigated: function() | 42 _mainFrameNavigated: function() |
42 { | 43 { |
43 WebInspector.Revision.filterOutStaleRevisions(); | 44 WebInspector.Revision.filterOutStaleRevisions(); |
44 this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.P
rojectWillReset, this._workspace.project()); | 45 this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.P
rojectWillReset, this._workspace.project()); |
45 this._workspace.project().reset(); | 46 this._workspace.project().reset(); |
46 this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.P
rojectDidReset, this._workspace.project()); | 47 this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.P
rojectDidReset, this._workspace.project()); |
| 48 }, |
| 49 |
| 50 _frameAdded: function(event) |
| 51 { |
| 52 var frame = /** @type {WebInspector.ResourceTreeFrame} */ event.data; |
| 53 if (frame.isMainFrame()) |
| 54 WebInspector.Revision.filterOutStaleRevisions(); |
47 } | 55 } |
48 } | 56 } |
49 | 57 |
50 /** | 58 /** |
51 * @type {?WebInspector.WorkspaceController} | 59 * @type {?WebInspector.WorkspaceController} |
52 */ | 60 */ |
53 WebInspector.workspaceController = null; | 61 WebInspector.workspaceController = null; |
54 | 62 |
55 /** | 63 /** |
56 * @constructor | 64 * @constructor |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return this._project.uiSourceCodes(); | 171 return this._project.uiSourceCodes(); |
164 } | 172 } |
165 } | 173 } |
166 | 174 |
167 WebInspector.Workspace.prototype.__proto__ = WebInspector.Object.prototype; | 175 WebInspector.Workspace.prototype.__proto__ = WebInspector.Object.prototype; |
168 | 176 |
169 /** | 177 /** |
170 * @type {?WebInspector.Workspace} | 178 * @type {?WebInspector.Workspace} |
171 */ | 179 */ |
172 WebInspector.workspace = null; | 180 WebInspector.workspace = null; |
OLD | NEW |