Commit cc5ebeb9 authored by loislo@chromium.org's avatar loislo@chromium.org
Browse files

Web Inspector: "Load profile..." context menu item has to be shown only for...

Web Inspector: "Load profile..." context menu item has to be shown only for left column with the list of profiles.
https://bugs.webkit.org/show_bug.cgi?id=98163

Reviewed by Yury Semikhatsky.

The text was changed to "Load Heap Snapshot..."
Also I changed "Save profile..." to "Save Heap Snapshot..." because other profiles don't support Save/Load operations yet.
The Load context menu item will appear only when the user clicked in sidebar the tree empty space or a profile.

* English.lproj/localizedStrings.js:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._handleContextMenuEvent):
(WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 301e929c
2012-10-02 Ilya Tikhonovsky <loislo@chromium.org>
Web Inspector: "Load profile..." context menu item has to be shown only for left column with the list of profiles.
https://bugs.webkit.org/show_bug.cgi?id=98163
Reviewed by Yury Semikhatsky.
The text was changed to "Load Heap Snapshot..."
Also I changed "Save profile..." to "Save Heap Snapshot..." because other profiles don't support Save/Load operations yet.
The Load context menu item will appear only when the user clicked in sidebar the tree empty space or a profile.
* English.lproj/localizedStrings.js:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._handleContextMenuEvent):
(WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
2012-10-03 Harald Alvestrand <hta@google.com>
Add data passing to the GetStats interface of RTCPeerConnection
......
......@@ -712,8 +712,9 @@ localizedStrings["Save profile\u2026"] = "Save profile\u2026";
localizedStrings["'%s' not found."] = "'%s' not found.";
localizedStrings["'%s' is not readable"] = "'%s' is not readable";
localizedStrings["'%s' error %d"] = "'%s' error %d";
localizedStrings["Load profile\u2026"] = "Load profile\u2026";
localizedStrings["Save profile\u2026"] = "Save profile\u2026";
localizedStrings["Load Heap Snapshot\u2026"] = "Load Heap Snapshot\u2026";
localizedStrings["Save Heap Snapshot\u2026"] = "Save Heap Snapshot\u2026";
localizedStrings["Delete Heap Snapshot"] = "Delete Heap Snapshot";
localizedStrings["Show debugger"] = "Show debugger";
localizedStrings["Hide debugger"] = "Hide debugger";
localizedStrings["Clipboard access is denied"] = "Clipboard access is denied";
......
......@@ -428,11 +428,14 @@ WebInspector.ProfilesPanel.prototype = {
element.treeElement.handleContextMenuEvent(event);
return;
}
var contextMenu = new WebInspector.ContextMenu();
if (this.visibleView instanceof WebInspector.HeapSnapshotView)
this.visibleView.populateContextMenu(contextMenu, event);
contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
contextMenu.show(event);
if (element !== this.element || event.srcElement === this.sidebarElement) {
var contextMenu = new WebInspector.ContextMenu();
if (this.visibleView instanceof WebInspector.HeapSnapshotView)
this.visibleView.populateContextMenu(contextMenu, event);
contextMenu.appendItem(WebInspector.UIString("Load Heap Snapshot\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
contextMenu.show(event);
}
},
/**
......@@ -1246,12 +1249,16 @@ WebInspector.ProfileSidebarTreeElement.prototype = {
{
var profile = this.profile;
var contextMenu = new WebInspector.ContextMenu();
if (profile.canSaveToFile())
contextMenu.appendItem(WebInspector.UIString("Save profile\u2026"), profile.saveToFile.bind(profile));
// FIXME: use context menu provider
var profilesPanel = WebInspector.ProfilesPanel._instance;
contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), profilesPanel._fileSelectorElement.click.bind(profilesPanel._fileSelectorElement));
contextMenu.appendItem(WebInspector.UIString("Delete profile"), this.ondelete.bind(this));
// FIXME: use context menu provider
if (profile.canSaveToFile()) {
contextMenu.appendItem(WebInspector.UIString("Save Heap Snapshot\u2026"), profile.saveToFile.bind(profile));
contextMenu.appendItem(WebInspector.UIString("Load Heap Snapshot\u2026"), profilesPanel._fileSelectorElement.click.bind(profilesPanel._fileSelectorElement));
contextMenu.appendItem(WebInspector.UIString("Delete Heap Snapshot"), this.ondelete.bind(this));
} else {
contextMenu.appendItem(WebInspector.UIString("Load Heap Snapshot\u2026"), profilesPanel._fileSelectorElement.click.bind(profilesPanel._fileSelectorElement));
contextMenu.appendItem(WebInspector.UIString("Delete profile"), this.ondelete.bind(this));
}
contextMenu.show(event);
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment