/**
* @constructor
- * @extends {WebInspector.View}
+ * @extends {WebInspector.VBox}
* @param {!WebInspector.ProfilesPanel} profilesPanel
*/
WebInspector.ProfileLauncherView = function(profilesPanel)
{
- WebInspector.View.call(this);
+ WebInspector.VBox.call(this);
this._panel = profilesPanel;
this._controlButton = this._contentElement.createChild("button", "control-profiling");
this._controlButton.addEventListener("click", this._controlButtonClicked.bind(this), false);
+
+ this._loadButton = this._contentElement.createChild("button", "load-profile");
+ this._loadButton.textContent = WebInspector.UIString("Load");
+ this._loadButton.addEventListener("click", this._loadButtonClicked.bind(this), false);
}
WebInspector.ProfileLauncherView.prototype = {
this._panel.toggleRecordButton();
},
+ _loadButtonClicked: function()
+ {
+ this._panel.showLoadFromFileDialog();
+ },
+
_updateControls: function()
{
if (this._isEnabled)
this._updateControls();
},
- __proto__: WebInspector.View.prototype
+ __proto__: WebInspector.VBox.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;
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()