Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: Source/devtools/front_end/DOMStorageItemsView.js

Issue 21163003: DevTools: Implement undo, redo operations for the DOMStorage views. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 { 61 {
62 this._update(); 62 this._update();
63 }, 63 },
64 64
65 willHide: function() 65 willHide: function()
66 { 66 {
67 this.deleteButton.visible = false; 67 this.deleteButton.visible = false;
68 }, 68 },
69 69
70 /** 70 /**
71 * @param {KeyboardEvent} event
72 */
73 handleShortcut: function(event)
74 {
75 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.sh iftKey && event.keyIdentifier === "U+005A") { // Z key
76 this.domStorage.undo();
77 event.handled = true;
78 return;
79 }
80
81 var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftKey & & event.keyIdentifier === "U+005A" : // Z key
82 event.ctrlKey && event.keyIdentif ier === "U+0059"; // Y key
83 if (isRedoKey) {
84 this.domStorage.redo();
85 event.handled = true;
86 return;
87 }
88 },
89
90 /**
71 * @param {WebInspector.Event} event 91 * @param {WebInspector.Event} event
72 */ 92 */
73 _domStorageItemsCleared: function(event) 93 _domStorageItemsCleared: function(event)
74 { 94 {
75 if (!this.isShowing() || !this._dataGrid) 95 if (!this.isShowing() || !this._dataGrid)
76 return; 96 return;
77 97
78 this._dataGrid.rootNode().removeChildren(); 98 this._dataGrid.rootNode().removeChildren();
79 this._dataGrid.addCreationNode(false); 99 this._dataGrid.addCreationNode(false);
80 this.deleteButton.visible = false; 100 this.deleteButton.visible = false;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 { 273 {
254 if (!node || node.isCreationNode) 274 if (!node || node.isCreationNode)
255 return; 275 return;
256 276
257 if (this.domStorage) 277 if (this.domStorage)
258 this.domStorage.removeItem(node.data.key); 278 this.domStorage.removeItem(node.data.key);
259 }, 279 },
260 280
261 __proto__: WebInspector.View.prototype 281 __proto__: WebInspector.View.prototype
262 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698