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

Side by Side Diff: Source/devtools/front_end/sources/NavigatorView.js

Issue 313603003: Devtools: get rid of ProjectWillReset event, introduce ProjectRemoved instead of it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
OLDNEW
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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return "navigator-folder-tree-item"; 71 return "navigator-folder-tree-item";
72 return "navigator-folder-tree-item"; 72 return "navigator-folder-tree-item";
73 } 73 }
74 74
75 WebInspector.NavigatorView.prototype = { 75 WebInspector.NavigatorView.prototype = {
76 setWorkspace: function(workspace) 76 setWorkspace: function(workspace)
77 { 77 {
78 this._workspace = workspace; 78 this._workspace = workspace;
79 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceC odeAdded, this._uiSourceCodeAdded, this); 79 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceC odeAdded, this._uiSourceCodeAdded, this);
80 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceC odeRemoved, this._uiSourceCodeRemoved, this); 80 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceC odeRemoved, this._uiSourceCodeRemoved, this);
81 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWi llReset, this._projectWillReset.bind(this), this); 81 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRe moved, this._projectRemoved.bind(this), this);
82 }, 82 },
83 83
84 wasShown: function() 84 wasShown: function()
85 { 85 {
86 if (this._loaded) 86 if (this._loaded)
87 return; 87 return;
88 this._loaded = true; 88 this._loaded = true;
89 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this) ); 89 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this) );
90 }, 90 },
91 91
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 */ 126 */
127 _uiSourceCodeRemoved: function(event) 127 _uiSourceCodeRemoved: function(event)
128 { 128 {
129 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data ); 129 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data );
130 this._removeUISourceCode(uiSourceCode); 130 this._removeUISourceCode(uiSourceCode);
131 }, 131 },
132 132
133 /** 133 /**
134 * @param {!WebInspector.Event} event 134 * @param {!WebInspector.Event} event
135 */ 135 */
136 _projectWillReset: function(event) 136 _projectRemoved: function(event)
137 { 137 {
138 var project = /** @type {!WebInspector.Project} */ (event.data); 138 var project = /** @type {!WebInspector.Project} */ (event.data);
139 var uiSourceCodes = project.uiSourceCodes(); 139 var uiSourceCodes = project.uiSourceCodes();
140 for (var i = 0; i < uiSourceCodes.length; ++i) 140 for (var i = 0; i < uiSourceCodes.length; ++i)
141 this._removeUISourceCode(uiSourceCodes[i]); 141 this._removeUISourceCode(uiSourceCodes[i]);
142 }, 142 },
143 143
144 /** 144 /**
145 * @param {!WebInspector.Project} project 145 * @param {!WebInspector.Project} project
146 * @return {!WebInspector.NavigatorTreeNode} 146 * @return {!WebInspector.NavigatorTreeNode}
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 1411
1412 willRemoveChild: function(node) 1412 willRemoveChild: function(node)
1413 { 1413 {
1414 if (node._isMerged || !this.isPopulated()) 1414 if (node._isMerged || !this.isPopulated())
1415 return; 1415 return;
1416 this._treeElement.removeChild(node._treeElement); 1416 this._treeElement.removeChild(node._treeElement);
1417 }, 1417 },
1418 1418
1419 __proto__: WebInspector.NavigatorTreeNode.prototype 1419 __proto__: WebInspector.NavigatorTreeNode.prototype
1420 } 1420 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698