OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 _animateWindowTimes: function(startTime, endTime) | 536 _animateWindowTimes: function(startTime, endTime) |
537 { | 537 { |
538 this._timeWindowLeft = startTime; | 538 this._timeWindowLeft = startTime; |
539 this._timeWindowRight = endTime; | 539 this._timeWindowRight = endTime; |
540 this.update(); | 540 this.update(); |
541 }, | 541 }, |
542 | 542 |
543 _animationCompleted: function() | 543 _animationCompleted: function() |
544 { | 544 { |
545 delete this._cancelWindowTimesAnimation; | 545 delete this._cancelWindowTimesAnimation; |
| 546 this._hideHighlight(); |
546 }, | 547 }, |
547 | 548 |
548 /** | 549 /** |
549 * @param {!MouseEvent} event | 550 * @param {!MouseEvent} event |
550 */ | 551 */ |
551 _initMaxDragOffset: function(event) | 552 _initMaxDragOffset: function(event) |
552 { | 553 { |
553 this._maxDragOffsetSquared = 0; | 554 this._maxDragOffsetSquared = 0; |
554 this._dragStartX = event.pageX; | 555 this._dragStartX = event.pageX; |
555 this._dragStartY = event.pageY; | 556 this._dragStartY = event.pageY; |
(...skipping 29 matching lines...) Expand all Loading... |
585 if (!this._timelineData() || this._timeWindowRight === Infinity) | 586 if (!this._timelineData() || this._timeWindowRight === Infinity) |
586 return false; | 587 return false; |
587 this._isDragging = true; | 588 this._isDragging = true; |
588 this._initMaxDragOffset(event); | 589 this._initMaxDragOffset(event); |
589 this._dragStartPointX = event.pageX; | 590 this._dragStartPointX = event.pageX; |
590 this._dragStartPointY = event.pageY; | 591 this._dragStartPointY = event.pageY; |
591 this._dragStartScrollTop = this._vScrollElement.scrollTop; | 592 this._dragStartScrollTop = this._vScrollElement.scrollTop; |
592 this._dragStartWindowLeft = this._timeWindowLeft; | 593 this._dragStartWindowLeft = this._timeWindowLeft; |
593 this._dragStartWindowRight = this._timeWindowRight; | 594 this._dragStartWindowRight = this._timeWindowRight; |
594 this._canvas.style.cursor = ""; | 595 this._canvas.style.cursor = ""; |
| 596 this._hideHighlight(); |
595 return true; | 597 return true; |
596 }, | 598 }, |
597 | 599 |
598 /** | 600 /** |
599 * @param {!MouseEvent} event | 601 * @param {!MouseEvent} event |
600 */ | 602 */ |
601 _canvasDragging: function(event) | 603 _canvasDragging: function(event) |
602 { | 604 { |
603 var pixelShift = this._dragStartPointX - event.pageX; | 605 var pixelShift = this._dragStartPointX - event.pageX; |
604 this._dragStartPointX = event.pageX; | 606 this._dragStartPointX = event.pageX; |
(...skipping 22 matching lines...) Expand all Loading... |
627 this._isDragging = true; | 629 this._isDragging = true; |
628 this._initMaxDragOffset(event); | 630 this._initMaxDragOffset(event); |
629 this._selectionOffsetShiftX = event.offsetX - event.pageX; | 631 this._selectionOffsetShiftX = event.offsetX - event.pageX; |
630 this._selectionOffsetShiftY = event.offsetY - event.pageY; | 632 this._selectionOffsetShiftY = event.offsetY - event.pageY; |
631 this._selectionStartX = event.offsetX; | 633 this._selectionStartX = event.offsetX; |
632 var style = this._selectionOverlay.style; | 634 var style = this._selectionOverlay.style; |
633 style.left = this._selectionStartX + "px"; | 635 style.left = this._selectionStartX + "px"; |
634 style.width = "1px"; | 636 style.width = "1px"; |
635 this._selectedTimeSpanLabel.textContent = ""; | 637 this._selectedTimeSpanLabel.textContent = ""; |
636 this._selectionOverlay.classList.remove("hidden"); | 638 this._selectionOverlay.classList.remove("hidden"); |
| 639 this._hideHighlight(); |
637 return true; | 640 return true; |
638 }, | 641 }, |
639 | 642 |
640 _endRangeSelection: function() | 643 _endRangeSelection: function() |
641 { | 644 { |
642 this._isDragging = false; | 645 this._isDragging = false; |
643 this._flameChartDelegate.endRangeSelection(); | 646 this._flameChartDelegate.endRangeSelection(); |
644 }, | 647 }, |
645 | 648 |
646 _hideRangeSelection: function() | 649 _hideRangeSelection: function() |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 | 1527 |
1525 _updateContentElementSize: function() | 1528 _updateContentElementSize: function() |
1526 { | 1529 { |
1527 this._offsetWidth = this.contentElement.offsetWidth; | 1530 this._offsetWidth = this.contentElement.offsetWidth; |
1528 this._offsetHeight = this.contentElement.offsetHeight; | 1531 this._offsetHeight = this.contentElement.offsetHeight; |
1529 }, | 1532 }, |
1530 | 1533 |
1531 _onScroll: function() | 1534 _onScroll: function() |
1532 { | 1535 { |
1533 this._scrollTop = this._vScrollElement.scrollTop; | 1536 this._scrollTop = this._vScrollElement.scrollTop; |
| 1537 this._hideHighlight(); |
1534 this.scheduleUpdate(); | 1538 this.scheduleUpdate(); |
1535 }, | 1539 }, |
1536 | 1540 |
1537 scheduleUpdate: function() | 1541 scheduleUpdate: function() |
1538 { | 1542 { |
1539 if (this._updateTimerId || this._cancelWindowTimesAnimation) | 1543 if (this._updateTimerId || this._cancelWindowTimesAnimation) |
1540 return; | 1544 return; |
1541 this._updateTimerId = this.element.window().requestAnimationFrame(this.u
pdate.bind(this)); | 1545 this._updateTimerId = this.element.window().requestAnimationFrame(this.u
pdate.bind(this)); |
1542 }, | 1546 }, |
1543 | 1547 |
(...skipping 18 matching lines...) Expand all Loading... |
1562 this.update(); | 1566 this.update(); |
1563 }, | 1567 }, |
1564 | 1568 |
1565 _enabled: function() | 1569 _enabled: function() |
1566 { | 1570 { |
1567 return this._rawTimelineDataLength !== 0; | 1571 return this._rawTimelineDataLength !== 0; |
1568 }, | 1572 }, |
1569 | 1573 |
1570 __proto__: WebInspector.HBox.prototype | 1574 __proto__: WebInspector.HBox.prototype |
1571 } | 1575 } |
OLD | NEW |