Commit b83eb2c6 authored by zvorygin@chromium.org's avatar zvorygin@chromium.org

[DevTools] Beautified device counter icon.

BUG=

Review URL: https://codereview.chromium.org/303783002

git-svn-id: svn://svn.chromium.org/blink/trunk@175106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0fdb865f
...@@ -63,6 +63,7 @@ WebInspector.InspectorView = function() ...@@ -63,6 +63,7 @@ WebInspector.InspectorView = function()
if (WebInspector.experimentsSettings.devicesPanel.isEnabled()) { if (WebInspector.experimentsSettings.devicesPanel.isEnabled()) {
this._remoteDeviceCountElement = this._rightToolbarElement.createChild("div", "hidden"); this._remoteDeviceCountElement = this._rightToolbarElement.createChild("div", "hidden");
this._remoteDeviceCountElement.addEventListener("click", this.showViewInDrawer.bind(this, "devices"), false); this._remoteDeviceCountElement.addEventListener("click", this.showViewInDrawer.bind(this, "devices"), false);
this._remoteDeviceCountElement.id = "remote-device-count";
WebInspector.inspectorFrontendEventSink.addEventListener(WebInspector.InspectorView.Events.DeviceCountChanged, this._onDeviceCountChanged, this); WebInspector.inspectorFrontendEventSink.addEventListener(WebInspector.InspectorView.Events.DeviceCountChanged, this._onDeviceCountChanged, this);
} }
...@@ -465,7 +466,10 @@ WebInspector.InspectorView.prototype = { ...@@ -465,7 +466,10 @@ WebInspector.InspectorView.prototype = {
*/ */
_onDeviceCountChanged: function(event) _onDeviceCountChanged: function(event)
{ {
var count = /** @type {number} */(event.data); var count = /** @type {number} */ (event.data);
if (count === this.deviceCount_)
return;
this.deviceCount_ = count;
this._remoteDeviceCountElement.classList.toggle("hidden", !count); this._remoteDeviceCountElement.classList.toggle("hidden", !count);
this._remoteDeviceCountElement.removeChildren(); this._remoteDeviceCountElement.removeChildren();
this._createImagedCounterElementIfNeeded(this._remoteDeviceCountElement, count, "device-count", "device-icon-small"); this._createImagedCounterElementIfNeeded(this._remoteDeviceCountElement, count, "device-count", "device-icon-small");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment