| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 const maxImageDimension = 1024; | 126 const maxImageDimension = 1024; |
| 127 var dimensions = this._viewportDimensions(); | 127 var dimensions = this._viewportDimensions(); |
| 128 if (dimensions.width < 0 || dimensions.height < 0) { | 128 if (dimensions.width < 0 || dimensions.height < 0) { |
| 129 this._isCasting = false; | 129 this._isCasting = false; |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 dimensions.width *= WebInspector.zoomManager.zoomFactor(); | 132 dimensions.width *= WebInspector.zoomManager.zoomFactor(); |
| 133 dimensions.height *= WebInspector.zoomManager.zoomFactor(); | 133 dimensions.height *= WebInspector.zoomManager.zoomFactor(); |
| 134 PageAgent.startScreencast("jpeg", 80, Math.min(maxImageDimension, dimens
ions.width), Math.min(maxImageDimension, dimensions.height)); | 134 PageAgent.startScreencast("jpeg", 80, Math.min(maxImageDimension, dimens
ions.width), Math.min(maxImageDimension, dimensions.height)); |
| 135 WebInspector.domAgent.setHighlighter(this); | 135 WebInspector.domModel.setHighlighter(this); |
| 136 }, | 136 }, |
| 137 | 137 |
| 138 _stopCasting: function() | 138 _stopCasting: function() |
| 139 { | 139 { |
| 140 if (!this._isCasting) | 140 if (!this._isCasting) |
| 141 return; | 141 return; |
| 142 this._isCasting = false; | 142 this._isCasting = false; |
| 143 PageAgent.stopScreencast(); | 143 PageAgent.stopScreencast(); |
| 144 WebInspector.domAgent.setHighlighter(null); | 144 WebInspector.domModel.setHighlighter(null); |
| 145 }, | 145 }, |
| 146 | 146 |
| 147 /** | 147 /** |
| 148 * @param {!WebInspector.Event} event | 148 * @param {!WebInspector.Event} event |
| 149 */ | 149 */ |
| 150 _screencastFrame: function(event) | 150 _screencastFrame: function(event) |
| 151 { | 151 { |
| 152 var metadata = /** type {PageAgent.ScreencastFrameMetadata} */(event.dat
a.metadata); | 152 var metadata = /** type {PageAgent.ScreencastFrameMetadata} */(event.dat
a.metadata); |
| 153 | 153 |
| 154 if (!metadata.deviceScaleFactor) { | 154 if (!metadata.deviceScaleFactor) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 * @param {number} nodeId | 276 * @param {number} nodeId |
| 277 * @this {WebInspector.ScreencastView} | 277 * @this {WebInspector.ScreencastView} |
| 278 */ | 278 */ |
| 279 function callback(error, nodeId) | 279 function callback(error, nodeId) |
| 280 { | 280 { |
| 281 if (error) | 281 if (error) |
| 282 return; | 282 return; |
| 283 if (event.type === "mousemove") | 283 if (event.type === "mousemove") |
| 284 this.highlightDOMNode(nodeId, this._inspectModeConfig); | 284 this.highlightDOMNode(nodeId, this._inspectModeConfig); |
| 285 else if (event.type === "click") | 285 else if (event.type === "click") |
| 286 WebInspector.Revealer.reveal(WebInspector.domAgent.nodeForId(nod
eId)); | 286 WebInspector.Revealer.reveal(WebInspector.domModel.nodeForId(nod
eId)); |
| 287 } | 287 } |
| 288 }, | 288 }, |
| 289 | 289 |
| 290 /** | 290 /** |
| 291 * @param {!KeyboardEvent} event | 291 * @param {!KeyboardEvent} event |
| 292 */ | 292 */ |
| 293 _handleKeyEvent: function(event) | 293 _handleKeyEvent: function(event) |
| 294 { | 294 { |
| 295 if (this._isGlassPaneActive()) { | 295 if (this._isGlassPaneActive()) { |
| 296 event.consume(); | 296 event.consume(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 this._highlightConfig = config; | 451 this._highlightConfig = config; |
| 452 if (!nodeId) { | 452 if (!nodeId) { |
| 453 this._model = null; | 453 this._model = null; |
| 454 this._config = null; | 454 this._config = null; |
| 455 this._node = null; | 455 this._node = null; |
| 456 this._titleElement.classList.add("hidden"); | 456 this._titleElement.classList.add("hidden"); |
| 457 this._repaint(); | 457 this._repaint(); |
| 458 return; | 458 return; |
| 459 } | 459 } |
| 460 | 460 |
| 461 this._node = WebInspector.domAgent.nodeForId(nodeId); | 461 this._node = WebInspector.domModel.nodeForId(nodeId); |
| 462 DOMAgent.getBoxModel(nodeId, callback.bind(this)); | 462 DOMAgent.getBoxModel(nodeId, callback.bind(this)); |
| 463 | 463 |
| 464 /** | 464 /** |
| 465 * @param {?Protocol.Error} error | 465 * @param {?Protocol.Error} error |
| 466 * @param {!DOMAgent.BoxModel} model | 466 * @param {!DOMAgent.BoxModel} model |
| 467 * @this {WebInspector.ScreencastView} | 467 * @this {WebInspector.ScreencastView} |
| 468 */ | 468 */ |
| 469 function callback(error, model) | 469 function callback(error, model) |
| 470 { | 470 { |
| 471 if (error) { | 471 if (error) { |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 * @return {!Element} | 988 * @return {!Element} |
| 989 */ | 989 */ |
| 990 statusBarItem: function() | 990 statusBarItem: function() |
| 991 { | 991 { |
| 992 if (this._initialized) | 992 if (this._initialized) |
| 993 return this._toggleScreencastButton.element; | 993 return this._toggleScreencastButton.element; |
| 994 this._statusBarPlaceholder = document.createElement("div"); | 994 this._statusBarPlaceholder = document.createElement("div"); |
| 995 return this._statusBarPlaceholder; | 995 return this._statusBarPlaceholder; |
| 996 } | 996 } |
| 997 }; | 997 }; |
| OLD | NEW |