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