Bug 1411339 - Configuration for different UI densities. r?mconley draft
authorRand Mustafa <rndmustafa@gmail.com>
Fri, 27 Oct 2017 14:26:01 -0400
changeset 690491 69ca21e2b0035ba3c01749a1160ea4e1e4626d88
parent 684076 b98bab52ab5044d409665fd787ad4da058f1bb60
child 738582 94a5ba482eb98f140e2506eb0712baee6107c26b
push id87311
push userbmo:rndmustafa@gmail.com
push dateThu, 02 Nov 2017 01:37:22 +0000
reviewersmconley
bugs1411339
milestone58.0a1
Bug 1411339 - Configuration for different UI densities. r?mconley MozReview-Commit-ID: HDz4USew9YM
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/UIDensities.jsm
new file mode 100644
--- /dev/null
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/UIDensities.jsm
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+this.EXPORTED_SYMBOLS = ["UIDensities"];
+
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+Cu.import("resource://gre/modules/Services.jsm");
+
+this.UIDensities = {
+
+  init(libDir) {},
+
+  configurations: {
+    compactDensity: {
+      selectors: ["#navigator-toolbox, #appMenu-popup, #widget-overflow"],
+      async applyConfig() {
+        let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
+        browserWindow.gCustomizeMode.setUIDensity(browserWindow.gUIDensity.MODE_COMPACT);
+      },
+    },
+
+    normalDensity: {
+      selectors: ["#navigator-toolbox, #appMenu-popup, #widget-overflow"],
+      async applyConfig() {
+        let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
+        browserWindow.gCustomizeMode.setUIDensity(browserWindow.gUIDensity.MODE_NORMAL);
+      },
+    },
+
+    touchDensity: {
+      selectors: ["#navigator-toolbox, #appMenu-popup, #widget-overflow"],
+      async applyConfig() {
+        let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
+        browserWindow.gCustomizeMode.setUIDensity(browserWindow.gUIDensity.MODE_TOUCH);
+      },
+    },
+  },
+};