Changeset 116855 in webkit


Ignore:
Timestamp:
May 12, 2012 6:54:27 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: move recording button state control out of addProfileHeader.
https://bugs.webkit.org/show_bug.cgi?id=86293

Reviewed by Yury Semikhatsky.

  • inspector/front-end/CSSSelectorProfileView.js:

(WebInspector.CSSSelectorProfileType.prototype.buttonClicked):

  • inspector/front-end/HeapSnapshotView.js:

(WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):

  • inspector/front-end/ProfileView.js:

(WebInspector.CPUProfileType.prototype.buttonClicked):

  • inspector/front-end/ProfilesPanel.js:

(WebInspector.ProfileType.prototype.buttonClicked):
(WebInspector.ProfilesPanel.prototype.toggleRecordButton):
(WebInspector.ProfilesPanel.prototype.addProfileHeader):
(WebInspector.ProfilesPanel.prototype.setRecordingProfile):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot.done):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116854 r116855  
     12012-05-12  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: move recording button state control out of addProfileHeader.
     4        https://bugs.webkit.org/show_bug.cgi?id=86293
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/front-end/CSSSelectorProfileView.js:
     9        (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
     10        * inspector/front-end/HeapSnapshotView.js:
     11        (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
     12        * inspector/front-end/ProfileView.js:
     13        (WebInspector.CPUProfileType.prototype.buttonClicked):
     14        * inspector/front-end/ProfilesPanel.js:
     15        (WebInspector.ProfileType.prototype.buttonClicked):
     16        (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
     17        (WebInspector.ProfilesPanel.prototype.addProfileHeader):
     18        (WebInspector.ProfilesPanel.prototype.setRecordingProfile):
     19        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot.done):
     20        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
     21
    1222012-05-12  Eugene Klyuchnikov  <eustas.bug@gmail.com>
    223
  • trunk/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js

    r116764 r116855  
    284284    },
    285285
     286    /**
     287     * @override
     288     * @return {boolean}
     289     */
    286290    buttonClicked: function()
    287291    {
    288         if (this._recording)
     292        if (this._recording) {
    289293            this.stopRecordingProfile();
    290         else
     294            return false;
     295        } else {
    291296            this.startRecordingProfile();
     297            return true;
     298        }
    292299    },
    293300
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js

    r116764 r116855  
    728728    },
    729729
     730    /**
     731     * @override
     732     * @return {boolean}
     733     */
    730734    buttonClicked: function()
    731735    {
    732736        WebInspector.panels.profiles.takeHeapSnapshot();
     737        return false;
    733738    },
    734739
  • trunk/Source/WebCore/inspector/front-end/ProfileView.js

    r116764 r116855  
    565565    },
    566566
     567    /**
     568     * @override
     569     * @return {boolean}
     570     */
    567571    buttonClicked: function()
    568572    {
     
    570574            this.stopRecordingProfile();
    571575            WebInspector.networkManager.enableResourceTracking();
     576            return false;
    572577        } else {
    573578            WebInspector.networkManager.disableResourceTracking();
    574579            this.startRecordingProfile();
     580            return true;
    575581        }
    576582    },
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r116850 r116855  
    5858    },
    5959
     60    /**
     61     * @return {boolean}
     62     */
    6063    buttonClicked: function()
    6164    {
     65        return false;
    6266    },
    6367
     
    281285    toggleRecordButton: function()
    282286    {
    283         this._selectedProfileType.buttonClicked();
     287        var isProfiling = this._selectedProfileType.buttonClicked();
     288        this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
    284289    },
    285290
     
    492497                this.showProfile(profile);
    493498            this.dispatchEventToListeners("profile added");
    494             this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
    495             this.recordButton.toggled = false;
    496         } else {
    497             this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileStarted);
    498             this.recordButton.toggled = true;
    499         }
    500 
    501         this.recordButton.title = this._selectedProfileType.buttonTooltip;
     499        }
    502500    },
    503501
     
    10061004        else
    10071005            this._removeTemporaryProfile(profileType);
     1006        this.recordButton.toggled = isProfiling;
     1007        this.recordButton.title = profileTypeObject.buttonTooltip;
     1008        this.dispatchEventToListeners(isProfiling ? WebInspector.ProfilesPanel.EventTypes.ProfileStarted : WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
    10081009    },
    10091010
     
    10151016            this.addProfileHeader(profileTypeObject.createTemporaryProfile());
    10161017        }
    1017         ProfilerAgent.takeHeapSnapshot();
     1018        this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileStarted);
     1019        function done() {
     1020            this.dispatchEventToListeners(WebInspector.ProfilesPanel.EventTypes.ProfileFinished);
     1021        }
     1022        ProfilerAgent.takeHeapSnapshot(done.bind(this));
    10181023        WebInspector.userMetrics.ProfilesHeapProfileTaken.record();
    10191024    },
Note: See TracChangeset for help on using the changeset viewer.