From f22ee0eab8010077d514d13b02edf5c736fffa90 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 9 Dec 2013 15:54:27 -0500 Subject: [PATCH] Backed out changeset 772c30e9e812 (bug 944255) for mochitest-mc orange. --- browser/metro/modules/View.jsm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/metro/modules/View.jsm b/browser/metro/modules/View.jsm index cd60b89181fc..d2e771856583 100644 --- a/browser/metro/modules/View.jsm +++ b/browser/metro/modules/View.jsm @@ -27,18 +27,18 @@ function makeURI(aURL, aOriginCharset, aBaseURI) { function View(aSet) { this._set = aSet; this._set.controller = this; - this._window = aSet.ownerDocument.defaultView; - - this.onResize = () => this._adjustDOMforViewState(); - this._window.addEventListener("resize", this.onResize); + this.viewStateObserver = { + observe: (aSubject, aTopic, aData) => this._adjustDOMforViewState(aData) + }; + Services.obs.addObserver(this.viewStateObserver, "metro_viewstate_changed", false); ColorUtils.init(); this._adjustDOMforViewState(); } View.prototype = { destruct: function () { - this._window.removeEventListener("resize", this.onResize); + Services.obs.removeObserver(this.viewStateObserver, "metro_viewstate_changed"); }, _adjustDOMforViewState: function _adjustDOMforViewState(aState) {