OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/tracing/core/filter.html"> | 7 <link rel="import" href="/tracing/core/filter.html"> |
8 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> | 8 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> |
9 <link rel="import" href="/tracing/ui/base/info_bar_group.html"> | 9 <link rel="import" href="/tracing/ui/base/info_bar_group.html"> |
10 <link rel="import" href="/tracing/ui/base/overlay.html"> | 10 <link rel="import" href="/tracing/ui/base/overlay.html"> |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 'category-description-hidden'); | 448 'category-description-hidden'); |
449 } else { | 449 } else { |
450 description.innerText = ''; | 450 description.innerText = ''; |
451 if (!Polymer.dom(description).classList.contains( | 451 if (!Polymer.dom(description).classList.contains( |
452 'category-description-hidden')) { | 452 'category-description-hidden')) { |
453 Polymer.dom(description).classList.add('category-description-hidden'); | 453 Polymer.dom(description).classList.add('category-description-hidden'); |
454 } | 454 } |
455 } | 455 } |
456 }, | 456 }, |
457 | 457 |
458 categoryFilter() { | 458 includedAndExcludedCategories() { |
| 459 let includedCategories = []; |
| 460 let excludedCategories = []; |
459 if (this.usingPreset_()) { | 461 if (this.usingPreset_()) { |
460 const categories = []; | |
461 const allCategories = this.allCategories_(); | 462 const allCategories = this.allCategories_(); |
462 for (const category in allCategories) { | 463 for (const category in allCategories) { |
463 const disabled = category.indexOf('disabled-by-default-') === 0; | 464 const disabledByDefault = |
| 465 category.indexOf('disabled-by-default-') === 0; |
464 if (this.currentlyChosenPreset_.indexOf(category) >= 0) { | 466 if (this.currentlyChosenPreset_.indexOf(category) >= 0) { |
465 if (disabled) { | 467 if (disabledByDefault) { |
466 categories.push(category); | 468 includedCategories.push(category); |
467 } | 469 } |
468 } else { | 470 } else { |
469 if (!disabled) { | 471 if (!disabledByDefault) { |
470 categories.push('-' + category); | 472 excludedCategories.push(category); |
471 } | 473 } |
472 } | 474 } |
473 } | 475 } |
474 return categories.join(','); | 476 return { |
| 477 included: includedCategories, |
| 478 excluded: excludedCategories |
| 479 }; |
475 } | 480 } |
476 | 481 |
477 let categories = this.unselectedCategories_(); | 482 excludedCategories = this.unselectedCategories_(); |
478 const categoriesLength = categories.length; | 483 includedCategories = this.enabledDisabledByDefaultCategories_(); |
479 const negatedCategories = []; | 484 return { |
480 for (let i = 0; i < categoriesLength; ++i) { | 485 included: includedCategories, |
481 // Skip any category with a , as it will cause issues when we negate. | 486 excluded: excludedCategories |
482 // Both sides should have been added as separate categories, these can | 487 }; |
483 // only come from settings. | |
484 if (categories[i].match(/,/)) continue; | |
485 negatedCategories.push('-' + categories[i]); | |
486 } | |
487 categories = negatedCategories.join(','); | |
488 | |
489 let disabledCategories = this.enabledDisabledByDefaultCategories_(); | |
490 disabledCategories = disabledCategories.join(','); | |
491 | |
492 const results = []; | |
493 if (categories !== '') { | |
494 results.push(categories); | |
495 } | |
496 if (disabledCategories !== '') { | |
497 results.push(disabledCategories); | |
498 } | |
499 return results.join(','); | |
500 }, | 488 }, |
501 | 489 |
502 clickRecordButton() { | 490 clickRecordButton() { |
503 this.recordButtonEl_.click(); | 491 this.recordButtonEl_.click(); |
504 }, | 492 }, |
505 | 493 |
506 onRecordButtonClicked_() { | 494 onRecordButtonClicked_() { |
507 this.visible = false; | 495 this.visible = false; |
508 tr.b.dispatchSimpleEvent(this, 'recordclick'); | 496 tr.b.dispatchSimpleEvent(this, 'recordclick'); |
509 return false; | 497 return false; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 679 } |
692 warningLink.onclick = onClickHandler.bind(this); | 680 warningLink.onclick = onClickHandler.bind(this); |
693 } | 681 } |
694 }; | 682 }; |
695 | 683 |
696 return { | 684 return { |
697 RecordSelectionDialog, | 685 RecordSelectionDialog, |
698 }; | 686 }; |
699 }); | 687 }); |
700 </script> | 688 </script> |
OLD | NEW |