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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 var columns = [ | 45 var columns = [ |
| 46 {id: "name", title: WebInspector.UIString("Name"), sortable: true, discl osure: expandable, sort: WebInspector.DataGrid.Order.Ascending, longText: true, weight: 24}, | 46 {id: "name", title: WebInspector.UIString("Name"), sortable: true, discl osure: expandable, sort: WebInspector.DataGrid.Order.Ascending, longText: true, weight: 24}, |
| 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("Same-Site"), sortable: tr ue, 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, this._onContextMenu.bind(this)); |
| 61 | 61 |
| 62 this._dataGrid.setName("cookiesTable"); | 62 this._dataGrid.setName("cookiesTable"); |
| 63 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this); | 63 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this); |
| 64 | 64 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 data.expires = Number.secondsToString(parseInt(cookie.maxAge(), 10)); | 254 data.expires = Number.secondsToString(parseInt(cookie.maxAge(), 10)); |
| 255 else if (cookie.expires()) | 255 else if (cookie.expires()) |
| 256 data.expires = new Date(cookie.expires()).toISOString(); | 256 data.expires = new Date(cookie.expires()).toISOString(); |
| 257 else | 257 else |
| 258 data.expires = WebInspector.UIString("Session"); | 258 data.expires = WebInspector.UIString("Session"); |
| 259 } | 259 } |
| 260 data.size = cookie.size(); | 260 data.size = cookie.size(); |
| 261 const checkmark = "\u2713"; | 261 const checkmark = "\u2713"; |
| 262 data.httpOnly = (cookie.httpOnly() ? checkmark : ""); | 262 data.httpOnly = (cookie.httpOnly() ? checkmark : ""); |
| 263 data.secure = (cookie.secure() ? checkmark : ""); | 263 data.secure = (cookie.secure() ? checkmark : ""); |
| 264 data.sameSite = (cookie.sameSite() ? checkmark : ""); | 264 data.sameSite = (cookie.sameSite() ? cookie.sameSite() : ""); |
|
dgozman
2016/04/05 17:34:53
cookie.sameSite() || ""
Mike West
2016/04/05 17:55:10
Should I change `secure` and `httpOnly` as well? I
dgozman
2016/04/05 17:58:24
I think secure and httpOnly are booleans, while sa
| |
| 265 | 265 |
| 266 var node = new WebInspector.DataGridNode(data); | 266 var node = new WebInspector.DataGridNode(data); |
| 267 node.cookie = cookie; | 267 node.cookie = cookie; |
| 268 node.selectable = true; | 268 node.selectable = true; |
| 269 return node; | 269 return node; |
| 270 }, | 270 }, |
| 271 | 271 |
| 272 _onDeleteCookie: function(node) | 272 _onDeleteCookie: function(node) |
| 273 { | 273 { |
| 274 var cookie = node.cookie; | 274 var cookie = node.cookie; |
| 275 var neighbour = node.traverseNextNode() || node.traversePreviousNode(); | 275 var neighbour = node.traverseNextNode() || node.traversePreviousNode(); |
| 276 if (neighbour) | 276 if (neighbour) |
| 277 this._nextSelectedCookie = neighbour.cookie; | 277 this._nextSelectedCookie = neighbour.cookie; |
| 278 cookie.remove(); | 278 cookie.remove(); |
| 279 this._refresh(); | 279 this._refresh(); |
| 280 }, | 280 }, |
| 281 | 281 |
| 282 _refresh: function() | 282 _refresh: function() |
| 283 { | 283 { |
| 284 if (this._refreshCallback) | 284 if (this._refreshCallback) |
| 285 this._refreshCallback(); | 285 this._refreshCallback(); |
| 286 }, | 286 }, |
| 287 | 287 |
| 288 __proto__: WebInspector.VBox.prototype | 288 __proto__: WebInspector.VBox.prototype |
| 289 } | 289 } |
| OLD | NEW |