OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @param {!Element} elementToHide | 9 * @param {!Element} elementToHide |
10 */ | 10 */ |
11 WebInspector.TargetsComboBoxController = function(selectElement, elementToHide) | 11 WebInspector.TargetsComboBoxController = function(selectElement, elementToHide) |
12 { | 12 { |
13 elementToHide.classList.add("hidden"); | 13 elementToHide.classList.add("hidden"); |
14 selectElement.addEventListener("change", this._onComboBoxSelectionChange.bin
d(this), false); | 14 selectElement.addEventListener("change", this._onComboBoxSelectionChange.bin
d(this), false); |
15 this._selectElement = selectElement; | 15 this._selectElement = selectElement; |
16 this._elementToHide = elementToHide; | 16 this._elementToHide = elementToHide; |
17 /** @type {!Map.<!WebInspector.Target, !Element>} */ | 17 /** @type {!Map.<!WebInspector.Target, !Element>} */ |
18 this._targetToOption = new Map(); | 18 this._targetToOption = new Map(); |
19 if (!WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) | |
20 return; | |
21 | 19 |
22 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targ
etChangedExternally, this); | 20 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targ
etChangedExternally, this); |
23 WebInspector.targetManager.observeTargets(this); | 21 WebInspector.targetManager.observeTargets(this); |
24 } | 22 } |
25 | 23 |
26 WebInspector.TargetsComboBoxController.prototype = { | 24 WebInspector.TargetsComboBoxController.prototype = { |
27 | 25 |
28 /** | 26 /** |
29 * @param {!WebInspector.Target} target | 27 * @param {!WebInspector.Target} target |
30 */ | 28 */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 77 |
80 /** | 78 /** |
81 * @param {!Element} option | 79 * @param {!Element} option |
82 */ | 80 */ |
83 _select: function(option) | 81 _select: function(option) |
84 { | 82 { |
85 this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @ty
pe {?} */ (this._selectElement), option); | 83 this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @ty
pe {?} */ (this._selectElement), option); |
86 } | 84 } |
87 | 85 |
88 } | 86 } |
OLD | NEW |