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 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 // Nothing to show. | 96 // Nothing to show. |
| 97 this._emptyWidget.show(this.element); | 97 this._emptyWidget.show(this.element); |
| 98 this._clearButton.setVisible(false); | 98 this._clearButton.setVisible(false); |
| 99 this._deleteButton.setVisible(false); | 99 this._deleteButton.setVisible(false); |
| 100 if (this._cookiesTable) | 100 if (this._cookiesTable) |
| 101 this._cookiesTable.detach(); | 101 this._cookiesTable.detach(); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 | 104 |
| 105 if (!this._cookiesTable) { | 105 if (!this._cookiesTable) { |
| 106 const parsedURL = this._cookieDomain.asParsedURL(); | |
|
dgozman
2016/12/14 17:20:21
Note that asParsedURL can return null.
| |
| 106 this._cookiesTable = | 107 this._cookiesTable = |
| 107 new Components.CookiesTable(false, this._update.bind(this), this._show DeleteButton.bind(this)); | 108 new Components.CookiesTable(false, this._update.bind(this), this._show DeleteButton.bind(this), parsedURL.domain()); |
| 108 } | 109 } |
| 109 | 110 |
| 110 this._cookiesTable.setCookies(this._cookies); | 111 this._cookiesTable.setCookies(this._cookies); |
| 111 this._emptyWidget.detach(); | 112 this._emptyWidget.detach(); |
| 112 this._cookiesTable.show(this.element); | 113 this._cookiesTable.show(this.element); |
| 113 this._treeElement.subtitle = | 114 this._treeElement.subtitle = |
| 114 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize)); | 115 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize)); |
| 115 this._clearButton.setVisible(true); | 116 this._clearButton.setVisible(true); |
| 116 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); | 117 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); |
| 117 } | 118 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 } | 178 } |
| 178 | 179 |
| 179 _contextMenu(event) { | 180 _contextMenu(event) { |
| 180 if (!this._cookies.length) { | 181 if (!this._cookies.length) { |
| 181 var contextMenu = new UI.ContextMenu(event); | 182 var contextMenu = new UI.ContextMenu(event); |
| 182 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this) ); | 183 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this) ); |
| 183 contextMenu.show(); | 184 contextMenu.show(); |
| 184 } | 185 } |
| 185 } | 186 } |
| 186 }; | 187 }; |
| OLD | NEW |