Title: [135588] trunk/Source/WebCore
Revision
135588
Author
[email protected]
Date
2012-11-23 04:08:42 -0800 (Fri, 23 Nov 2012)

Log Message

Web Inspector: dispatch events upon certain user actions on inspector's notification services
https://bugs.webkit.org/show_bug.cgi?id=103114

Reviewed by Pavel Feldman.

Add a bunch of WebInspector.UserMetrics.UserAction, so platform-specific code can wire to user actions
without breaking too often.

* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.prototype._setPseudoClassForNodeId):
* inspector/front-end/_javascript_SourceFrame.js:
(WebInspector._javascript_SourceFrame.prototype._setBreakpoint):
* inspector/front-end/NetworkItemView.js:
(WebInspector.NetworkItemView.prototype._tabSelected.set WebInspector):
(WebInspector.NetworkItemView.prototype._tabSelected):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._sortItems):
(WebInspector.NetworkDataGridNode.prototype.select):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype.addProfileHeader):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._showSourceLine):
(WebInspector.ScriptsPanel.prototype._toggleFormatSource):
* inspector/front-end/UISourceCode.js:
(WebInspector.UISourceCode.prototype.revertToOriginal):
(WebInspector.UISourceCode.prototype.revertAndClearHistory):
(WebInspector.UISourceCode.prototype.commitWorkingCopy):
* inspector/front-end/UserMetrics.js:
* inspector/front-end/externs.js:
* inspector/front-end/inspector.js:
(WebInspector._requestZoom.set var):
(WebInspector._requestZoom):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135587 => 135588)


--- trunk/Source/WebCore/ChangeLog	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/ChangeLog	2012-11-23 12:08:42 UTC (rev 135588)
@@ -1,3 +1,38 @@
+2012-11-23  Andrey Kosyakov  <[email protected]>
+
+        Web Inspector: dispatch events upon certain user actions on inspector's notification services
+        https://bugs.webkit.org/show_bug.cgi?id=103114
+
+        Reviewed by Pavel Feldman.
+
+        Add a bunch of WebInspector.UserMetrics.UserAction, so platform-specific code can wire to user actions
+        without breaking too often.
+
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.prototype._setPseudoClassForNodeId):
+        * inspector/front-end/_javascript_SourceFrame.js:
+        (WebInspector._javascript_SourceFrame.prototype._setBreakpoint):
+        * inspector/front-end/NetworkItemView.js:
+        (WebInspector.NetworkItemView.prototype._tabSelected.set WebInspector):
+        (WebInspector.NetworkItemView.prototype._tabSelected):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._sortItems):
+        (WebInspector.NetworkDataGridNode.prototype.select):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype.addProfileHeader):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._showSourceLine):
+        (WebInspector.ScriptsPanel.prototype._toggleFormatSource):
+        * inspector/front-end/UISourceCode.js:
+        (WebInspector.UISourceCode.prototype.revertToOriginal):
+        (WebInspector.UISourceCode.prototype.revertAndClearHistory):
+        (WebInspector.UISourceCode.prototype.commitWorkingCopy):
+        * inspector/front-end/UserMetrics.js:
+        * inspector/front-end/externs.js:
+        * inspector/front-end/inspector.js:
+        (WebInspector._requestZoom.set var):
+        (WebInspector._requestZoom):
+
 2012-11-23  Christophe Dumez  <[email protected]>
 
         WebSocket's MessageEvent.origin attribute is an empty string

Modified: trunk/Source/WebCore/inspector/front-end/ElementsPanel.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -198,6 +198,13 @@
         WebInspector.cssModel.forcePseudoState(node.id, node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName));
         this._metricsPaneEdited();
         this._stylesPaneEdited();
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.ForcedElementState,
+            selector: node.appropriateSelectorFor(false),
+            enabled: enable,
+            state: pseudoClass
+        });
     },
 
     _selectedNodeChanged: function()

Modified: trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -614,6 +614,13 @@
     _setBreakpoint: function(lineNumber, condition, enabled)
     {
         this._breakpointManager.setBreakpoint(this._uiSourceCode, lineNumber, condition, enabled);
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.SetBreakpoint,
+            url: this._uiSourceCode.url,
+            line: lineNumber,
+            enabled: enabled
+        });
     },
 
     /**

Modified: trunk/Source/WebCore/inspector/front-end/NetworkItemView.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -90,8 +90,16 @@
 
     _tabSelected: function(event)
     {
-        if (event.data.isUserGesture)
-            WebInspector.settings.resourceViewTab.set(event.data.tabId);
+        if (!event.data.isUserGesture)
+            return;
+
+        WebInspector.settings.resourceViewTab.set(event.data.tabId);
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.NetworkRequestTabSelected,
+            tab: event.data.tabId,
+            url: this._request.url
+        });
     },
 
     /**

Modified: trunk/Source/WebCore/inspector/front-end/NetworkPanel.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -303,6 +303,12 @@
         this._updateOffscreenRows();
 
         this.searchCanceled();
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.NetworkSort,
+            column: columnIdentifier,
+            sortOrder: this._dataGrid.sortOrder
+        });
     },
 
     _sortByTimeline: function()
@@ -1823,6 +1829,11 @@
     {
         this._parentView.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.RequestSelected, this._request);
         WebInspector.DataGridNode.prototype.select.apply(this, arguments);
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.NetworkRequestSelected,
+            url: this._request.url
+        });
     },
 
     _highlightMatchedSubstring: function(regexp)

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


--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -522,7 +522,9 @@
         if (!profile.isTemporary) {
             if (!this.visibleView)
                 this.showProfile(profile);
-            this.dispatchEventToListeners("profile added");
+            this.dispatchEventToListeners("profile added", {
+                type: typeId
+            });
         }
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -407,6 +407,12 @@
         if (typeof lineNumber === "number")
             sourceFrame.highlightLine(lineNumber);
         sourceFrame.focus();
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.OpenSourceLink,
+            url: uiSourceCode.url,
+            lineNumber: lineNumber
+        });
     },
 
     /**
@@ -931,6 +937,12 @@
         var uiSourceCodes = this._workspace.uiSourceCodes();
         for (var i = 0; i < uiSourceCodes.length; ++i)
             uiSourceCodes[i].setFormatted(this._toggleFormatSourceButton.toggled);
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.TogglePrettyPrint,
+            enabled: this._toggleFormatSourceButton.toggled,
+            url: this._editorContainer.currentFile().url
+        });
     },
 
     addToWatch: function(_expression_)

Modified: trunk/Source/WebCore/inspector/front-end/UISourceCode.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -258,6 +258,11 @@
         }
 
         this.requestOriginalContent(callback.bind(this));
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.ApplyOriginalContent,
+            url: this.url
+        });
     },
 
     /**
@@ -283,6 +288,11 @@
         }
 
         this.requestOriginalContent(revert.bind(this));
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.RevertRevision,
+            url: this.url
+        });
     },
 
     /**
@@ -330,6 +340,11 @@
 
         this._commitContent(this._workingCopy);
         callback(null);
+
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, {
+            action: WebInspector.UserMetrics.UserActionNames.FileSaved,
+            url: this.url
+        });
     },
 
     /**

Modified: trunk/Source/WebCore/inspector/front-end/UserMetrics.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/UserMetrics.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/UserMetrics.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -89,6 +89,22 @@
     console: 8
 }
 
+WebInspector.UserMetrics.UserAction = "UserAction";
+
+WebInspector.UserMetrics.UserActionNames = {
+    ForcedElementState: "forcedElementState",
+    FileSaved: "fileSaved",
+    RevertRevision: "revertRevision",
+    ApplyOriginalContent: "applyOriginalContent",
+    TogglePrettyPrint: "togglePrettyPrint",
+    SetBreakpoint: "setBreakpoint",
+    OpenSourceLink: "openSourceLink",
+    NetworkSort: "networkSort",
+    NetworkRequestSelected: "networkRequestSelected",
+    NetworkRequestTabSelected: "networkRequestTabSelected",
+    ChoseHeapSnapshotBetween: "choseHeapSnapshotBetween"
+};
+
 WebInspector.UserMetrics.prototype = {
     panelShown: function(panelName)
     {

Modified: trunk/Source/WebCore/inspector/front-end/externs.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/externs.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/externs.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -236,6 +236,7 @@
 WebInspector.queryParamsObject = {}
 
 WebInspector.Events = {
+    InspectorLoaded: "InspectorLoaded",
     InspectorClosing: "InspectorClosing"
 }
 

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (135587 => 135588)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2012-11-23 11:52:11 UTC (rev 135587)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2012-11-23 12:08:42 UTC (rev 135588)
@@ -290,6 +290,7 @@
 }
 
 WebInspector.Events = {
+    InspectorLoaded: "InspectorLoaded",
     InspectorClosing: "InspectorClosing"
 }
 
@@ -493,6 +494,8 @@
 
     WebInspector.WorkerManager.loadCompleted();
     InspectorFrontendAPI.loadCompleted();
+
+    WebInspector.notifications.dispatchEventToListeners(WebInspector.Events.InspectorLoaded);
 }
 
 var windowLoaded = function()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to