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

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

Issue 2136763002: DevTools: Sort execution contexts in nested frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge conflict 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // This check could be removed once we do not send this context to front end. 56 // This check could be removed once we do not send this context to front end.
57 if (executionContext.target().isServiceWorker()) 57 if (executionContext.target().isServiceWorker())
58 return; 58 return;
59 59
60 var newOption = createElement("option"); 60 var newOption = createElement("option");
61 newOption.__executionContext = executionContext; 61 newOption.__executionContext = executionContext;
62 newOption.text = this._titleFor(executionContext); 62 newOption.text = this._titleFor(executionContext);
63 this._optionByExecutionContext.set(executionContext, newOption); 63 this._optionByExecutionContext.set(executionContext, newOption);
64 var options = this._selectElement.options; 64 var options = this._selectElement.options;
65 var contexts = Array.prototype.map.call(options, mapping); 65 var contexts = Array.prototype.map.call(options, mapping);
66 var index = contexts.lowerBound(executionContext, WebInspector.Execution Context.comparator) 66 var index = contexts.lowerBound(executionContext, executionContext.runti meModel.executionContextComparator())
67 this._selectElement.insertBefore(newOption, options[index]); 67 this._selectElement.insertBefore(newOption, options[index]);
68 68
69 if (executionContext === WebInspector.context.flavor(WebInspector.Execut ionContext)) 69 if (executionContext === WebInspector.context.flavor(WebInspector.Execut ionContext))
70 this._select(newOption); 70 this._select(newOption);
71 71
72 /** 72 /**
73 * @param {!Element} option 73 * @param {!Element} option
74 * @return {!WebInspector.ExecutionContext} 74 * @return {!WebInspector.ExecutionContext}
75 */ 75 */
76 function mapping(option) 76 function mapping(option)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 /** 173 /**
174 * @return {?Element} 174 * @return {?Element}
175 */ 175 */
176 _selectedOption: function() 176 _selectedOption: function()
177 { 177 {
178 if (this._selectElement.selectedIndex >= 0) 178 if (this._selectElement.selectedIndex >= 0)
179 return this._selectElement[this._selectElement.selectedIndex]; 179 return this._selectElement[this._selectElement.selectedIndex];
180 return null; 180 return null;
181 } 181 }
182 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698