| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * EventsView displays a filtered list of all events sharing a source, and | 6 * EventsView displays a filtered list of all events sharing a source, and |
| 7 * a details pane for the selected sources. | 7 * a details pane for the selected sources. |
| 8 * | 8 * |
| 9 * +----------------------++----------------+ | 9 * +----------------------++----------------+ |
| 10 * | filter box || | | 10 * | filter box || | |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 this.filterInput_.addEventListener('search', | 65 this.filterInput_.addEventListener('search', |
| 66 this.onFilterTextChanged_.bind(this), true); | 66 this.onFilterTextChanged_.bind(this), true); |
| 67 | 67 |
| 68 $(EventsView.DELETE_SELECTED_ID).onclick = this.deleteSelected_.bind(this); | 68 $(EventsView.DELETE_SELECTED_ID).onclick = this.deleteSelected_.bind(this); |
| 69 | 69 |
| 70 $(EventsView.DELETE_ALL_ID).onclick = | 70 $(EventsView.DELETE_ALL_ID).onclick = |
| 71 g_browser.sourceTracker.deleteAllSourceEntries.bind( | 71 g_browser.sourceTracker.deleteAllSourceEntries.bind( |
| 72 g_browser.sourceTracker); | 72 g_browser.sourceTracker); |
| 73 | 73 |
| 74 $(EventsView.CLEAR_CACHE_ID).onclick = this.clearCache_.bind(this); |
| 75 |
| 76 $(EventsView.FLUSH_SOCKETS_ID).onclick = |
| 77 g_browser.sendFlushSocketPools.bind(g_browser); |
| 78 |
| 74 $(EventsView.SELECT_ALL_ID).addEventListener( | 79 $(EventsView.SELECT_ALL_ID).addEventListener( |
| 75 'click', this.selectAll_.bind(this), true); | 80 'click', this.selectAll_.bind(this), true); |
| 76 | 81 |
| 77 $(EventsView.SORT_BY_ID_ID).addEventListener( | 82 $(EventsView.SORT_BY_ID_ID).addEventListener( |
| 78 'click', this.sortById_.bind(this), true); | 83 'click', this.sortById_.bind(this), true); |
| 79 | 84 |
| 80 $(EventsView.SORT_BY_SOURCE_TYPE_ID).addEventListener( | 85 $(EventsView.SORT_BY_SOURCE_TYPE_ID).addEventListener( |
| 81 'click', this.sortBySourceType_.bind(this), true); | 86 'click', this.sortBySourceType_.bind(this), true); |
| 82 | 87 |
| 83 $(EventsView.SORT_BY_DESCRIPTION_ID).addEventListener( | 88 $(EventsView.SORT_BY_DESCRIPTION_ID).addEventListener( |
| 84 'click', this.sortByDescription_.bind(this), true); | 89 'click', this.sortByDescription_.bind(this), true); |
| 85 | 90 |
| 86 // Sets sort order and filter. | 91 // Sets sort order and filter. |
| 87 this.setFilter_(''); | 92 this.setFilter_(''); |
| 88 | 93 |
| 89 this.initializeSourceList_(); | 94 this.initializeSourceList_(); |
| 90 } | 95 } |
| 91 | 96 |
| 92 // ID for special HTML element in category_tabs.html | 97 // ID for special HTML element in category_tabs.html |
| 93 EventsView.TAB_HANDLE_ID = 'tab-handle-events'; | 98 EventsView.TAB_HANDLE_ID = 'tab-handle-events'; |
| 94 | 99 |
| 95 // IDs for special HTML elements in events_view.html | 100 // IDs for special HTML elements in events_view.html |
| 96 EventsView.TBODY_ID = 'events-view-source-list-tbody'; | 101 EventsView.TBODY_ID = 'events-view-source-list-tbody'; |
| 97 EventsView.FILTER_INPUT_ID = 'events-view-filter-input'; | 102 EventsView.FILTER_INPUT_ID = 'events-view-filter-input'; |
| 98 EventsView.FILTER_COUNT_ID = 'events-view-filter-count'; | 103 EventsView.FILTER_COUNT_ID = 'events-view-filter-count'; |
| 99 EventsView.DELETE_SELECTED_ID = 'events-view-delete-selected'; | 104 EventsView.DELETE_SELECTED_ID = 'events-view-delete-selected'; |
| 100 EventsView.DELETE_ALL_ID = 'events-view-delete-all'; | 105 EventsView.DELETE_ALL_ID = 'events-view-delete-all'; |
| 106 EventsView.CLEAR_CACHE_ID = 'events-view-clear-cache'; |
| 107 EventsView.FLUSH_SOCKETS_ID = 'events-view-flush-sockets'; |
| 101 EventsView.SELECT_ALL_ID = 'events-view-select-all'; | 108 EventsView.SELECT_ALL_ID = 'events-view-select-all'; |
| 102 EventsView.SORT_BY_ID_ID = 'events-view-sort-by-id'; | 109 EventsView.SORT_BY_ID_ID = 'events-view-sort-by-id'; |
| 103 EventsView.SORT_BY_SOURCE_TYPE_ID = 'events-view-sort-by-source'; | 110 EventsView.SORT_BY_SOURCE_TYPE_ID = 'events-view-sort-by-source'; |
| 104 EventsView.SORT_BY_DESCRIPTION_ID = 'events-view-sort-by-description'; | 111 EventsView.SORT_BY_DESCRIPTION_ID = 'events-view-sort-by-description'; |
| 105 EventsView.TAB_HANDLES_CONTAINER_ID = 'events-view-details-tab-handles'; | 112 EventsView.TAB_HANDLES_CONTAINER_ID = 'events-view-details-tab-handles'; |
| 106 EventsView.LOG_TAB_ID = 'events-view-details-log-tab'; | 113 EventsView.LOG_TAB_ID = 'events-view-details-log-tab'; |
| 107 EventsView.TIMELINE_TAB_ID = 'events-view-details-timeline-tab'; | 114 EventsView.TIMELINE_TAB_ID = 'events-view-details-timeline-tab'; |
| 108 EventsView.DETAILS_LOG_BOX_ID = 'events-view-details-log-box'; | 115 EventsView.DETAILS_LOG_BOX_ID = 'events-view-details-log-box'; |
| 109 EventsView.DETAILS_TIMELINE_BOX_ID = 'events-view-details-timeline-box'; | 116 EventsView.DETAILS_TIMELINE_BOX_ID = 'events-view-details-timeline-box'; |
| 110 EventsView.TOPBAR_ID = 'events-view-filter-box'; | 117 EventsView.TOPBAR_ID = 'events-view-filter-box'; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 */ | 469 */ |
| 463 onLoadLogStart: function() { | 470 onLoadLogStart: function() { |
| 464 // Needed to sort new sourceless entries correctly. | 471 // Needed to sort new sourceless entries correctly. |
| 465 this.maxReceivedSourceId_ = 0; | 472 this.maxReceivedSourceId_ = 0; |
| 466 }, | 473 }, |
| 467 | 474 |
| 468 onLoadLogFinish: function(data) { | 475 onLoadLogFinish: function(data) { |
| 469 return true; | 476 return true; |
| 470 }, | 477 }, |
| 471 | 478 |
| 479 // Clear the browser and host caches. |
| 480 clearCache_: function() { |
| 481 g_browser.sendClearHostResolverCache(); |
| 482 g_browser.sendClearBrowserCache(); |
| 483 }, |
| 484 |
| 472 incrementPrefilterCount: function(offset) { | 485 incrementPrefilterCount: function(offset) { |
| 473 this.numPrefilter_ += offset; | 486 this.numPrefilter_ += offset; |
| 474 this.invalidateFilterCounter_(); | 487 this.invalidateFilterCounter_(); |
| 475 }, | 488 }, |
| 476 | 489 |
| 477 incrementPostfilterCount: function(offset) { | 490 incrementPostfilterCount: function(offset) { |
| 478 this.numPostfilter_ += offset; | 491 this.numPostfilter_ += offset; |
| 479 this.invalidateFilterCounter_(); | 492 this.invalidateFilterCounter_(); |
| 480 }, | 493 }, |
| 481 | 494 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 var source1Text = source1.getSourceTypeString(); | 706 var source1Text = source1.getSourceTypeString(); |
| 694 var source2Text = source2.getSourceTypeString(); | 707 var source2Text = source2.getSourceTypeString(); |
| 695 var compareResult = source1Text.localeCompare(source2Text); | 708 var compareResult = source1Text.localeCompare(source2Text); |
| 696 if (compareResult != 0) | 709 if (compareResult != 0) |
| 697 return compareResult; | 710 return compareResult; |
| 698 return compareSourceId(source1, source2); | 711 return compareSourceId(source1, source2); |
| 699 } | 712 } |
| 700 | 713 |
| 701 return EventsView; | 714 return EventsView; |
| 702 })(); | 715 })(); |
| OLD | NEW |