Changeset 83713 in webkit


Ignore:
Timestamp:
Apr 13, 2011 2:32:15 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-04-06 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: add "De-obfuscate Source" item to source frame text area context menu.
https://bugs.webkit.org/show_bug.cgi?id=57942

  • English.lproj/localizedStrings.js:
  • inspector/front-end/DebuggerPresentationModel.js: (WebInspector.DebuggerPresentationModel.prototype.formatSourceFilesToggled):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel): (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions): (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.releaseEvaluationResult): (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.toggleFormatSourceFiles): (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.formatSourceFilesToggled):
  • inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype._contextMenu): (WebInspector.SourceFrame.prototype._populateLineGutterContextMenu): (WebInspector.SourceFrame.prototype._populateTextAreaContextMenu): (WebInspector.SourceFrameDelegate.prototype.releaseEvaluationResult): (WebInspector.SourceFrameDelegate.prototype.toggleFormatSourceFiles): (WebInspector.SourceFrameDelegate.prototype.formatSourceFilesToggled):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83710 r83713  
     12011-04-06  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: add "De-obfuscate Source" item to source frame text area context menu.
     6        https://bugs.webkit.org/show_bug.cgi?id=57942
     7
     8        * English.lproj/localizedStrings.js:
     9        * inspector/front-end/DebuggerPresentationModel.js:
     10        (WebInspector.DebuggerPresentationModel.prototype.formatSourceFilesToggled):
     11        * inspector/front-end/ScriptsPanel.js:
     12        (WebInspector.ScriptsPanel):
     13        (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
     14        (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.releaseEvaluationResult):
     15        (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.toggleFormatSourceFiles):
     16        (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.formatSourceFilesToggled):
     17        * inspector/front-end/SourceFrame.js:
     18        (WebInspector.SourceFrame.prototype._contextMenu):
     19        (WebInspector.SourceFrame.prototype._populateLineGutterContextMenu):
     20        (WebInspector.SourceFrame.prototype._populateTextAreaContextMenu):
     21        (WebInspector.SourceFrameDelegate.prototype.releaseEvaluationResult):
     22        (WebInspector.SourceFrameDelegate.prototype.toggleFormatSourceFiles):
     23        (WebInspector.SourceFrameDelegate.prototype.formatSourceFilesToggled):
     24
    1252011-04-13  Nikolas Zimmermann  <nzimmermann@rim.com>
    226
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r83294 r83713  
    227227    },
    228228
     229    formatSourceFilesToggled: function()
     230    {
     231        return this._formatSourceFiles;
     232    },
     233
    229234    _formatter: function()
    230235    {
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r83601 r83713  
    6666    // this.topStatusBar.appendChild(this.functionsSelectElement);
    6767
    68     this.formatButton = document.createElement("button");
    69     this.formatButton.className = "status-bar-item";
    70     this.formatButton.id = "format-script";
    71     this.formatButton.title = WebInspector.UIString("Format script.");
    72     this.formatButton.appendChild(document.createElement("img"));
    73     this.formatButton.addEventListener("click", this._toggleFormatSourceFiles.bind(this), false);
    74     if (Preferences.debugMode)
    75         this.topStatusBar.appendChild(this.formatButton);
    76 
    7768    this.sidebarButtonsElement = document.createElement("div");
    7869    this.sidebarButtonsElement.id = "scripts-sidebar-buttons";
     
    782773    },
    783774
    784     _toggleFormatSourceFiles: function()
    785     {
    786         this.reset();
    787         this._presentationModel.toggleFormatSourceFiles();
    788     },
    789 
    790775    _enableDebugging: function()
    791776    {
     
    814799        var nextStateMap = {};
    815800        var stateEnum = WebInspector.ScriptsPanel.PauseOnExceptionsState;
    816         nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions; 
    817         nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions; 
     801        nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions;
     802        nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions;
    818803        nextStateMap[stateEnum.PauseOnUncaughtExceptions] = stateEnum.DontPauseOnExceptions;
    819804        this._setPauseOnExceptions(nextStateMap[this._pauseOnExceptionButton.state]);
     
    10881073    {
    10891074        RuntimeAgent.releaseObjectGroup(this._popoverObjectGroup);
     1075    },
     1076
     1077    toggleFormatSourceFiles: function()
     1078    {
     1079        WebInspector.panels.scripts.reset();
     1080        this._model.toggleFormatSourceFiles();
     1081    },
     1082
     1083    formatSourceFilesToggled: function()
     1084    {
     1085        return this._model.formatSourceFilesToggled();
    10901086    }
    10911087}
  • trunk/Source/WebCore/inspector/front-end/SourceFrame.js

    r83586 r83713  
    600600    _contextMenu: function(event)
    601601    {
     602        var contextMenu = new WebInspector.ContextMenu();
    602603        var target = event.target.enclosingNodeOrSelfWithClass("webkit-line-number");
    603         if (!target)
    604             return;
    605         var lineNumber = target.lineNumber;
    606 
    607         var contextMenu = new WebInspector.ContextMenu();
    608 
     604        if (target)
     605            this._populateLineGutterContextMenu(target.lineNumber, contextMenu);
     606        else
     607            this._populateTextAreaContextMenu(contextMenu);
     608        contextMenu.show(event);
     609    },
     610
     611    _populateLineGutterContextMenu: function(lineNumber, contextMenu)
     612    {
    609613        contextMenu.appendItem(WebInspector.UIString("Continue to Here"), this._delegate.continueToLine.bind(this._delegate, lineNumber));
    610614
     
    648652                contextMenu.appendItem(WebInspector.UIString("Enable Breakpoint"), setBreakpointEnabled.bind(this, true));
    649653        }
    650         contextMenu.show(event);
     654    },
     655
     656    _populateTextAreaContextMenu: function(contextMenu)
     657    {
     658        contextMenu.appendCheckboxItem(WebInspector.UIString("De-obfuscate Source"), this._delegate.toggleFormatSourceFiles.bind(this._delegate), this._delegate.formatSourceFilesToggled());
    651659    },
    652660
     
    9991007    {
    10001008        // Should be implemented by subclasses.
     1009    },
     1010
     1011    toggleFormatSourceFiles: function()
     1012    {
     1013        // Should be implemented by subclasses.
     1014    },
     1015
     1016    formatSourceFilesToggled: function()
     1017    {
     1018        // Should be implemented by subclasses.
    10011019    }
    10021020}
Note: See TracChangeset for help on using the changeset viewer.