| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 this._domModel.nodeForLocation(position.x / this._pageScaleFactor + this
._scrollOffsetX, position.y / this._pageScaleFactor + this._scrollOffsetY, callb
ack.bind(this)); | 238 this._domModel.nodeForLocation(position.x / this._pageScaleFactor + this
._scrollOffsetX, position.y / this._pageScaleFactor + this._scrollOffsetY, callb
ack.bind(this)); |
| 239 | 239 |
| 240 /** | 240 /** |
| 241 * @param {?WebInspector.DOMNode} node | 241 * @param {?WebInspector.DOMNode} node |
| 242 * @this {WebInspector.ScreencastView} | 242 * @this {WebInspector.ScreencastView} |
| 243 */ | 243 */ |
| 244 function callback(node) | 244 function callback(node) |
| 245 { | 245 { |
| 246 if (!node) | 246 if (!node) |
| 247 return; | 247 return; |
| 248 if (event.type === "mousemove") | 248 if (event.type === "mousemove") { |
| 249 this.highlightDOMNode(node, this._inspectModeConfig); | 249 this.highlightDOMNode(node, this._inspectModeConfig); |
| 250 else if (event.type === "click") | 250 this._domModel.nodeHighlightRequested(node.id); |
| 251 } else if (event.type === "click") { |
| 251 WebInspector.Revealer.reveal(node); | 252 WebInspector.Revealer.reveal(node); |
| 253 } |
| 252 } | 254 } |
| 253 }, | 255 }, |
| 254 | 256 |
| 255 /** | 257 /** |
| 256 * @param {!Event} event | 258 * @param {!Event} event |
| 257 */ | 259 */ |
| 258 _handleKeyEvent: function(event) | 260 _handleKeyEvent: function(event) |
| 259 { | 261 { |
| 260 if (this._isGlassPaneActive()) { | 262 if (this._isGlassPaneActive()) { |
| 261 event.consume(); | 263 event.consume(); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 this._drawElementTitle(); | 508 this._drawElementTitle(); |
| 507 | 509 |
| 508 this._context.globalCompositeOperation = "destination-over"; | 510 this._context.globalCompositeOperation = "destination-over"; |
| 509 } | 511 } |
| 510 | 512 |
| 511 this._context.drawImage(this._imageElement, 0, this._screenOffsetTop * t
his._screenZoom, this._imageElement.naturalWidth * this._imageZoom, this._imageE
lement.naturalHeight * this._imageZoom); | 513 this._context.drawImage(this._imageElement, 0, this._screenOffsetTop * t
his._screenZoom, this._imageElement.naturalWidth * this._imageZoom, this._imageE
lement.naturalHeight * this._imageZoom); |
| 512 this._context.restore(); | 514 this._context.restore(); |
| 513 | 515 |
| 514 }, | 516 }, |
| 515 | 517 |
| 516 | |
| 517 /** | |
| 518 * @param {!DOMAgent.Quad} quad1 | |
| 519 * @param {!DOMAgent.Quad} quad2 | |
| 520 * @return {boolean} | |
| 521 */ | |
| 522 _quadsAreEqual: function(quad1, quad2) | |
| 523 { | |
| 524 for (var i = 0; i < quad1.length; ++i) { | |
| 525 if (quad1[i] !== quad2[i]) | |
| 526 return false; | |
| 527 } | |
| 528 return true; | |
| 529 }, | |
| 530 | |
| 531 /** | 518 /** |
| 532 * @param {!DOMAgent.RGBA} color | 519 * @param {!DOMAgent.RGBA} color |
| 533 * @return {string} | 520 * @return {string} |
| 534 */ | 521 */ |
| 535 _cssColor: function(color) | 522 _cssColor: function(color) |
| 536 { | 523 { |
| 537 if (!color) | 524 if (!color) |
| 538 return "transparent"; | 525 return "transparent"; |
| 539 return WebInspector.Color.fromRGBA([color.r, color.g, color.b, color.a])
.asString(WebInspector.Color.Format.RGBA) || ""; | 526 return WebInspector.Color.fromRGBA([color.r, color.g, color.b, color.a])
.asString(WebInspector.Color.Format.RGBA) || ""; |
| 540 }, | 527 }, |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 return; | 864 return; |
| 878 this._maxDisplayedProgress = progress; | 865 this._maxDisplayedProgress = progress; |
| 879 this._displayProgress(progress); | 866 this._displayProgress(progress); |
| 880 }, | 867 }, |
| 881 | 868 |
| 882 _displayProgress: function(progress) | 869 _displayProgress: function(progress) |
| 883 { | 870 { |
| 884 this._element.style.width = (100 * progress) + "%"; | 871 this._element.style.width = (100 * progress) + "%"; |
| 885 } | 872 } |
| 886 }; | 873 }; |
| OLD | NEW |