| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 this._cookiesTable = | 106 this._cookiesTable = |
| 107 new Components.CookiesTable(false, this._update.bind(this), this._show
DeleteButton.bind(this)); | 107 new CookieTable.CookiesTable(false, this._update.bind(this), this._sho
wDeleteButton.bind(this)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 this._cookiesTable.setCookies(this._cookies); | 110 this._cookiesTable.setCookies(this._cookies); |
| 111 this._emptyWidget.detach(); | 111 this._emptyWidget.detach(); |
| 112 this._cookiesTable.show(this.element); | 112 this._cookiesTable.show(this.element); |
| 113 this._treeElement.subtitle = | 113 this._treeElement.subtitle = |
| 114 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length,
Number.bytesToString(this._totalSize)); | 114 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length,
Number.bytesToString(this._totalSize)); |
| 115 this._clearButton.setVisible(true); | 115 this._clearButton.setVisible(true); |
| 116 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); | 116 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); |
| 117 } | 117 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 _contextMenu(event) { | 188 _contextMenu(event) { |
| 189 if (!this._cookies.length) { | 189 if (!this._cookies.length) { |
| 190 var contextMenu = new UI.ContextMenu(event); | 190 var contextMenu = new UI.ContextMenu(event); |
| 191 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this)
); | 191 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this)
); |
| 192 contextMenu.show(); | 192 contextMenu.show(); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 }; | 195 }; |
| OLD | NEW |