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

Side by Side Diff: Source/devtools/front_end/sources/TargetsToolbar.js

Issue 367093003: DevTools: More code reduce via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/source_frame/GoToLineDialog.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698