| Index: third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js
|
| index b198da99685fcd733b0599ef56ecca901fa90529..2d85dfe8c7862963b2bdac13dfbd032ebf0e2c0c 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js
|
| @@ -27,69 +27,72 @@
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
| -
|
| /**
|
| - * @constructor
|
| - * @extends {WebInspector.VBox}
|
| - * @param {!WebInspector.NetworkRequest} request
|
| + * @unrestricted
|
| */
|
| -WebInspector.RequestCookiesView = function(request)
|
| -{
|
| - WebInspector.VBox.call(this);
|
| - this.registerRequiredCSS("network/requestCookiesView.css");
|
| - this.element.classList.add("request-cookies-view");
|
| +WebInspector.RequestCookiesView = class extends WebInspector.VBox {
|
| + /**
|
| + * @param {!WebInspector.NetworkRequest} request
|
| + */
|
| + constructor(request) {
|
| + super();
|
| + this.registerRequiredCSS('network/requestCookiesView.css');
|
| + this.element.classList.add('request-cookies-view');
|
|
|
| this._request = request;
|
| -};
|
| -
|
| -WebInspector.RequestCookiesView.prototype = {
|
| - wasShown: function()
|
| - {
|
| - this._request.addEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this);
|
| - this._request.addEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
|
| + }
|
|
|
| - if (!this._gotCookies) {
|
| - if (!this._emptyWidget) {
|
| - this._emptyWidget = new WebInspector.EmptyWidget(WebInspector.UIString("This request has no cookies."));
|
| - this._emptyWidget.show(this.element);
|
| - }
|
| - return;
|
| - }
|
| + /**
|
| + * @override
|
| + */
|
| + wasShown() {
|
| + this._request.addEventListener(
|
| + WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this);
|
| + this._request.addEventListener(
|
| + WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
|
|
|
| - if (!this._cookiesTable)
|
| - this._buildCookiesTable();
|
| - },
|
| + if (!this._gotCookies) {
|
| + if (!this._emptyWidget) {
|
| + this._emptyWidget = new WebInspector.EmptyWidget(WebInspector.UIString('This request has no cookies.'));
|
| + this._emptyWidget.show(this.element);
|
| + }
|
| + return;
|
| + }
|
|
|
| - willHide: function()
|
| - {
|
| - this._request.removeEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this);
|
| - this._request.removeEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
|
| - },
|
| + if (!this._cookiesTable)
|
| + this._buildCookiesTable();
|
| + }
|
|
|
| - get _gotCookies()
|
| - {
|
| - return (this._request.requestCookies && this._request.requestCookies.length) || (this._request.responseCookies && this._request.responseCookies.length);
|
| - },
|
| + /**
|
| + * @override
|
| + */
|
| + willHide() {
|
| + this._request.removeEventListener(
|
| + WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this);
|
| + this._request.removeEventListener(
|
| + WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
|
| + }
|
|
|
| - _buildCookiesTable: function()
|
| - {
|
| - this.detachChildWidgets();
|
| + get _gotCookies() {
|
| + return (this._request.requestCookies && this._request.requestCookies.length) ||
|
| + (this._request.responseCookies && this._request.responseCookies.length);
|
| + }
|
|
|
| - this._cookiesTable = new WebInspector.CookiesTable(true);
|
| - this._cookiesTable.setCookieFolders([
|
| - {folderName: WebInspector.UIString("Request Cookies"), cookies: this._request.requestCookies},
|
| - {folderName: WebInspector.UIString("Response Cookies"), cookies: this._request.responseCookies}
|
| - ]);
|
| - this._cookiesTable.show(this.element);
|
| - },
|
| + _buildCookiesTable() {
|
| + this.detachChildWidgets();
|
|
|
| - _refreshCookies: function()
|
| - {
|
| - delete this._cookiesTable;
|
| - if (!this._gotCookies || !this.isShowing())
|
| - return;
|
| - this._buildCookiesTable();
|
| - },
|
| + this._cookiesTable = new WebInspector.CookiesTable(true);
|
| + this._cookiesTable.setCookieFolders([
|
| + {folderName: WebInspector.UIString('Request Cookies'), cookies: this._request.requestCookies},
|
| + {folderName: WebInspector.UIString('Response Cookies'), cookies: this._request.responseCookies}
|
| + ]);
|
| + this._cookiesTable.show(this.element);
|
| + }
|
|
|
| - __proto__: WebInspector.VBox.prototype
|
| + _refreshCookies() {
|
| + delete this._cookiesTable;
|
| + if (!this._gotCookies || !this.isShowing())
|
| + return;
|
| + this._buildCookiesTable();
|
| + }
|
| };
|
|
|