Title: [116850] trunk/Source/WebCore
Revision
116850
Author
[email protected]
Date
2012-05-12 05:02:08 -0700 (Sat, 12 May 2012)

Log Message

Web Inspector: Load context menu item has to be shown for all Profiles panel.
https://bugs.webkit.org/show_bug.cgi?id=86290

Reviewed by Pavel Feldman.

* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._handleContextMenuEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116849 => 116850)


--- trunk/Source/WebCore/ChangeLog	2012-05-12 11:56:26 UTC (rev 116849)
+++ trunk/Source/WebCore/ChangeLog	2012-05-12 12:02:08 UTC (rev 116850)
@@ -1,3 +1,13 @@
+2012-05-12  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: Load context menu item has to be shown for all Profiles panel.
+        https://bugs.webkit.org/show_bug.cgi?id=86290
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype._handleContextMenuEvent):
+
 2012-05-12  Pavel Feldman  <[email protected]>
 
         Web Inspector: shrink SourceFrame editing API to two methods (was 4).

Modified: trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js (116849 => 116850)


--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2012-05-12 11:56:26 UTC (rev 116849)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2012-05-12 12:02:08 UTC (rev 116850)
@@ -223,6 +223,8 @@
         ProfilerAgent.enable(this._profilerWasEnabled.bind(this));
 
     this._createFileSelectorElement();
+    this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
+
 }
 
 WebInspector.ProfilesPanel.EventTypes = {
@@ -390,12 +392,17 @@
     _handleContextMenuEvent: function(event)
     {
         var element = event.srcElement;
-        while (element && !element.treeElement)
+        while (element && !element.treeElement && element !== this.element)
             element = element.parentElement;
         if (!element)
             return;
-        if (element.treeElement.handleContextMenuEvent)
+        if (element.treeElement && element.treeElement.handleContextMenuEvent) {
             element.treeElement.handleContextMenuEvent(event);
+            return;
+        }
+        var contextMenu = new WebInspector.ContextMenu();
+        contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
+        contextMenu.show(event);
     },
 
     /**
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to