| 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 */ | 8 */ |
| 9 WebInspector.TargetsToolbar = function() | 9 WebInspector.TargetsToolbar = function() |
| 10 { | 10 { |
| 11 this.element = document.createElement("div"); | 11 this.element = document.createElementWithClass("div", "status-bar scripts-de
bug-toolbar targets-toolbar hidden"); |
| 12 this.element.className = "status-bar scripts-debug-toolbar targets-toolbar h
idden"; | |
| 13 this._comboBox = new WebInspector.StatusBarComboBox(this._onComboBoxSelectio
nChange.bind(this)); | 12 this._comboBox = new WebInspector.StatusBarComboBox(this._onComboBoxSelectio
nChange.bind(this)); |
| 14 this.element.appendChild(this._comboBox.element); | 13 this.element.appendChild(this._comboBox.element); |
| 15 | 14 |
| 16 /** @type {!Map.<!WebInspector.Target, !Element>} */ | 15 /** @type {!Map.<!WebInspector.Target, !Element>} */ |
| 17 this._targetToOption = new Map(); | 16 this._targetToOption = new Map(); |
| 18 if (!WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) | 17 if (!WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) |
| 19 return; | 18 return; |
| 20 | 19 |
| 21 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targ
etChangedExternally, this); | 20 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targ
etChangedExternally, this); |
| 22 WebInspector.targetManager.observeTargets(this); | 21 WebInspector.targetManager.observeTargets(this); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 _targetChangedExternally: function(event) | 68 _targetChangedExternally: function(event) |
| 70 { | 69 { |
| 71 var target = /** @type {?WebInspector.Target} */ (event.data); | 70 var target = /** @type {?WebInspector.Target} */ (event.data); |
| 72 if (target) { | 71 if (target) { |
| 73 var option = /** @type {!Element} */ (this._targetToOption.get(targe
t)); | 72 var option = /** @type {!Element} */ (this._targetToOption.get(targe
t)); |
| 74 this._comboBox.select(option); | 73 this._comboBox.select(option); |
| 75 } | 74 } |
| 76 } | 75 } |
| 77 | 76 |
| 78 } | 77 } |
| OLD | NEW |