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

Unified Diff: trunk/Source/devtools/front_end/main/AdvancedApp.js

Issue 418343002: Revert 178911 "Revert 178848 "[DevTools] Make toolbar counters d..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 | « trunk/Source/devtools/front_end/inspectorStyle.css ('k') | trunk/Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/devtools/front_end/main/AdvancedApp.js
===================================================================
--- trunk/Source/devtools/front_end/main/AdvancedApp.js (revision 178929)
+++ trunk/Source/devtools/front_end/main/AdvancedApp.js (working copy)
@@ -200,7 +200,50 @@
/**
* @constructor
+ * @implements {WebInspector.StatusBarItem.Provider}
*/
+WebInspector.AdvancedApp.DeviceCounter = function()
+{
+ if (!WebInspector.experimentsSettings.devicesPanel.isEnabled() || !(WebInspector.app instanceof WebInspector.AdvancedApp)) {
+ this._counter = null;
+ return;
+ }
+
+ this._counter = new WebInspector.StatusBarCounter(["device-icon-small"]);
+ this._counter.addEventListener("click", showDevices);
+
+ function showDevices()
+ {
+ WebInspector.inspectorView.showViewInDrawer("devices", true);
+ }
+
+ InspectorFrontendHost.setDeviceCountUpdatesEnabled(true);
+ InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DeviceCountUpdated, this._onDeviceCountUpdated, this);
+}
+
+WebInspector.AdvancedApp.DeviceCounter.prototype = {
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onDeviceCountUpdated: function(event)
+ {
+ var count = /** @type {number} */ (event.data);
+ this._counter.setCounter("device-icon-small", count, WebInspector.UIString(count > 1 ? "%d devices found" : "%d device found", count));
+ WebInspector.inspectorView.toolbarItemResized();
+ },
+
+ /**
+ * @return {?WebInspector.StatusBarItem}
+ */
+ item: function()
+ {
+ return this._counter;
+ }
+}
+
+/**
+ * @constructor
+ */
WebInspector.Toolbox = function()
{
if (!window.opener)
@@ -228,7 +271,7 @@
/**
* @constructor
- * @implements {WebInspector.StatusBarButton.Provider}
+ * @implements {WebInspector.StatusBarItem.Provider}
*/
WebInspector.AdvancedApp.EmulationButtonProvider = function()
{
@@ -236,9 +279,9 @@
WebInspector.AdvancedApp.EmulationButtonProvider.prototype = {
/**
- * @return {?WebInspector.StatusBarButton}
+ * @return {?WebInspector.StatusBarItem}
*/
- button: function()
+ item: function()
{
if (!(WebInspector.app instanceof WebInspector.AdvancedApp))
return null;
« no previous file with comments | « trunk/Source/devtools/front_end/inspectorStyle.css ('k') | trunk/Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698