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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/HeapSnapshotView.js ('k') | Source/devtools/front_end/ProfilesPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ProfileLauncherView.js
diff --git a/Source/devtools/front_end/ProfileLauncherView.js b/Source/devtools/front_end/ProfileLauncherView.js
index 7f40ae5375b0421f3a663e22b0963fe1914c8356..a2486fb805779ce11a006fcaf16ce977c2e0810d 100644
--- a/Source/devtools/front_end/ProfileLauncherView.js
+++ b/Source/devtools/front_end/ProfileLauncherView.js
@@ -152,6 +152,7 @@ WebInspector.MultiProfileLauncherView.prototype = {
var optionElement = document.createElement("input");
labelElement.insertBefore(optionElement, labelElement.firstChild);
this._typeIdToOptionElement[profileType.id] = optionElement;
+ optionElement._profileType = profileType;
optionElement.type = "radio";
optionElement.name = "profile-type";
optionElement.style.hidden = true;
@@ -165,13 +166,12 @@ WebInspector.MultiProfileLauncherView.prototype = {
restoreSelectedProfileType: function()
{
- var typeName = WebInspector.settings.selectedProfileType.get();
- if (!(typeName in this._typeIdToOptionElement))
- typeName = Object.keys(this._typeIdToOptionElement)[0];
- this._typeIdToOptionElement[typeName].checked = true;
- this.dispatchEventToListeners(
- WebInspector.MultiProfileLauncherView.EventTypes.ProfileTypeSelected,
- this._panel.getProfileType(typeName));
+ var typeId = WebInspector.settings.selectedProfileType.get();
+ if (!(typeId in this._typeIdToOptionElement))
+ typeId = Object.keys(this._typeIdToOptionElement)[0];
+ this._typeIdToOptionElement[typeId].checked = true;
+ var type = this._typeIdToOptionElement[typeId]._profileType;
+ this.dispatchEventToListeners(WebInspector.MultiProfileLauncherView.EventTypes.ProfileTypeSelected, type);
},
_controlButtonClicked: function()
« 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