| 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) { |
| 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.setRowContextMenuCallback(this._onRowContextMenu.bind(thi
s)); |
| 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.ContextMenu} contextMenu |
| 86 * @param {!WebInspector.DataGridNode} node | 88 * @param {!WebInspector.DataGridNode} node |
| 87 */ | 89 */ |
| 88 _onContextMenu: function(contextMenu, node) | 90 _onRowContextMenu: function(contextMenu, node) |
| 89 { | 91 { |
| 90 if (node === this._dataGrid.creationNode) | 92 if (node === this._dataGrid.creationNode) |
| 91 return; | 93 return; |
| 92 var cookie = node.cookie; | 94 var domain = node.cookie.domain(); |
| 93 var domain = cookie.domain(); | |
| 94 if (domain) | 95 if (domain) |
| 95 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all
from \"%s\"", domain), this._clearAndRefresh.bind(this, domain)); | 96 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)); | 97 contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all"), t
his._clearAndRefresh.bind(this, null)); |
| 97 }, | 98 }, |
| 98 | 99 |
| 99 /** | 100 /** |
| 100 * @param {!Array.<!WebInspector.Cookie>} cookies | 101 * @param {!Array.<!WebInspector.Cookie>} cookies |
| 101 */ | 102 */ |
| 102 setCookies: function(cookies) | 103 setCookies: function(cookies) |
| 103 { | 104 { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 }, | 281 }, |
| 281 | 282 |
| 282 _refresh: function() | 283 _refresh: function() |
| 283 { | 284 { |
| 284 if (this._refreshCallback) | 285 if (this._refreshCallback) |
| 285 this._refreshCallback(); | 286 this._refreshCallback(); |
| 286 }, | 287 }, |
| 287 | 288 |
| 288 __proto__: WebInspector.VBox.prototype | 289 __proto__: WebInspector.VBox.prototype |
| 289 }; | 290 }; |
| OLD | NEW |