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

Side by Side Diff: Source/devtools/front_end/ProfileLauncherView.js

Issue 147923011: Remove unnecessary _profileTypesByIdMap map (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 10 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 * @override 145 * @override
146 * @param {!WebInspector.ProfileType} profileType 146 * @param {!WebInspector.ProfileType} profileType
147 */ 147 */
148 addProfileType: function(profileType) 148 addProfileType: function(profileType)
149 { 149 {
150 var labelElement = this._profileTypeSelectorForm.createChild("label"); 150 var labelElement = this._profileTypeSelectorForm.createChild("label");
151 labelElement.textContent = profileType.name; 151 labelElement.textContent = profileType.name;
152 var optionElement = document.createElement("input"); 152 var optionElement = document.createElement("input");
153 labelElement.insertBefore(optionElement, labelElement.firstChild); 153 labelElement.insertBefore(optionElement, labelElement.firstChild);
154 this._typeIdToOptionElement[profileType.id] = optionElement; 154 this._typeIdToOptionElement[profileType.id] = optionElement;
155 optionElement._profileType = profileType;
155 optionElement.type = "radio"; 156 optionElement.type = "radio";
156 optionElement.name = "profile-type"; 157 optionElement.name = "profile-type";
157 optionElement.style.hidden = true; 158 optionElement.style.hidden = true;
158 optionElement.addEventListener("change", this._profileTypeChanged.bind(t his, profileType), false); 159 optionElement.addEventListener("change", this._profileTypeChanged.bind(t his, profileType), false);
159 var descriptionElement = labelElement.createChild("p"); 160 var descriptionElement = labelElement.createChild("p");
160 descriptionElement.textContent = profileType.description; 161 descriptionElement.textContent = profileType.description;
161 var decorationElement = profileType.decorationElement(); 162 var decorationElement = profileType.decorationElement();
162 if (decorationElement) 163 if (decorationElement)
163 labelElement.appendChild(decorationElement); 164 labelElement.appendChild(decorationElement);
164 }, 165 },
165 166
166 restoreSelectedProfileType: function() 167 restoreSelectedProfileType: function()
167 { 168 {
168 var typeName = WebInspector.settings.selectedProfileType.get(); 169 var typeId = WebInspector.settings.selectedProfileType.get();
169 if (!(typeName in this._typeIdToOptionElement)) 170 if (!(typeId in this._typeIdToOptionElement))
170 typeName = Object.keys(this._typeIdToOptionElement)[0]; 171 typeId = Object.keys(this._typeIdToOptionElement)[0];
171 this._typeIdToOptionElement[typeName].checked = true; 172 this._typeIdToOptionElement[typeId].checked = true;
172 this.dispatchEventToListeners( 173 var type = this._typeIdToOptionElement[typeId]._profileType;
173 WebInspector.MultiProfileLauncherView.EventTypes.ProfileTypeSelected , 174 this.dispatchEventToListeners(WebInspector.MultiProfileLauncherView.Even tTypes.ProfileTypeSelected, type);
174 this._panel.getProfileType(typeName));
175 }, 175 },
176 176
177 _controlButtonClicked: function() 177 _controlButtonClicked: function()
178 { 178 {
179 this._panel.toggleRecordButton(); 179 this._panel.toggleRecordButton();
180 }, 180 },
181 181
182 _updateControls: function() 182 _updateControls: function()
183 { 183 {
184 WebInspector.ProfileLauncherView.prototype._updateControls.call(this); 184 WebInspector.ProfileLauncherView.prototype._updateControls.call(this);
(...skipping 25 matching lines...) Expand all
210 210
211 profileFinished: function() 211 profileFinished: function()
212 { 212 {
213 this._isProfiling = false; 213 this._isProfiling = false;
214 this._updateControls(); 214 this._updateControls();
215 }, 215 },
216 216
217 __proto__: WebInspector.ProfileLauncherView.prototype 217 __proto__: WebInspector.ProfileLauncherView.prototype
218 } 218 }
219 219
OLDNEW
« no previous file with comments | « Source/devtools/front_end/HeapSnapshotView.js ('k') | Source/devtools/front_end/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698