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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698