OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 /** | 867 /** |
868 * @param {?WebInspector.TimelineModel.Record} record | 868 * @param {?WebInspector.TimelineModel.Record} record |
869 * @param {string=} regex | 869 * @param {string=} regex |
870 * @param {boolean=} selectRecord | 870 * @param {boolean=} selectRecord |
871 */ | 871 */ |
872 highlightSearchResult: function(record, regex, selectRecord) | 872 highlightSearchResult: function(record, regex, selectRecord) |
873 { | 873 { |
874 }, | 874 }, |
875 | 875 |
876 /** | 876 /** |
877 * @param {?WebInspector.TimelineModel.Record|?WebInspector.TracingModel.Eve nt} record | 877 * @param {?WebInspector.TimelineSelection} selection |
878 */ | 878 */ |
879 setSelectedRecord: function(record) | 879 setSelection: function(selection) |
880 { | 880 { |
881 var record = selection && selection.object(); | |
yurys
2014/05/08 14:56:31
May be bail out early if selection has wrong type?
| |
881 var entryRecords = this._dataProvider._records; | 882 var entryRecords = this._dataProvider._records; |
882 for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) { | 883 for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) { |
883 if (entryRecords[entryIndex] === record) { | 884 if (entryRecords[entryIndex] === record) { |
884 this._mainView.setSelectedEntry(entryIndex); | 885 this._mainView.setSelectedEntry(entryIndex); |
885 return; | 886 return; |
886 } | 887 } |
887 } | 888 } |
888 this._mainView.setSelectedEntry(-1); | 889 this._mainView.setSelectedEntry(-1); |
889 }, | 890 }, |
890 | 891 |
891 /** | 892 /** |
892 * @param {!WebInspector.Event} event | 893 * @param {!WebInspector.Event} event |
893 */ | 894 */ |
894 _onEntrySelected: function(event) | 895 _onEntrySelected: function(event) |
895 { | 896 { |
896 var entryIndex = event.data; | 897 var entryIndex = event.data; |
897 var record = this._dataProvider._records[entryIndex]; | 898 var record = this._dataProvider._records[entryIndex]; |
898 if (record instanceof WebInspector.TimelineModel.Record) | 899 if (record instanceof WebInspector.TimelineModel.Record) |
899 this._delegate.selectRecord(record); | 900 this._delegate.select(WebInspector.TimelineSelection.fromRecord(reco rd)); |
900 }, | 901 }, |
901 | 902 |
902 __proto__: WebInspector.VBox.prototype | 903 __proto__: WebInspector.VBox.prototype |
903 } | 904 } |
OLD | NEW |