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

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

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 4 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 a90496ec4d8e2447767fb0d3c2d0ae419ff2ce5a..cd3409e712f5aec7829c04e8102fe42ec7adbcc1 100644
--- a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
+++ b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
@@ -33,12 +33,14 @@
* @extends {WebInspector.VBox}
* @implements {WebInspector.DOMNodeHighlighter}
* @param {!WebInspector.Target} target
+ * @param {!WebInspector.ResourceTreeModel} resourceTreeModel
*/
-WebInspector.ScreencastView = function(target)
+WebInspector.ScreencastView = function(target, resourceTreeModel)
{
WebInspector.VBox.call(this);
this._target = target;
this._domModel = WebInspector.DOMModel.fromTarget(target);
+ this._resourceTreeModel = resourceTreeModel;
this.setMinimumSize(150, 150);
this.registerRequiredCSS("screencast/screencastView.css");
@@ -97,8 +99,8 @@ WebInspector.ScreencastView.prototype = {
this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({});
this._shortcuts[WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl)] = this._focusNavigationBar.bind(this);
- this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this);
- this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastVisibilityChanged, this._screencastVisibilityChanged, this);
+ this._resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this);
+ this._resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastVisibilityChanged, this._screencastVisibilityChanged, this);
WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChange, this);
this._updateGlasspane();
@@ -741,7 +743,7 @@ WebInspector.ScreencastView.prototype = {
_navigateReload: function()
{
- this._target.resourceTreeModel.reloadPage();
+ this._resourceTreeModel.reloadPage();
},
_navigationUrlKeyUp: function(event)

Powered by Google App Engine
This is Rietveld 408576698