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

Unified Diff: Source/devtools/front_end/toolbox/MediaQueryInspector.js

Issue 940373004: [DevTools] Teach MediaQueryInspector about disabling models while profiling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplified Created 5 years, 10 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
« no previous file with comments | « Source/devtools/front_end/sdk/CSSStyleModel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/toolbox/MediaQueryInspector.js
diff --git a/Source/devtools/front_end/toolbox/MediaQueryInspector.js b/Source/devtools/front_end/toolbox/MediaQueryInspector.js
index c3ffb99b63ff4a21975ffb0ca0ca8a9256c5e3aa..c1684a4e0f2308af1a3861fa5be1dcf9146c0481 100644
--- a/Source/devtools/front_end/toolbox/MediaQueryInspector.js
+++ b/Source/devtools/front_end/toolbox/MediaQueryInspector.js
@@ -67,6 +67,7 @@ WebInspector.MediaQueryInspector.prototype = {
target.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved, this._scheduleMediaQueriesUpdate, this);
target.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged, this._scheduleMediaQueriesUpdate, this);
target.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged, this._scheduleMediaQueriesUpdate, this);
+ delete this._target;
},
/**
@@ -130,6 +131,9 @@ WebInspector.MediaQueryInspector.prototype = {
*/
_onContextMenu: function(event)
{
+ if (!this._target || !this._target.cssModel.isEnabled())
+ return;
+
var mediaQueryMarker = event.target.enclosingNodeOrSelfWithClass("media-inspector-marker");
if (!mediaQueryMarker)
return;
@@ -174,7 +178,7 @@ WebInspector.MediaQueryInspector.prototype = {
*/
_refetchMediaQueries: function(finishCallback)
{
- if (!this._enabled) {
+ if (!this._enabled || !this._target) {
finishCallback();
return;
}
« no previous file with comments | « Source/devtools/front_end/sdk/CSSStyleModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698