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

Unified Diff: third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js

Issue 2819183002: [DevTools] Consolidate overlay-related functionality in Overlay domain (Closed)
Patch Set: rebased bad merge Created 3 years, 8 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
Index: third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
index 91bbe6654f3b216d8769f52dfda3f6f7e0a6d52a..a1250e94dfecf27a09c21f88ca61c025d82f7514 100644
--- a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
+++ b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
- * @implements {SDK.DOMNodeHighlighter}
+ * @implements {SDK.OverlayModel.Highlighter}
* @unrestricted
*/
Screencast.ScreencastView = class extends UI.VBox {
@@ -39,6 +39,7 @@ Screencast.ScreencastView = class extends UI.VBox {
super();
this._screenCaptureModel = screenCaptureModel;
this._domModel = screenCaptureModel.target().model(SDK.DOMModel);
+ this._overlayModel = screenCaptureModel.target().model(SDK.OverlayModel);
this._resourceTreeModel = screenCaptureModel.target().model(SDK.ResourceTreeModel);
this._networkManager = screenCaptureModel.target().model(SDK.NetworkManager);
this._inputModel = screenCaptureModel.target().model(Screencast.InputModel);
@@ -130,8 +131,8 @@ Screencast.ScreencastView = class extends UI.VBox {
Math.floor(Math.min(maxImageDimension, dimensions.height)), undefined, this._screencastFrame.bind(this),
this._screencastVisibilityChanged.bind(this));
Emulation.MultitargetTouchModel.instance().setCustomTouchEnabled(true);
- if (this._domModel)
- this._domModel.setHighlighter(this);
+ if (this._overlayModel)
+ this._overlayModel.setHighlighter(this);
}
_stopCasting() {
@@ -140,8 +141,8 @@ Screencast.ScreencastView = class extends UI.VBox {
this._isCasting = false;
this._screenCaptureModel.stopScreencast();
Emulation.MultitargetTouchModel.instance().setCustomTouchEnabled(false);
- if (this._domModel)
- this._domModel.setHighlighter(null);
+ if (this._overlayModel)
+ this._overlayModel.setHighlighter(null);
}
/**
@@ -245,7 +246,7 @@ Screencast.ScreencastView = class extends UI.VBox {
return;
if (event.type === 'mousemove') {
this.highlightDOMNode(node, this._inspectModeConfig);
- this._domModel.nodeHighlightRequested(node.id);
+ this._domModel.overlayModel().nodeHighlightRequested(node.id);
} else if (event.type === 'click') {
Common.Revealer.reveal(node);
}
@@ -316,7 +317,7 @@ Screencast.ScreencastView = class extends UI.VBox {
/**
* @override
* @param {?SDK.DOMNode} node
- * @param {?Protocol.DOM.HighlightConfig} config
+ * @param {?Protocol.Overlay.HighlightConfig} config
* @param {!Protocol.DOM.BackendNodeId=} backendNodeId
* @param {!Protocol.Runtime.RemoteObjectId=} objectId
*/
@@ -569,14 +570,13 @@ Screencast.ScreencastView = class extends UI.VBox {
/**
* @override
- * @param {!Protocol.DOM.InspectMode} mode
- * @param {!Protocol.DOM.HighlightConfig} config
- * @param {function(?Protocol.Error)=} callback
+ * @param {!Protocol.Overlay.InspectMode} mode
+ * @param {!Protocol.Overlay.HighlightConfig} config
+ * @return {!Promise}
*/
- setInspectMode(mode, config, callback) {
- this._inspectModeConfig = mode !== Protocol.DOM.InspectMode.None ? config : null;
- if (callback)
- callback(null);
+ setInspectMode(mode, config) {
+ this._inspectModeConfig = mode !== Protocol.Overlay.InspectMode.None ? config : null;
+ return Promise.resolve();
}
/**

Powered by Google App Engine
This is Rietveld 408576698