Bug 1411339 - Configuration for different UI densities. r=jaws,mconley
authorRand Mustafa <rndmustafa@gmail.com>
Fri, 27 Oct 2017 14:26:01 -0400
changeset 390339 43aea4af4a2005f96c4b4deb6b1dd5942b91c13a
parent 390338 ac96809f0f2448cb2d11711aa8d4daa3ae3a018b
child 390340 13763ec9100053bc33afc138cb2bdabafbf299d9
push id32827
push userccoroiu@mozilla.com
push dateMon, 06 Nov 2017 23:02:00 +0000
treeherdermozilla-central@62aeebcc676e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, mconley
bugs1411339
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411339 - Configuration for different UI densities. r=jaws,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);
+      },
+    },
+  },
+};