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 * 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 Loading... |
71 * @override | 71 * @override |
72 * @param {!WebInspector.UISourceCode} uiSourceCode | 72 * @param {!WebInspector.UISourceCode} uiSourceCode |
73 */ | 73 */ |
74 uiSourceCodeAdded: function(uiSourceCode) | 74 uiSourceCodeAdded: function(uiSourceCode) |
75 { | 75 { |
76 var inspectedPageURL = WebInspector.targetManager.mainTarget().inspected
URL(); | 76 var inspectedPageURL = WebInspector.targetManager.mainTarget().inspected
URL(); |
77 if (uiSourceCode.url() === inspectedPageURL) | 77 if (uiSourceCode.url() === inspectedPageURL) |
78 this.revealUISourceCode(uiSourceCode, true); | 78 this.revealUISourceCode(uiSourceCode, true); |
79 }, | 79 }, |
80 | 80 |
| 81 /** |
| 82 * @override |
| 83 * @param {!Event} event |
| 84 */ |
| 85 handleContextMenu: function(event) |
| 86 { |
| 87 var contextMenu = new WebInspector.ContextMenu(event); |
| 88 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); |
| 89 contextMenu.show(); |
| 90 }, |
| 91 |
| 92 __proto__: WebInspector.NavigatorView.prototype |
| 93 } |
| 94 |
| 95 /** |
| 96 * @constructor |
| 97 * @extends {WebInspector.NavigatorView} |
| 98 */ |
| 99 WebInspector.NetworkNavigatorView = function() |
| 100 { |
| 101 WebInspector.NavigatorView.call(this); |
| 102 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.InspectedURLChanged, this._inspectedURLChanged, this); |
| 103 } |
| 104 |
| 105 WebInspector.NetworkNavigatorView.prototype = { |
| 106 /** |
| 107 * @override |
| 108 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 109 * @return {boolean} |
| 110 */ |
| 111 accept: function(uiSourceCode) |
| 112 { |
| 113 return uiSourceCode.project().type() === WebInspector.projectTypes.Netwo
rk; |
| 114 }, |
| 115 |
| 116 /** |
| 117 * @param {!WebInspector.Event} event |
| 118 */ |
| 119 _inspectedURLChanged: function(event) |
| 120 { |
| 121 var mainTarget = WebInspector.targetManager.mainTarget(); |
| 122 if (event.data !== mainTarget) |
| 123 return; |
| 124 var inspectedURL = mainTarget && mainTarget.inspectedURL(); |
| 125 if (!inspectedURL) |
| 126 return |
| 127 for (var node of this._uiSourceCodeNodes.valuesArray()) { |
| 128 var uiSourceCode = node.uiSourceCode(); |
| 129 if (uiSourceCode.url() === inspectedURL) |
| 130 this.revealUISourceCode(uiSourceCode, true); |
| 131 } |
| 132 }, |
| 133 |
| 134 /** |
| 135 * @override |
| 136 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 137 */ |
| 138 uiSourceCodeAdded: function(uiSourceCode) |
| 139 { |
| 140 var inspectedPageURL = WebInspector.targetManager.mainTarget().inspected
URL(); |
| 141 if (uiSourceCode.url() === inspectedPageURL) |
| 142 this.revealUISourceCode(uiSourceCode, true); |
| 143 }, |
| 144 |
81 __proto__: WebInspector.NavigatorView.prototype | 145 __proto__: WebInspector.NavigatorView.prototype |
82 } | 146 } |
83 | 147 |
| 148 /** |
| 149 * @constructor |
| 150 * @extends {WebInspector.NavigatorView} |
| 151 */ |
| 152 WebInspector.FilesNavigatorView = function() |
| 153 { |
| 154 WebInspector.NavigatorView.call(this); |
| 155 } |
| 156 |
| 157 WebInspector.FilesNavigatorView.prototype = { |
| 158 /** |
| 159 * @override |
| 160 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 161 * @return {boolean} |
| 162 */ |
| 163 accept: function(uiSourceCode) |
| 164 { |
| 165 return uiSourceCode.project().type() === WebInspector.projectTypes.FileS
ystem; |
| 166 }, |
| 167 |
| 168 /** |
| 169 * @override |
| 170 * @param {!Event} event |
| 171 */ |
| 172 handleContextMenu: function(event) |
| 173 { |
| 174 var contextMenu = new WebInspector.ContextMenu(event); |
| 175 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); |
| 176 contextMenu.show(); |
| 177 }, |
| 178 |
| 179 __proto__: WebInspector.NavigatorView.prototype |
| 180 } |
| 181 |
84 /** | 182 /** |
85 * @constructor | 183 * @constructor |
86 * @extends {WebInspector.NavigatorView} | 184 * @extends {WebInspector.NavigatorView} |
87 */ | 185 */ |
88 WebInspector.ContentScriptsNavigatorView = function() | 186 WebInspector.ContentScriptsNavigatorView = function() |
89 { | 187 { |
90 WebInspector.NavigatorView.call(this); | 188 WebInspector.NavigatorView.call(this); |
91 } | 189 } |
92 | 190 |
93 WebInspector.ContentScriptsNavigatorView.prototype = { | 191 WebInspector.ContentScriptsNavigatorView.prototype = { |
94 /** | 192 /** |
95 * @override | 193 * @override |
96 * @param {!WebInspector.UISourceCode} uiSourceCode | 194 * @param {!WebInspector.UISourceCode} uiSourceCode |
97 * @return {boolean} | 195 * @return {boolean} |
98 */ | 196 */ |
99 accept: function(uiSourceCode) | 197 accept: function(uiSourceCode) |
100 { | 198 { |
101 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode)) | |
102 return false; | |
103 return uiSourceCode.project().type() === WebInspector.projectTypes.Conte
ntScripts; | 199 return uiSourceCode.project().type() === WebInspector.projectTypes.Conte
ntScripts; |
104 }, | 200 }, |
105 | 201 |
106 __proto__: WebInspector.NavigatorView.prototype | 202 __proto__: WebInspector.NavigatorView.prototype |
107 } | 203 } |
108 | 204 |
109 /** | 205 /** |
110 * @constructor | 206 * @constructor |
111 * @extends {WebInspector.NavigatorView} | 207 * @extends {WebInspector.NavigatorView} |
112 */ | 208 */ |
113 WebInspector.SnippetsNavigatorView = function() | 209 WebInspector.SnippetsNavigatorView = function() |
114 { | 210 { |
115 WebInspector.NavigatorView.call(this); | 211 WebInspector.NavigatorView.call(this); |
116 } | 212 } |
117 | 213 |
118 WebInspector.SnippetsNavigatorView.prototype = { | 214 WebInspector.SnippetsNavigatorView.prototype = { |
119 /** | 215 /** |
120 * @override | 216 * @override |
121 * @param {!WebInspector.UISourceCode} uiSourceCode | 217 * @param {!WebInspector.UISourceCode} uiSourceCode |
122 * @return {boolean} | 218 * @return {boolean} |
123 */ | 219 */ |
124 accept: function(uiSourceCode) | 220 accept: function(uiSourceCode) |
125 { | 221 { |
126 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode)) | |
127 return false; | |
128 return uiSourceCode.project().type() === WebInspector.projectTypes.Snipp
ets; | 222 return uiSourceCode.project().type() === WebInspector.projectTypes.Snipp
ets; |
129 }, | 223 }, |
130 | 224 |
131 /** | 225 /** |
132 * @override | 226 * @override |
133 * @param {!Event} event | 227 * @param {!Event} event |
134 */ | 228 */ |
135 handleContextMenu: function(event) | 229 handleContextMenu: function(event) |
136 { | 230 { |
137 var contextMenu = new WebInspector.ContextMenu(event); | 231 var contextMenu = new WebInspector.ContextMenu(event); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 /** | 290 /** |
197 * @override | 291 * @override |
198 */ | 292 */ |
199 sourceDeleted: function(uiSourceCode) | 293 sourceDeleted: function(uiSourceCode) |
200 { | 294 { |
201 this._handleRemoveSnippet(uiSourceCode); | 295 this._handleRemoveSnippet(uiSourceCode); |
202 }, | 296 }, |
203 | 297 |
204 __proto__: WebInspector.NavigatorView.prototype | 298 __proto__: WebInspector.NavigatorView.prototype |
205 } | 299 } |
OLD | NEW |