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

Unified Diff: tracing/tracing/ui/brushing_state.html

Issue 1429863004: Actually fix analysis link hovering (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/ui/base/event_presenter.html ('k') | tracing/tracing/ui/brushing_state_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/brushing_state.html
diff --git a/tracing/tracing/ui/brushing_state.html b/tracing/tracing/ui/brushing_state.html
index 974dc9cd12d1b7506468b76ecc624ec0a6582b06..35b4b6ea645ffd41228610a3771da842ee398123 100644
--- a/tracing/tracing/ui/brushing_state.html
+++ b/tracing/tracing/ui/brushing_state.html
@@ -137,35 +137,52 @@ tr.exportTo('tr.ui.b', function() {
this.viewSpecificBrushingStates_ = viewSpecificBrushingStates;
},
-
- get hasHighlight_() {
+ get causesDimming_() {
return this.findMatches_.length > 0 ||
- this.analysisViewRelatedEvents_.length > 0 ||
- this.analysisLinkHoveredEvents_.length > 0;
+ this.analysisViewRelatedEvents_.length > 0;
+ },
+
+ get brightenedEvents_() {
+ var brightenedEvents = new EventSet();
+ brightenedEvents.addEventSet(this.selection_);
+ brightenedEvents.addEventSet(this.analysisLinkHoveredEvents_);
+ return brightenedEvents;
},
applyToModelSelectionState: function(model) {
this.appliedToModel_ = model;
-
- if (!this.hasHighlight_) {
- this.selection_.forEach(function(e) {
- e.selectionState = SelectionState.SELECTED;
- });
+ if (!this.causesDimming_) {
+ this.brightenedEvents_.forEach(function(e) {
+ var score;
+ score = 0;
+ if (this.selection_.contains(e))
+ score++;
+ if (this.analysisLinkHoveredEvents_.contains(e))
+ score++;
+ e.selectionState = SelectionState.getFromBrighteningLevel(score);
+ }, this);
return;
}
+
+ var brightenedEvents = this.brightenedEvents_;
model.iterateAllEvents(function(e) {
- var selectionState;
- if (this.selection_.contains(e)) {
- selectionState = SelectionState.SELECTED;
- } else if (this.findMatches_.contains(e) ||
- this.analysisViewRelatedEvents_.contains(e) ||
- this.analysisLinkHoveredEvents_.contains(e)) {
- selectionState = SelectionState.HIGHLIGHTED;
+ var score;
+ if (brightenedEvents.contains(e)) {
+ score = 0;
+ if (this.selection_.contains(e))
+ score++;
+ if (this.analysisLinkHoveredEvents_.contains(e))
+ score++;
+ e.selectionState = SelectionState.getFromBrighteningLevel(score);
} else {
- selectionState = SelectionState.DIMMED;
+ score = 0;
+ if (this.findMatches_.contains(e))
+ score++;
+ if (this.analysisViewRelatedEvents_.contains(e))
+ score++;
+ e.selectionState = SelectionState.getFromDimmingLevel(score);
}
- e.selectionState = selectionState;
}.bind(this));
},
@@ -183,12 +200,13 @@ tr.exportTo('tr.ui.b', function() {
var model = this.appliedToModel_;
this.appliedToModel_ = undefined;
- if (!this.hasHighlight_) {
- this.selection_.forEach(function(e) {
+ if (!this.causesDimming_) {
+ this.brightenedEvents_.forEach(function(e) {
e.selectionState = SelectionState.NONE;
});
return;
}
+
model.iterateAllEvents(function(e) {
e.selectionState = SelectionState.NONE;
});
« no previous file with comments | « tracing/tracing/ui/base/event_presenter.html ('k') | tracing/tracing/ui/brushing_state_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698