OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.View} | 7 * @extends {WebInspector.Widget} |
8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
9 */ | 9 */ |
10 WebInspector.MediaQueryInspector = function() | 10 WebInspector.MediaQueryInspector = function() |
11 { | 11 { |
12 WebInspector.View.call(this); | 12 WebInspector.Widget.call(this); |
13 this.element.classList.add("media-inspector-view", "media-inspector-view-emp
ty"); | 13 this.element.classList.add("media-inspector-view", "media-inspector-view-emp
ty"); |
14 this.element.addEventListener("click", this._onMediaQueryClicked.bind(this),
false); | 14 this.element.addEventListener("click", this._onMediaQueryClicked.bind(this),
false); |
15 this.element.addEventListener("contextmenu", this._onContextMenu.bind(this),
false); | 15 this.element.addEventListener("contextmenu", this._onContextMenu.bind(this),
false); |
16 this._mediaThrottler = new WebInspector.Throttler(0); | 16 this._mediaThrottler = new WebInspector.Throttler(0); |
17 | 17 |
18 this._offset = 0; | 18 this._offset = 0; |
19 this._scale = 1; | 19 this._scale = 1; |
20 this._lastReportedCount = 0; | 20 this._lastReportedCount = 0; |
21 | 21 |
22 WebInspector.targetManager.observeTargets(this); | 22 WebInspector.targetManager.observeTargets(this); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (model.maxWidthExpression()) { | 352 if (model.maxWidthExpression()) { |
353 var labelClass = model.section() === WebInspector.MediaQueryInspecto
r.Section.MinMax ? "media-inspector-label-left" : "media-inspector-label-right"; | 353 var labelClass = model.section() === WebInspector.MediaQueryInspecto
r.Section.MinMax ? "media-inspector-label-left" : "media-inspector-label-right"; |
354 var labelContainer = markerElement.createChild("div", "media-inspect
or-marker-label-container media-inspector-marker-label-container-right"); | 354 var labelContainer = markerElement.createChild("div", "media-inspect
or-marker-label-container media-inspector-marker-label-container-right"); |
355 labelContainer.createChild("span", "media-inspector-marker-label " +
labelClass).textContent = model.maxWidthExpression().value() + model.maxWidthEx
pression().unit(); | 355 labelContainer.createChild("span", "media-inspector-marker-label " +
labelClass).textContent = model.maxWidthExpression().value() + model.maxWidthEx
pression().unit(); |
356 } | 356 } |
357 markerElement.title = model.mediaText(); | 357 markerElement.title = model.mediaText(); |
358 | 358 |
359 return markerElement; | 359 return markerElement; |
360 }, | 360 }, |
361 | 361 |
362 __proto__: WebInspector.View.prototype | 362 __proto__: WebInspector.Widget.prototype |
363 }; | 363 }; |
364 | 364 |
365 /** | 365 /** |
366 * @constructor | 366 * @constructor |
367 * @param {!WebInspector.CSSMedia} cssMedia | 367 * @param {!WebInspector.CSSMedia} cssMedia |
368 * @param {?WebInspector.CSSMediaQueryExpression} minWidthExpression | 368 * @param {?WebInspector.CSSMediaQueryExpression} minWidthExpression |
369 * @param {?WebInspector.CSSMediaQueryExpression} maxWidthExpression | 369 * @param {?WebInspector.CSSMediaQueryExpression} maxWidthExpression |
370 * @param {boolean} active | 370 * @param {boolean} active |
371 */ | 371 */ |
372 WebInspector.MediaQueryInspector.MediaQueryUIModel = function(cssMedia, minWidth
Expression, maxWidthExpression, active) | 372 WebInspector.MediaQueryInspector.MediaQueryUIModel = function(cssMedia, minWidth
Expression, maxWidthExpression, active) |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 }, | 507 }, |
508 | 508 |
509 /** | 509 /** |
510 * @return {boolean} | 510 * @return {boolean} |
511 */ | 511 */ |
512 active: function() | 512 active: function() |
513 { | 513 { |
514 return this._active; | 514 return this._active; |
515 } | 515 } |
516 } | 516 } |
OLD | NEW |