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

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

Issue 218613013: DevTools: Decouple shortcuts from actions, introduce shortcut contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix context-related sort order 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 this._dropDownButton = this._createDropDownButton(); 47 this._dropDownButton = this._createDropDownButton();
48 } 48 }
49 49
50 WebInspector.TabbedPane.EventTypes = { 50 WebInspector.TabbedPane.EventTypes = {
51 TabSelected: "TabSelected", 51 TabSelected: "TabSelected",
52 TabClosed: "TabClosed" 52 TabClosed: "TabClosed"
53 } 53 }
54 54
55 WebInspector.TabbedPane.prototype = { 55 WebInspector.TabbedPane.prototype = {
56 /** 56 /**
57 * @return {!WebInspector.View} 57 * @return {?WebInspector.View}
58 */ 58 */
59 get visibleView() 59 get visibleView()
60 { 60 {
61 return this._currentTab ? this._currentTab.view : null; 61 return this._currentTab ? this._currentTab.view : null;
62 }, 62 },
63 63
64 /** 64 /**
65 * @return {string} 65 * @return {?string}
66 */ 66 */
67 get selectedTabId() 67 get selectedTabId()
68 { 68 {
69 return this._currentTab ? this._currentTab.id : null; 69 return this._currentTab ? this._currentTab.id : null;
70 }, 70 },
71 71
72 /** 72 /**
73 * @type {boolean} shrinkableTabs 73 * @type {boolean} shrinkableTabs
74 */ 74 */
75 set shrinkableTabs(shrinkableTabs) 75 set shrinkableTabs(shrinkableTabs)
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 if (setting.get()) 1111 if (setting.get())
1112 this._tabbedPane.appendTab(id, title, new WebInspector.View()); 1112 this._tabbedPane.appendTab(id, title, new WebInspector.View());
1113 }, 1113 },
1114 1114
1115 /** 1115 /**
1116 * @param {!WebInspector.Event} event 1116 * @param {!WebInspector.Event} event
1117 */ 1117 */
1118 _tabSelected: function(event) 1118 _tabSelected: function(event)
1119 { 1119 {
1120 var tabId = this._tabbedPane.selectedTabId; 1120 var tabId = this._tabbedPane.selectedTabId;
1121 if (!tabId)
1122 return;
1121 var view = this._viewForId(tabId); 1123 var view = this._viewForId(tabId);
1122 if (view) 1124 if (view)
1123 this._tabbedPane.changeTabView(tabId, view); 1125 this._tabbedPane.changeTabView(tabId, view);
1124 }, 1126 },
1125 1127
1126 /** 1128 /**
1127 * @return {?WebInspector.View} 1129 * @return {?WebInspector.View}
1128 */ 1130 */
1129 _viewForId: function(id) 1131 _viewForId: function(id)
1130 { 1132 {
1131 if (this._views.contains(id)) 1133 if (this._views.contains(id))
1132 return /** @type {!WebInspector.View} */ (this._views.get(id)); 1134 return /** @type {!WebInspector.View} */ (this._views.get(id));
1133 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi s._extensions[id].instance()) : null; 1135 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi s._extensions[id].instance()) : null;
1134 this._views.put(id, view); 1136 this._views.put(id, view);
1135 if (this._viewCallback && view) 1137 if (this._viewCallback && view)
1136 this._viewCallback(id, view); 1138 this._viewCallback(id, view);
1137 return view; 1139 return view;
1138 } 1140 }
1139 } 1141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698