OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @implements {WebInspector.TargetManager.Observer} | 7 * @implements {WebInspector.TargetManager.Observer} |
8 * @param {!Element} selectElement | 8 * @param {!Element} selectElement |
9 */ | 9 */ |
10 WebInspector.ExecutionContextModel = function(selectElement) | 10 WebInspector.ExecutionContextModel = function(selectElement) |
(...skipping 20 matching lines...) Expand all Loading... |
31 */ | 31 */ |
32 _titleFor: function(executionContext) | 32 _titleFor: function(executionContext) |
33 { | 33 { |
34 var result; | 34 var result; |
35 if (executionContext.isDefault) { | 35 if (executionContext.isDefault) { |
36 if (executionContext.frameId) { | 36 if (executionContext.frameId) { |
37 var frame = executionContext.target().resourceTreeModel.frameFor
Id(executionContext.frameId); | 37 var frame = executionContext.target().resourceTreeModel.frameFor
Id(executionContext.frameId); |
38 result = frame ? frame.displayName() : (executionContext.origin
|| executionContext.name); | 38 result = frame ? frame.displayName() : (executionContext.origin
|| executionContext.name); |
39 } else { | 39 } else { |
40 var parsedUrl = executionContext.origin.asParsedURL(); | 40 var parsedUrl = executionContext.origin.asParsedURL(); |
41 var name = parsedUrl? parsedUrl.lastPathComponentWithFragment()
: executionContext.name; | 41 var name = parsedUrl ? parsedUrl.lastPathComponentWithFragment()
: executionContext.name; |
42 result = executionContext.target().decorateLabel(name); | 42 result = executionContext.target().decorateLabel(name); |
43 } | 43 } |
44 } else { | 44 } else { |
45 result = "\u00a0\u00a0\u00a0\u00a0" + (executionContext.name || exec
utionContext.origin); | 45 result = "\u00a0\u00a0\u00a0\u00a0" + (executionContext.name || exec
utionContext.origin); |
46 } | 46 } |
47 | 47 |
48 var maxLength = 50; | 48 var maxLength = 50; |
49 return result.trimMiddle(maxLength); | 49 return result.trimMiddle(maxLength); |
50 }, | 50 }, |
51 | 51 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 /** | 178 /** |
179 * @return {?Element} | 179 * @return {?Element} |
180 */ | 180 */ |
181 _selectedOption: function() | 181 _selectedOption: function() |
182 { | 182 { |
183 if (this._selectElement.selectedIndex >= 0) | 183 if (this._selectElement.selectedIndex >= 0) |
184 return this._selectElement[this._selectElement.selectedIndex]; | 184 return this._selectElement[this._selectElement.selectedIndex]; |
185 return null; | 185 return null; |
186 } | 186 } |
187 } | 187 } |
OLD | NEW |