Bug 1608336 - Disable Touch Bar for non-chrome windows. r=mikedeboer
authorHarry Twyford <htwyford@mozilla.com>
Tue, 11 Feb 2020 09:49:11 +0000
changeset 513200 28f5f9a9119970f47ee5aad281ed4442cb4031ec
parent 513199 3a22ad88177254e27142d2691c1ac3a0a7a240a4
child 513201 146518d1ebf2c5f60c01b1db63f43f4888f11a88
push id37112
push userbtara@mozilla.com
push dateTue, 11 Feb 2020 21:47:36 +0000
treeherdermozilla-central@79d5ac0c4227 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1608336
milestone75.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 1608336 - Disable Touch Bar for non-chrome windows. r=mikedeboer Differential Revision: https://phabricator.services.mozilla.com/D62259
browser/components/touchbar/MacTouchBar.js
--- a/browser/components/touchbar/MacTouchBar.js
+++ b/browser/components/touchbar/MacTouchBar.js
@@ -289,16 +289,26 @@ class TouchBarHelper {
     return activeTitle;
   }
 
   get allItems() {
     let layoutItems = Cc["@mozilla.org/array;1"].createInstance(
       Ci.nsIMutableArray
     );
 
+    let window = TouchBarHelper.window;
+    if (
+      !window ||
+      !window.isChromeWindow ||
+      window.document.documentElement.getAttribute("windowtype") !=
+        "navigator:browser"
+    ) {
+      return layoutItems;
+    }
+
     // Every input must be updated at least once so that all assets (titles,
     // icons) are loaded. We keep track of which inputs haven't updated and
     // run an update on them ASAP.
     this._inputsNotUpdated.clear();
 
     for (let inputName of Object.keys(gBuiltInInputs)) {
       let input = this.getTouchBarInput(inputName);
       if (!input) {