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

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

Issue 25029002: [DevTools] Enable deleting of a snippet by pressing delete key (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comment incorporated Created 7 years, 2 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
« no previous file with comments | « no previous file | Source/devtools/front_end/SourcesNavigator.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
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 * 10 *
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 _sourceSelected: function(uiSourceCode, focusSource) 177 _sourceSelected: function(uiSourceCode, focusSource)
178 { 178 {
179 this._lastSelectedUISourceCode = uiSourceCode; 179 this._lastSelectedUISourceCode = uiSourceCode;
180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource}; 180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource};
181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele cted, data); 181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele cted, data);
182 }, 182 },
183 183
184 /** 184 /**
185 * @param {WebInspector.UISourceCode} uiSourceCode 185 * @param {WebInspector.UISourceCode} uiSourceCode
186 */ 186 */
187 sourceDeleted: function(uiSourceCode)
188 {
189 },
190
191 /**
192 * @param {WebInspector.UISourceCode} uiSourceCode
193 */
187 removeUISourceCode: function(uiSourceCode) 194 removeUISourceCode: function(uiSourceCode)
188 { 195 {
189 var node = this._uiSourceCodeNodes.get(uiSourceCode); 196 var node = this._uiSourceCodeNodes.get(uiSourceCode);
190 if (!node) 197 if (!node)
191 return; 198 return;
192 199
193 var projectNode = this._projectNode(uiSourceCode.project()); 200 var projectNode = this._projectNode(uiSourceCode.project());
194 var subfolderNodes = this._subfolderNodes.get(projectNode); 201 var subfolderNodes = this._subfolderNodes.get(projectNode);
195 var parentNode = node.parent; 202 var parentNode = node.parent;
196 this._uiSourceCodeNodes.remove(uiSourceCode); 203 this._uiSourceCodeNodes.remove(uiSourceCode);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 var middleClick = event.button === 1; 676 var middleClick = event.button === 1;
670 this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick); 677 this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick);
671 }, 678 },
672 679
673 onenter: function() 680 onenter: function()
674 { 681 {
675 this._navigatorView._sourceSelected(this.uiSourceCode, true); 682 this._navigatorView._sourceSelected(this.uiSourceCode, true);
676 return true; 683 return true;
677 }, 684 },
678 685
686 ondelete: function()
687 {
688 this._navigatorView.sourceDeleted(this.uiSourceCode);
689 return true;
690 },
691
679 /** 692 /**
680 * @param {Event} event 693 * @param {Event} event
681 */ 694 */
682 _handleContextMenuEvent: function(event) 695 _handleContextMenuEvent: function(event)
683 { 696 {
684 this.select(); 697 this.select();
685 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); 698 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode);
686 }, 699 },
687 700
688 __proto__: WebInspector.BaseNavigatorTreeElement.prototype 701 __proto__: WebInspector.BaseNavigatorTreeElement.prototype
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1163
1151 willRemoveChild: function(node) 1164 willRemoveChild: function(node)
1152 { 1165 {
1153 if (node._isMerged || !this.isPopulated()) 1166 if (node._isMerged || !this.isPopulated())
1154 return; 1167 return;
1155 this._treeElement.removeChild(node._treeElement); 1168 this._treeElement.removeChild(node._treeElement);
1156 }, 1169 },
1157 1170
1158 __proto__: WebInspector.NavigatorTreeNode.prototype 1171 __proto__: WebInspector.NavigatorTreeNode.prototype
1159 } 1172 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/SourcesNavigator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698