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

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

Issue 218613013: DevTools: Decouple shortcuts from actions, introduce shortcut contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments - take 1 Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 * @param {boolean} available 189 * @param {boolean} available
190 */ 190 */
191 setDrawerEditorAvailable: function(available) 191 setDrawerEditorAvailable: function(available)
192 { 192 {
193 this._drawer.setDrawerEditorAvailable(available); 193 this._drawer.setDrawerEditorAvailable(available);
194 }, 194 },
195 195
196 _tabSelected: function() 196 _tabSelected: function()
197 { 197 {
198 var panelName = this._tabbedPane.selectedTabId; 198 var panelName = this._tabbedPane.selectedTabId;
199 if (!panelName)
200 return;
199 var panel = this._panelDescriptors[this._tabbedPane.selectedTabId].panel (); 201 var panel = this._panelDescriptors[this._tabbedPane.selectedTabId].panel ();
200 this._tabbedPane.changeTabView(panelName, panel); 202 this._tabbedPane.changeTabView(panelName, panel);
203 WebInspector.context.setFlavor(WebInspector.Panel, panel);
pfeldman 2014/04/17 10:40:25 Why would we put panel into the context - there al
apavlov 2014/04/17 12:42:22 Done.
201 204
202 this._currentPanel = panel; 205 this._currentPanel = panel;
203 this._lastActivePanelSetting.set(panel.name); 206 this._lastActivePanelSetting.set(panel.name);
204 this._pushToHistory(panel.name); 207 this._pushToHistory(panel.name);
205 WebInspector.userMetrics.panelShown(panel.name); 208 WebInspector.userMetrics.panelShown(panel.name);
206 panel.focus(); 209 panel.focus();
207 }, 210 },
208 211
209 /** 212 /**
210 * @param {!WebInspector.Panel} x 213 * @param {!WebInspector.Panel} x
211 */ 214 */
212 setCurrentPanel: function(x) 215 setCurrentPanel: function(x)
213 { 216 {
214 if (this._currentPanel === x) 217 if (this._currentPanel === x)
215 return; 218 return;
216 219
217 this._tabbedPane.changeTabView(x.name, x); 220 this._tabbedPane.changeTabView(x.name, x);
218 this._tabbedPane.selectTab(x.name); 221 this._tabbedPane.selectTab(x.name);
222 WebInspector.context.setFlavor(WebInspector.Panel, x);
219 }, 223 },
220 224
221 /** 225 /**
222 * @param {string} id 226 * @param {string} id
223 */ 227 */
224 closeViewInDrawer: function(id) 228 closeViewInDrawer: function(id)
225 { 229 {
226 this._drawer.closeView(id); 230 this._drawer.closeView(id);
227 }, 231 },
228 232
(...skipping 23 matching lines...) Expand all
252 /** 256 /**
253 * @param {string} id 257 * @param {string} id
254 * @param {boolean=} immediate 258 * @param {boolean=} immediate
255 */ 259 */
256 showViewInDrawer: function(id, immediate) 260 showViewInDrawer: function(id, immediate)
257 { 261 {
258 this._drawer.showView(id, immediate); 262 this._drawer.showView(id, immediate);
259 }, 263 },
260 264
261 /** 265 /**
262 * @return {string} 266 * @return {?string}
263 */ 267 */
264 selectedViewInDrawer: function() 268 selectedViewInDrawer: function()
265 { 269 {
266 return this._drawer.selectedViewId(); 270 return this._drawer.selectedViewId();
267 }, 271 },
268 272
269 closeDrawer: function() 273 closeDrawer: function()
270 { 274 {
271 this._drawer.closeDrawer(); 275 this._drawer.closeDrawer();
272 }, 276 },
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 window.addEventListener("scroll", this._onScrollBound, false); 510 window.addEventListener("scroll", this._onScrollBound, false);
507 else 511 else
508 window.removeEventListener("scroll", this._onScrollBound, false); 512 window.removeEventListener("scroll", this._onScrollBound, false);
509 513
510 WebInspector.VBox.prototype.doResize.call(this); 514 WebInspector.VBox.prototype.doResize.call(this);
511 this._onScroll(); 515 this._onScroll();
512 }, 516 },
513 517
514 __proto__: WebInspector.VBox.prototype 518 __proto__: WebInspector.VBox.prototype
515 }; 519 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698