Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 {id: "value", title: WebInspector.UIString("Value"), sortable: true, lon gText: true, weight: 34}, | 47 {id: "value", title: WebInspector.UIString("Value"), sortable: true, lon gText: true, weight: 34}, |
| 48 {id: "domain", title: WebInspector.UIString("Domain"), sortable: true, w eight: 7}, | 48 {id: "domain", title: WebInspector.UIString("Domain"), sortable: true, w eight: 7}, |
| 49 {id: "path", title: WebInspector.UIString("Path"), sortable: true, weigh t: 7}, | 49 {id: "path", title: WebInspector.UIString("Path"), sortable: true, weigh t: 7}, |
| 50 {id: "expires", title: WebInspector.UIString("Expires / Max-Age"), sorta ble: true, weight: 7}, | 50 {id: "expires", title: WebInspector.UIString("Expires / Max-Age"), sorta ble: true, weight: 7}, |
| 51 {id: "size", title: WebInspector.UIString("Size"), sortable: true, align : WebInspector.DataGrid.Align.Right, weight: 7}, | 51 {id: "size", title: WebInspector.UIString("Size"), sortable: true, align : WebInspector.DataGrid.Align.Right, weight: 7}, |
| 52 {id: "httpOnly", title: WebInspector.UIString("HTTP"), sortable: true, a lign: WebInspector.DataGrid.Align.Center, weight: 7}, | 52 {id: "httpOnly", title: WebInspector.UIString("HTTP"), sortable: true, a lign: WebInspector.DataGrid.Align.Center, weight: 7}, |
| 53 {id: "secure", title: WebInspector.UIString("Secure"), sortable: true, a lign: WebInspector.DataGrid.Align.Center, weight: 7}, | 53 {id: "secure", title: WebInspector.UIString("Secure"), sortable: true, a lign: WebInspector.DataGrid.Align.Center, weight: 7}, |
| 54 {id: "sameSite", title: WebInspector.UIString("SameSite"), sortable: tru e, align: WebInspector.DataGrid.Align.Center, weight: 7} | 54 {id: "sameSite", title: WebInspector.UIString("SameSite"), sortable: tru e, align: WebInspector.DataGrid.Align.Center, weight: 7} |
| 55 ]); | 55 ]); |
| 56 | 56 |
| 57 if (readOnly) | 57 if (readOnly) |
|
lushnikov
2016/10/26 02:36:34
nit: braces
allada
2016/10/26 02:45:08
Done.
| |
| 58 this._dataGrid = new WebInspector.DataGrid(columns); | 58 this._dataGrid = new WebInspector.DataGrid(columns); |
| 59 else | 59 else { |
| 60 this._dataGrid = new WebInspector.DataGrid(columns, undefined, this._onD eleteCookie.bind(this), refreshCallback, this._onContextMenu.bind(this)); | 60 this._dataGrid = new WebInspector.DataGrid(columns, undefined, this._onD eleteCookie.bind(this), refreshCallback); |
| 61 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.RowContextM enu, this._onRowContextMenu.bind(this)); | |
| 62 } | |
| 61 | 63 |
| 62 this._dataGrid.setName("cookiesTable"); | 64 this._dataGrid.setName("cookiesTable"); |
| 63 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this); | 65 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this); |
| 64 | 66 |
| 65 if (selectedCallback) | 67 if (selectedCallback) |
| 66 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, selectedCallback, this); | 68 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, selectedCallback, this); |
| 67 | 69 |
| 68 this._nextSelectedCookie = /** @type {?WebInspector.Cookie} */ (null); | 70 this._nextSelectedCookie = /** @type {?WebInspector.Cookie} */ (null); |
| 69 | 71 |
| 70 this._dataGrid.asWidget().show(this.element); | 72 this._dataGrid.asWidget().show(this.element); |
| 71 this._data = []; | 73 this._data = []; |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 WebInspector.CookiesTable.prototype = { | 76 WebInspector.CookiesTable.prototype = { |
| 75 /** | 77 /** |
| 76 * @param {?string} domain | 78 * @param {?string} domain |
| 77 */ | 79 */ |
| 78 _clearAndRefresh: function(domain) | 80 _clearAndRefresh: function(domain) |
| 79 { | 81 { |
| 80 this.clear(domain); | 82 this.clear(domain); |
| 81 this._refresh(); | 83 this._refresh(); |
| 82 }, | 84 }, |
| 83 | 85 |
| 84 /** | 86 /** |
| 85 * @param {!WebInspector.ContextMenu} contextMenu | 87 * @param {!WebInspector.Event} event |
| 86 * @param {!WebInspector.DataGridNode} node | |
| 87 */ | 88 */ |
| 88 _onContextMenu: function(contextMenu, node) | 89 _onRowContextMenu: function(event) |
| 89 { | 90 { |
| 91 var contextMenu = /** @type {!WebInspector.ContextMenu} */ (event.data.c ontextMenu); | |
| 92 var node = /** @type {!WebInspector.DataGridNode} */ (event.data.node); | |
| 90 if (node === this._dataGrid.creationNode) | 93 if (node === this._dataGrid.creationNode) |
| 91 return; | 94 return; |
| 92 var cookie = node.cookie; | 95 var domain = node.cookie.domain(); |
| 93 var domain = cookie.domain(); | |
| 94 if (domain) | 96 if (domain) |
| 95 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all from \"%s\"", domain), this._clearAndRefresh.bind(this, domain)); | 97 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all from \"%s\"", domain), this._clearAndRefresh.bind(this, domain)); |
| 96 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all"), t his._clearAndRefresh.bind(this, null)); | 98 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all"), t his._clearAndRefresh.bind(this, null)); |
| 97 }, | 99 }, |
| 98 | 100 |
| 99 /** | 101 /** |
| 100 * @param {!Array.<!WebInspector.Cookie>} cookies | 102 * @param {!Array.<!WebInspector.Cookie>} cookies |
| 101 */ | 103 */ |
| 102 setCookies: function(cookies) | 104 setCookies: function(cookies) |
| 103 { | 105 { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 }, | 282 }, |
| 281 | 283 |
| 282 _refresh: function() | 284 _refresh: function() |
| 283 { | 285 { |
| 284 if (this._refreshCallback) | 286 if (this._refreshCallback) |
| 285 this._refreshCallback(); | 287 this._refreshCallback(); |
| 286 }, | 288 }, |
| 287 | 289 |
| 288 __proto__: WebInspector.VBox.prototype | 290 __proto__: WebInspector.VBox.prototype |
| 289 }; | 291 }; |
| OLD | NEW |