OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 25 matching lines...) Expand all Loading... |
36 this._id = id; | 36 this._id = id; |
37 this._name = name; | 37 this._name = name; |
38 /** @type {!Array.<!WebInspector.ProfileHeader>} */ | 38 /** @type {!Array.<!WebInspector.ProfileHeader>} */ |
39 this._profiles = []; | 39 this._profiles = []; |
40 /** @type {?WebInspector.ProfileHeader} */ | 40 /** @type {?WebInspector.ProfileHeader} */ |
41 this._profileBeingRecorded = null; | 41 this._profileBeingRecorded = null; |
42 this._nextProfileUid = 1; | 42 this._nextProfileUid = 1; |
43 | 43 |
44 if (!window.opener) | 44 if (!window.opener) |
45 window.addEventListener("unload", this._clearTempStorage.bind(this), fal
se); | 45 window.addEventListener("unload", this._clearTempStorage.bind(this), fal
se); |
46 } | 46 }; |
47 | 47 |
48 /** @enum {symbol} */ | 48 /** @enum {symbol} */ |
49 WebInspector.ProfileType.Events = { | 49 WebInspector.ProfileType.Events = { |
50 AddProfileHeader: Symbol("add-profile-header"), | 50 AddProfileHeader: Symbol("add-profile-header"), |
51 ProfileComplete: Symbol("profile-complete"), | 51 ProfileComplete: Symbol("profile-complete"), |
52 RemoveProfileHeader: Symbol("remove-profile-header"), | 52 RemoveProfileHeader: Symbol("remove-profile-header"), |
53 ViewUpdated: Symbol("view-updated") | 53 ViewUpdated: Symbol("view-updated") |
54 } | 54 }; |
55 | 55 |
56 WebInspector.ProfileType.prototype = { | 56 WebInspector.ProfileType.prototype = { |
57 /** | 57 /** |
58 * @return {string} | 58 * @return {string} |
59 */ | 59 */ |
60 typeName: function() | 60 typeName: function() |
61 { | 61 { |
62 return ""; | 62 return ""; |
63 }, | 63 }, |
64 | 64 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 { | 270 { |
271 this.dispatchEventToListeners(WebInspector.ProfileType.Events.RemoveProf
ileHeader, profile); | 271 this.dispatchEventToListeners(WebInspector.ProfileType.Events.RemoveProf
ileHeader, profile); |
272 profile.dispose(); | 272 profile.dispose(); |
273 if (this._profileBeingRecorded === profile) { | 273 if (this._profileBeingRecorded === profile) { |
274 this.profileBeingRecordedRemoved(); | 274 this.profileBeingRecordedRemoved(); |
275 this.setProfileBeingRecorded(null); | 275 this.setProfileBeingRecorded(null); |
276 } | 276 } |
277 }, | 277 }, |
278 | 278 |
279 __proto__: WebInspector.Object.prototype | 279 __proto__: WebInspector.Object.prototype |
280 } | 280 }; |
281 | 281 |
282 /** | 282 /** |
283 * @interface | 283 * @interface |
284 */ | 284 */ |
285 WebInspector.ProfileType.DataDisplayDelegate = function() | 285 WebInspector.ProfileType.DataDisplayDelegate = function() |
286 { | 286 { |
287 } | 287 }; |
288 | 288 |
289 WebInspector.ProfileType.DataDisplayDelegate.prototype = { | 289 WebInspector.ProfileType.DataDisplayDelegate.prototype = { |
290 /** | 290 /** |
291 * @param {?WebInspector.ProfileHeader} profile | 291 * @param {?WebInspector.ProfileHeader} profile |
292 * @return {?WebInspector.Widget} | 292 * @return {?WebInspector.Widget} |
293 */ | 293 */ |
294 showProfile: function(profile) { }, | 294 showProfile: function(profile) { }, |
295 | 295 |
296 /** | 296 /** |
297 * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId | 297 * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId |
298 * @param {string} perspectiveName | 298 * @param {string} perspectiveName |
299 */ | 299 */ |
300 showObject: function(snapshotObjectId, perspectiveName) { } | 300 showObject: function(snapshotObjectId, perspectiveName) { } |
301 } | 301 }; |
302 | 302 |
303 /** | 303 /** |
304 * @constructor | 304 * @constructor |
305 * @extends {WebInspector.Object} | 305 * @extends {WebInspector.Object} |
306 * @param {?WebInspector.Target} target | 306 * @param {?WebInspector.Target} target |
307 * @param {!WebInspector.ProfileType} profileType | 307 * @param {!WebInspector.ProfileType} profileType |
308 * @param {string} title | 308 * @param {string} title |
309 */ | 309 */ |
310 WebInspector.ProfileHeader = function(target, profileType, title) | 310 WebInspector.ProfileHeader = function(target, profileType, title) |
311 { | 311 { |
312 this._target = target; | 312 this._target = target; |
313 this._profileType = profileType; | 313 this._profileType = profileType; |
314 this.title = title; | 314 this.title = title; |
315 this.uid = profileType._nextProfileUid++; | 315 this.uid = profileType._nextProfileUid++; |
316 this._fromFile = false; | 316 this._fromFile = false; |
317 } | 317 }; |
318 | 318 |
319 /** | 319 /** |
320 * @constructor | 320 * @constructor |
321 * @param {?string} subtitle | 321 * @param {?string} subtitle |
322 * @param {boolean|undefined} wait | 322 * @param {boolean|undefined} wait |
323 */ | 323 */ |
324 WebInspector.ProfileHeader.StatusUpdate = function(subtitle, wait) | 324 WebInspector.ProfileHeader.StatusUpdate = function(subtitle, wait) |
325 { | 325 { |
326 /** @type {?string} */ | 326 /** @type {?string} */ |
327 this.subtitle = subtitle; | 327 this.subtitle = subtitle; |
328 /** @type {boolean|undefined} */ | 328 /** @type {boolean|undefined} */ |
329 this.wait = wait; | 329 this.wait = wait; |
330 } | 330 }; |
331 | 331 |
332 /** @enum {symbol} */ | 332 /** @enum {symbol} */ |
333 WebInspector.ProfileHeader.Events = { | 333 WebInspector.ProfileHeader.Events = { |
334 UpdateStatus: Symbol("UpdateStatus"), | 334 UpdateStatus: Symbol("UpdateStatus"), |
335 ProfileReceived: Symbol("ProfileReceived") | 335 ProfileReceived: Symbol("ProfileReceived") |
336 } | 336 }; |
337 | 337 |
338 WebInspector.ProfileHeader.prototype = { | 338 WebInspector.ProfileHeader.prototype = { |
339 /** | 339 /** |
340 * @return {?WebInspector.Target} | 340 * @return {?WebInspector.Target} |
341 */ | 341 */ |
342 target: function() | 342 target: function() |
343 { | 343 { |
344 return this._target; | 344 return this._target; |
345 }, | 345 }, |
346 | 346 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 { | 418 { |
419 return this._fromFile; | 419 return this._fromFile; |
420 }, | 420 }, |
421 | 421 |
422 setFromFile: function() | 422 setFromFile: function() |
423 { | 423 { |
424 this._fromFile = true; | 424 this._fromFile = true; |
425 }, | 425 }, |
426 | 426 |
427 __proto__: WebInspector.Object.prototype | 427 __proto__: WebInspector.Object.prototype |
428 } | 428 }; |
429 | 429 |
430 /** | 430 /** |
431 * @constructor | 431 * @constructor |
432 * @implements {WebInspector.ProfileType.DataDisplayDelegate} | 432 * @implements {WebInspector.ProfileType.DataDisplayDelegate} |
433 * @extends {WebInspector.PanelWithSidebar} | 433 * @extends {WebInspector.PanelWithSidebar} |
434 */ | 434 */ |
435 WebInspector.ProfilesPanel = function() | 435 WebInspector.ProfilesPanel = function() |
436 { | 436 { |
437 WebInspector.PanelWithSidebar.call(this, "profiles"); | 437 WebInspector.PanelWithSidebar.call(this, "profiles"); |
438 this.registerRequiredCSS("ui/panelEnablerView.css"); | 438 this.registerRequiredCSS("ui/panelEnablerView.css"); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 this._launcherView.restoreSelectedProfileType(); | 487 this._launcherView.restoreSelectedProfileType(); |
488 this.profilesItemTreeElement.select(); | 488 this.profilesItemTreeElement.select(); |
489 this._showLauncherView(); | 489 this._showLauncherView(); |
490 | 490 |
491 this._createFileSelectorElement(); | 491 this._createFileSelectorElement(); |
492 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi
nd(this), false); | 492 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi
nd(this), false); |
493 | 493 |
494 this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this),
false); | 494 this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this),
false); |
495 | 495 |
496 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.SuspendStateChanged, this._onSuspendStateChanged, this); | 496 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.SuspendStateChanged, this._onSuspendStateChanged, this); |
497 } | 497 }; |
498 | 498 |
499 WebInspector.ProfilesPanel.prototype = { | 499 WebInspector.ProfilesPanel.prototype = { |
500 /** | 500 /** |
501 * @param {!Event} event | 501 * @param {!Event} event |
502 */ | 502 */ |
503 _onKeyDown: function(event) | 503 _onKeyDown: function(event) |
504 { | 504 { |
505 var handled = false; | 505 var handled = false; |
506 if (event.key === "ArrowDown" && !event.altKey) | 506 if (event.key === "ArrowDown" && !event.altKey) |
507 handled = this._sidebarTree.selectNext(); | 507 handled = this._sidebarTree.selectNext(); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 { | 919 { |
920 this._sidebarTree.focus(); | 920 this._sidebarTree.focus(); |
921 }, | 921 }, |
922 | 922 |
923 willHide: function() | 923 willHide: function() |
924 { | 924 { |
925 WebInspector.context.setFlavor(WebInspector.ProfilesPanel, null); | 925 WebInspector.context.setFlavor(WebInspector.ProfilesPanel, null); |
926 }, | 926 }, |
927 | 927 |
928 __proto__: WebInspector.PanelWithSidebar.prototype | 928 __proto__: WebInspector.PanelWithSidebar.prototype |
929 } | 929 }; |
930 | 930 |
931 | 931 |
932 /** | 932 /** |
933 * @constructor | 933 * @constructor |
934 * @extends {TreeElement} | 934 * @extends {TreeElement} |
935 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate | 935 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
936 * @param {!WebInspector.ProfileType} profileType | 936 * @param {!WebInspector.ProfileType} profileType |
937 */ | 937 */ |
938 WebInspector.ProfileTypeSidebarSection = function(dataDisplayDelegate, profileTy
pe) | 938 WebInspector.ProfileTypeSidebarSection = function(dataDisplayDelegate, profileTy
pe) |
939 { | 939 { |
940 TreeElement.call(this, profileType.treeItemTitle.escapeHTML(), true); | 940 TreeElement.call(this, profileType.treeItemTitle.escapeHTML(), true); |
941 this.selectable = false; | 941 this.selectable = false; |
942 this._dataDisplayDelegate = dataDisplayDelegate; | 942 this._dataDisplayDelegate = dataDisplayDelegate; |
943 /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ | 943 /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ |
944 this._profileTreeElements = []; | 944 this._profileTreeElements = []; |
945 /** @type {!Object<string, !WebInspector.ProfileTypeSidebarSection.ProfileGr
oup>} */ | 945 /** @type {!Object<string, !WebInspector.ProfileTypeSidebarSection.ProfileGr
oup>} */ |
946 this._profileGroups = {}; | 946 this._profileGroups = {}; |
947 this.expand(); | 947 this.expand(); |
948 this.hidden = true; | 948 this.hidden = true; |
949 } | 949 }; |
950 | 950 |
951 /** | 951 /** |
952 * @constructor | 952 * @constructor |
953 */ | 953 */ |
954 WebInspector.ProfileTypeSidebarSection.ProfileGroup = function() | 954 WebInspector.ProfileTypeSidebarSection.ProfileGroup = function() |
955 { | 955 { |
956 /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ | 956 /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ |
957 this.profileSidebarTreeElements = []; | 957 this.profileSidebarTreeElements = []; |
958 /** @type {?WebInspector.ProfileGroupSidebarTreeElement} */ | 958 /** @type {?WebInspector.ProfileGroupSidebarTreeElement} */ |
959 this.sidebarTreeElement = null; | 959 this.sidebarTreeElement = null; |
960 } | 960 }; |
961 | 961 |
962 WebInspector.ProfileTypeSidebarSection.prototype = { | 962 WebInspector.ProfileTypeSidebarSection.prototype = { |
963 /** | 963 /** |
964 * @param {!WebInspector.ProfileHeader} profile | 964 * @param {!WebInspector.ProfileHeader} profile |
965 */ | 965 */ |
966 addProfileHeader: function(profile) | 966 addProfileHeader: function(profile) |
967 { | 967 { |
968 this.hidden = false; | 968 this.hidden = false; |
969 var profileType = profile.profileType(); | 969 var profileType = profile.profileType(); |
970 var sidebarParent = this; | 970 var sidebarParent = this; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 | 1077 |
1078 /** | 1078 /** |
1079 * @override | 1079 * @override |
1080 */ | 1080 */ |
1081 onattach: function() | 1081 onattach: function() |
1082 { | 1082 { |
1083 this.listItemElement.classList.add("profiles-tree-section"); | 1083 this.listItemElement.classList.add("profiles-tree-section"); |
1084 }, | 1084 }, |
1085 | 1085 |
1086 __proto__: TreeElement.prototype | 1086 __proto__: TreeElement.prototype |
1087 } | 1087 }; |
1088 | 1088 |
1089 | 1089 |
1090 /** | 1090 /** |
1091 * @constructor | 1091 * @constructor |
1092 * @implements {WebInspector.ContextMenu.Provider} | 1092 * @implements {WebInspector.ContextMenu.Provider} |
1093 */ | 1093 */ |
1094 WebInspector.ProfilesPanel.ContextMenuProvider = function() | 1094 WebInspector.ProfilesPanel.ContextMenuProvider = function() |
1095 { | 1095 { |
1096 } | 1096 }; |
1097 | 1097 |
1098 WebInspector.ProfilesPanel.ContextMenuProvider.prototype = { | 1098 WebInspector.ProfilesPanel.ContextMenuProvider.prototype = { |
1099 /** | 1099 /** |
1100 * @override | 1100 * @override |
1101 * @param {!Event} event | 1101 * @param {!Event} event |
1102 * @param {!WebInspector.ContextMenu} contextMenu | 1102 * @param {!WebInspector.ContextMenu} contextMenu |
1103 * @param {!Object} target | 1103 * @param {!Object} target |
1104 */ | 1104 */ |
1105 appendApplicableItems: function(event, contextMenu, target) | 1105 appendApplicableItems: function(event, contextMenu, target) |
1106 { | 1106 { |
1107 WebInspector.ProfilesPanel._instance().appendApplicableItems(event, cont
extMenu, target); | 1107 WebInspector.ProfilesPanel._instance().appendApplicableItems(event, cont
extMenu, target); |
1108 } | 1108 } |
1109 } | 1109 }; |
1110 | 1110 |
1111 /** | 1111 /** |
1112 * @constructor | 1112 * @constructor |
1113 * @extends {TreeElement} | 1113 * @extends {TreeElement} |
1114 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate | 1114 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
1115 * @param {!WebInspector.ProfileHeader} profile | 1115 * @param {!WebInspector.ProfileHeader} profile |
1116 * @param {string} className | 1116 * @param {string} className |
1117 */ | 1117 */ |
1118 WebInspector.ProfileSidebarTreeElement = function(dataDisplayDelegate, profile,
className) | 1118 WebInspector.ProfileSidebarTreeElement = function(dataDisplayDelegate, profile,
className) |
1119 { | 1119 { |
1120 TreeElement.call(this, "", false); | 1120 TreeElement.call(this, "", false); |
1121 this._iconElement = createElementWithClass("div", "icon"); | 1121 this._iconElement = createElementWithClass("div", "icon"); |
1122 this._titlesElement = createElementWithClass("div", "titles no-subtitle"); | 1122 this._titlesElement = createElementWithClass("div", "titles no-subtitle"); |
1123 this._titleContainer = this._titlesElement.createChild("span", "title-contai
ner"); | 1123 this._titleContainer = this._titlesElement.createChild("span", "title-contai
ner"); |
1124 this._titleElement = this._titleContainer.createChild("span", "title"); | 1124 this._titleElement = this._titleContainer.createChild("span", "title"); |
1125 this._subtitleElement = this._titlesElement.createChild("span", "subtitle"); | 1125 this._subtitleElement = this._titlesElement.createChild("span", "subtitle"); |
1126 | 1126 |
1127 this._titleElement.textContent = profile.title; | 1127 this._titleElement.textContent = profile.title; |
1128 this._className = className; | 1128 this._className = className; |
1129 this._small = false; | 1129 this._small = false; |
1130 this._dataDisplayDelegate = dataDisplayDelegate; | 1130 this._dataDisplayDelegate = dataDisplayDelegate; |
1131 this.profile = profile; | 1131 this.profile = profile; |
1132 profile.addEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, thi
s._updateStatus, this); | 1132 profile.addEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, thi
s._updateStatus, this); |
1133 if (profile.canSaveToFile()) | 1133 if (profile.canSaveToFile()) |
1134 this._createSaveLink(); | 1134 this._createSaveLink(); |
1135 else | 1135 else |
1136 profile.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); | 1136 profile.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); |
1137 } | 1137 }; |
1138 | 1138 |
1139 WebInspector.ProfileSidebarTreeElement.prototype = { | 1139 WebInspector.ProfileSidebarTreeElement.prototype = { |
1140 _createSaveLink: function() | 1140 _createSaveLink: function() |
1141 { | 1141 { |
1142 this._saveLinkElement = this._titleContainer.createChild("span", "save-l
ink"); | 1142 this._saveLinkElement = this._titleContainer.createChild("span", "save-l
ink"); |
1143 this._saveLinkElement.textContent = WebInspector.UIString("Save"); | 1143 this._saveLinkElement.textContent = WebInspector.UIString("Save"); |
1144 this._saveLinkElement.addEventListener("click", this._saveProfile.bind(t
his), false); | 1144 this._saveLinkElement.addEventListener("click", this._saveProfile.bind(t
his), false); |
1145 }, | 1145 }, |
1146 | 1146 |
1147 _onProfileReceived: function(event) | 1147 _onProfileReceived: function(event) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 | 1234 |
1235 /** | 1235 /** |
1236 * @param {string} title | 1236 * @param {string} title |
1237 */ | 1237 */ |
1238 setMainTitle: function(title) | 1238 setMainTitle: function(title) |
1239 { | 1239 { |
1240 this._titleElement.textContent = title; | 1240 this._titleElement.textContent = title; |
1241 }, | 1241 }, |
1242 | 1242 |
1243 __proto__: TreeElement.prototype | 1243 __proto__: TreeElement.prototype |
1244 } | 1244 }; |
1245 | 1245 |
1246 /** | 1246 /** |
1247 * @constructor | 1247 * @constructor |
1248 * @extends {TreeElement} | 1248 * @extends {TreeElement} |
1249 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate | 1249 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
1250 * @param {string} title | 1250 * @param {string} title |
1251 */ | 1251 */ |
1252 WebInspector.ProfileGroupSidebarTreeElement = function(dataDisplayDelegate, titl
e) | 1252 WebInspector.ProfileGroupSidebarTreeElement = function(dataDisplayDelegate, titl
e) |
1253 { | 1253 { |
1254 TreeElement.call(this, "", true); | 1254 TreeElement.call(this, "", true); |
1255 this.selectable = false; | 1255 this.selectable = false; |
1256 this._dataDisplayDelegate = dataDisplayDelegate; | 1256 this._dataDisplayDelegate = dataDisplayDelegate; |
1257 this._title = title; | 1257 this._title = title; |
1258 this.expand(); | 1258 this.expand(); |
1259 this.toggleOnClick = true; | 1259 this.toggleOnClick = true; |
1260 } | 1260 }; |
1261 | 1261 |
1262 WebInspector.ProfileGroupSidebarTreeElement.prototype = { | 1262 WebInspector.ProfileGroupSidebarTreeElement.prototype = { |
1263 /** | 1263 /** |
1264 * @override | 1264 * @override |
1265 * @return {boolean} | 1265 * @return {boolean} |
1266 */ | 1266 */ |
1267 onselect: function() | 1267 onselect: function() |
1268 { | 1268 { |
1269 var hasChildren = this.childCount() > 0; | 1269 var hasChildren = this.childCount() > 0; |
1270 if (hasChildren) | 1270 if (hasChildren) |
1271 this._dataDisplayDelegate.showProfile(this.lastChild().profile); | 1271 this._dataDisplayDelegate.showProfile(this.lastChild().profile); |
1272 return hasChildren; | 1272 return hasChildren; |
1273 }, | 1273 }, |
1274 | 1274 |
1275 /** | 1275 /** |
1276 * @override | 1276 * @override |
1277 */ | 1277 */ |
1278 onattach: function() | 1278 onattach: function() |
1279 { | 1279 { |
1280 this.listItemElement.classList.add("profile-group-sidebar-tree-item"); | 1280 this.listItemElement.classList.add("profile-group-sidebar-tree-item"); |
1281 this.listItemElement.createChild("div", "icon"); | 1281 this.listItemElement.createChild("div", "icon"); |
1282 this.listItemElement.createChild("div", "titles no-subtitle").createChil
d("span", "title-container").createChild("span", "title").textContent = this._ti
tle; | 1282 this.listItemElement.createChild("div", "titles no-subtitle").createChil
d("span", "title-container").createChild("span", "title").textContent = this._ti
tle; |
1283 }, | 1283 }, |
1284 | 1284 |
1285 __proto__: TreeElement.prototype | 1285 __proto__: TreeElement.prototype |
1286 } | 1286 }; |
1287 | 1287 |
1288 /** | 1288 /** |
1289 * @constructor | 1289 * @constructor |
1290 * @extends {TreeElement} | 1290 * @extends {TreeElement} |
1291 * @param {!WebInspector.ProfilesPanel} panel | 1291 * @param {!WebInspector.ProfilesPanel} panel |
1292 */ | 1292 */ |
1293 WebInspector.ProfilesSidebarTreeElement = function(panel) | 1293 WebInspector.ProfilesSidebarTreeElement = function(panel) |
1294 { | 1294 { |
1295 TreeElement.call(this, "", false); | 1295 TreeElement.call(this, "", false); |
1296 this.selectable = true; | 1296 this.selectable = true; |
1297 this._panel = panel; | 1297 this._panel = panel; |
1298 } | 1298 }; |
1299 | 1299 |
1300 WebInspector.ProfilesSidebarTreeElement.prototype = { | 1300 WebInspector.ProfilesSidebarTreeElement.prototype = { |
1301 /** | 1301 /** |
1302 * @override | 1302 * @override |
1303 * @return {boolean} | 1303 * @return {boolean} |
1304 */ | 1304 */ |
1305 onselect: function() | 1305 onselect: function() |
1306 { | 1306 { |
1307 this._panel._showLauncherView(); | 1307 this._panel._showLauncherView(); |
1308 return true; | 1308 return true; |
1309 }, | 1309 }, |
1310 | 1310 |
1311 /** | 1311 /** |
1312 * @override | 1312 * @override |
1313 */ | 1313 */ |
1314 onattach: function() | 1314 onattach: function() |
1315 { | 1315 { |
1316 this.listItemElement.classList.add("profile-launcher-view-tree-item"); | 1316 this.listItemElement.classList.add("profile-launcher-view-tree-item"); |
1317 this.listItemElement.createChild("div", "icon"); | 1317 this.listItemElement.createChild("div", "icon"); |
1318 this.listItemElement.createChild("div", "titles no-subtitle").createChil
d("span", "title-container").createChild("span", "title").textContent = WebInspe
ctor.UIString("Profiles"); | 1318 this.listItemElement.createChild("div", "titles no-subtitle").createChil
d("span", "title-container").createChild("span", "title").textContent = WebInspe
ctor.UIString("Profiles"); |
1319 }, | 1319 }, |
1320 | 1320 |
1321 __proto__: TreeElement.prototype | 1321 __proto__: TreeElement.prototype |
1322 } | 1322 }; |
1323 | 1323 |
1324 /** | 1324 /** |
1325 * @return {!WebInspector.ProfilesPanel} | 1325 * @return {!WebInspector.ProfilesPanel} |
1326 */ | 1326 */ |
1327 WebInspector.ProfilesPanel._instance = function() | 1327 WebInspector.ProfilesPanel._instance = function() |
1328 { | 1328 { |
1329 return /** @type {!WebInspector.ProfilesPanel} */ (self.runtime.sharedInstan
ce(WebInspector.ProfilesPanel)); | 1329 return /** @type {!WebInspector.ProfilesPanel} */ (self.runtime.sharedInstan
ce(WebInspector.ProfilesPanel)); |
1330 } | 1330 }; |
1331 | 1331 |
1332 /** | 1332 /** |
1333 * @constructor | 1333 * @constructor |
1334 * @implements {WebInspector.ActionDelegate} | 1334 * @implements {WebInspector.ActionDelegate} |
1335 */ | 1335 */ |
1336 WebInspector.ProfilesPanel.RecordActionDelegate = function() | 1336 WebInspector.ProfilesPanel.RecordActionDelegate = function() |
1337 { | 1337 { |
1338 } | 1338 }; |
1339 | 1339 |
1340 WebInspector.ProfilesPanel.RecordActionDelegate.prototype = { | 1340 WebInspector.ProfilesPanel.RecordActionDelegate.prototype = { |
1341 /** | 1341 /** |
1342 * @override | 1342 * @override |
1343 * @param {!WebInspector.Context} context | 1343 * @param {!WebInspector.Context} context |
1344 * @param {string} actionId | 1344 * @param {string} actionId |
1345 * @return {boolean} | 1345 * @return {boolean} |
1346 */ | 1346 */ |
1347 handleAction: function(context, actionId) | 1347 handleAction: function(context, actionId) |
1348 { | 1348 { |
1349 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); | 1349 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); |
1350 console.assert(panel && panel instanceof WebInspector.ProfilesPanel); | 1350 console.assert(panel && panel instanceof WebInspector.ProfilesPanel); |
1351 panel.toggleRecord(); | 1351 panel.toggleRecord(); |
1352 return true; | 1352 return true; |
1353 } | 1353 } |
1354 } | 1354 }; |
OLD | NEW |