Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 Resources.DOMStorage.Events.DOMStorageItemRemoved, this._domStorageIte mRemoved, this), | 60 Resources.DOMStorage.Events.DOMStorageItemRemoved, this._domStorageIte mRemoved, this), |
| 61 this._domStorage.addEventListener( | 61 this._domStorage.addEventListener( |
| 62 Resources.DOMStorage.Events.DOMStorageItemAdded, this._domStorageItemA dded, this), | 62 Resources.DOMStorage.Events.DOMStorageItemAdded, this._domStorageItemA dded, this), |
| 63 this._domStorage.addEventListener( | 63 this._domStorage.addEventListener( |
| 64 Resources.DOMStorage.Events.DOMStorageItemUpdated, this._domStorageIte mUpdated, this), | 64 Resources.DOMStorage.Events.DOMStorageItemUpdated, this._domStorageIte mUpdated, this), |
| 65 ]; | 65 ]; |
| 66 this.refreshItems(); | 66 this.refreshItems(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * @param {!Common.Event} event | 70 * @param {!Common.Event=} event |
|
eostroukhov
2017/02/24 18:13:46
I think you can remove the event from the paramete
phulce
2017/02/28 18:55:53
Do you think it's better to have no documentation
eostroukhov
2017/02/28 20:22:51
This function is not meant to be called with an ar
phulce
2017/02/28 21:23:58
Except it will be when invoked through event liste
eostroukhov
2017/02/28 21:29:05
I don't think it matters from the API point of vie
| |
| 71 */ | 71 */ |
| 72 _domStorageItemsCleared(event) { | 72 _domStorageItemsCleared(event) { |
| 73 if (!this.isShowing() || !this._dataGrid) | 73 if (!this.isShowing() || !this._dataGrid) |
| 74 return; | 74 return; |
| 75 | 75 |
| 76 this._dataGrid.rootNode().removeChildren(); | 76 this._dataGrid.rootNode().removeChildren(); |
| 77 this._dataGrid.addCreationNode(false); | 77 this._dataGrid.addCreationNode(false); |
| 78 this.setCanDeleteSelected(false); | 78 this.setCanDeleteSelected(false); |
| 79 } | 79 } |
| 80 | 80 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 */ | 200 */ |
| 201 refreshItems() { | 201 refreshItems() { |
| 202 this._domStorage.getItems((error, items) => this._showDOMStorageItems(error, items)); | 202 this._domStorage.getItems((error, items) => this._showDOMStorageItems(error, items)); |
| 203 } | 203 } |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * @override | 206 * @override |
| 207 */ | 207 */ |
| 208 deleteAllItems() { | 208 deleteAllItems() { |
| 209 this._domStorage.clear(); | 209 this._domStorage.clear(); |
| 210 this._domStorageItemsCleared(); | |
|
eostroukhov
2017/02/24 18:13:47
This should be called in response to event after t
phulce
2017/02/28 18:55:53
AFAICT the target simply doesn't call the methods
| |
| 210 } | 211 } |
| 211 | 212 |
| 212 _editingCallback(editingNode, columnIdentifier, oldText, newText) { | 213 _editingCallback(editingNode, columnIdentifier, oldText, newText) { |
| 213 var domStorage = this._domStorage; | 214 var domStorage = this._domStorage; |
| 214 if (columnIdentifier === 'key') { | 215 if (columnIdentifier === 'key') { |
| 215 if (typeof oldText === 'string') | 216 if (typeof oldText === 'string') |
| 216 domStorage.removeItem(oldText); | 217 domStorage.removeItem(oldText); |
| 217 domStorage.setItem(newText, editingNode.data.value || ''); | 218 domStorage.setItem(newText, editingNode.data.value || ''); |
| 218 this._removeDupes(editingNode); | 219 this._removeDupes(editingNode); |
| 219 } else { | 220 } else { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 235 } | 236 } |
| 236 | 237 |
| 237 _deleteCallback(node) { | 238 _deleteCallback(node) { |
| 238 if (!node || node.isCreationNode) | 239 if (!node || node.isCreationNode) |
| 239 return; | 240 return; |
| 240 | 241 |
| 241 if (this._domStorage) | 242 if (this._domStorage) |
| 242 this._domStorage.removeItem(node.data.key); | 243 this._domStorage.removeItem(node.data.key); |
| 243 } | 244 } |
| 244 }; | 245 }; |
| OLD | NEW |