Chromium Code Reviews| 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.ConsoleContextSelector = function(selectElement) | 10 WebInspector.ConsoleContextSelector = function(selectElement) |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 WebInspector.ConsoleContextSelector.prototype = { | 27 WebInspector.ConsoleContextSelector.prototype = { |
| 28 /** | 28 /** |
| 29 * @param {!WebInspector.ExecutionContext} executionContext | 29 * @param {!WebInspector.ExecutionContext} executionContext |
| 30 * @return {string} | 30 * @return {string} |
| 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 resourceTreeModel = WebInspector.ResourceTreeModel.fromTarge t(executionContext.target()); |
|
pfeldman
2016/07/07 17:44:14
What we want here is a friendly executionContext n
eostroukhov-old
2016/07/13 23:30:59
Not sure if such a fix is in scope for this refact
| |
| 38 var frame = resourceTreeModel && resourceTreeModel.frameForId(ex ecutionContext.frameId); | |
| 38 result = frame ? frame.displayName() : executionContext.label() ; | 39 result = frame ? frame.displayName() : executionContext.label() ; |
| 39 } else { | 40 } else { |
| 40 result = executionContext.target().decorateLabel(executionContex t.label()); | 41 result = executionContext.target().decorateLabel(executionContex t.label()); |
| 41 } | 42 } |
| 42 } else { | 43 } else { |
| 43 result = "\u00a0\u00a0\u00a0\u00a0" + (executionContext.label() || e xecutionContext.origin); | 44 result = "\u00a0\u00a0\u00a0\u00a0" + (executionContext.label() || e xecutionContext.origin); |
| 44 } | 45 } |
| 45 | 46 |
| 46 var maxLength = 50; | 47 var maxLength = 50; |
| 47 return result.trimMiddle(maxLength); | 48 return result.trimMiddle(maxLength); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 /** | 174 /** |
| 174 * @return {?Element} | 175 * @return {?Element} |
| 175 */ | 176 */ |
| 176 _selectedOption: function() | 177 _selectedOption: function() |
| 177 { | 178 { |
| 178 if (this._selectElement.selectedIndex >= 0) | 179 if (this._selectElement.selectedIndex >= 0) |
| 179 return this._selectElement[this._selectElement.selectedIndex]; | 180 return this._selectElement[this._selectElement.selectedIndex]; |
| 180 return null; | 181 return null; |
| 181 } | 182 } |
| 182 } | 183 } |
| OLD | NEW |