bug 542884 - remove softkb observer r=mfinkle
authorBrad Lassey <blassey@mozilla.com>
Fri, 29 Jan 2010 11:22:50 -0500
changeset 65999 3c21f00be4b4f8080831d9e100ef0a191db99163
parent 65998 7b196f107af4c2f7bb2b1aba3a1c3261a9ace684
child 66000 689936535c86be8248afcf9c4557bcf1a53fb322
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs542884
bug 542884 - remove softkb observer r=mfinkle
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -456,19 +456,16 @@ var Browser = {
 
     // load styles for scrollbars
     var styleURI = gIOService.newURI("chrome://browser/content/content.css", null, null);
     styleSheets.loadAndRegisterSheet(styleURI, styleSheets.AGENT_SHEET);
 
     var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
     os.addObserver(gXPInstallObserver, "xpinstall-install-blocked", false);
     os.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);
-#ifdef WINCE
-    os.addObserver(SoftKeyboardObserver, "softkb-change", false);
-#endif
 
     // clear out tabs the user hasn't touched lately on memory crunch
     os.addObserver(MemoryObserver, "memory-pressure", false);
 
     // search engine changes
     os.addObserver(BrowserSearch, "browser-search-engine-modified", false);
 
     window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
@@ -579,19 +576,16 @@ var Browser = {
     this._browserView.uninit();
     BrowserUI.uninit();
     this._pluginObserver.stop();
 
     var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
     os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked");
     os.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
     os.removeObserver(MemoryObserver, "memory-pressure");
-#ifdef WINCE
-    os.removeObserver(SoftKeyboardObserver, "softkb-change");
-#endif
     os.removeObserver(BrowserSearch, "browser-search-engine-modified");
 
     window.controllers.removeController(this);
     window.controllers.removeController(BrowserUI);
   },
 
   initNewProfile: function initNewProfile() {
   },
@@ -2329,37 +2323,16 @@ var MemoryObserver = {
   observe: function mo_observe() {
     let memory = Cc["@mozilla.org/xpcom/memory-service;1"].getService(Ci.nsIMemory);
     do {
       Browser.windowUtils.garbageCollect();
     } while (memory.isLowMemory() && Browser.sacrificeTab());
   }
 };
 
-#ifdef WINCE
-// Windows Mobile does not resize the window automatically when the soft
-// keyboard is displayed. Maemo does resize the window.
-var SoftKeyboardObserver = {
-  observe: function sko_observe(subject, topic, data) {
-    if (topic === "softkb-change") {
-      // The rect passed to us is the space available to our window, so
-      // let's use it to resize the main window
-      let rect = JSON.parse(data);
-      if (rect) {
-        let height = rect.bottom - rect.top;
-        let width = rect.right - rect.left;
-        let popup = document.getElementById("popup_autocomplete");
-        popup.height = height - BrowserUI.toolbarH;
-        popup.width = width;
-      }
-    }
-  }
-};
-#endif
-
 function getNotificationBox(aWindow) {
   return Browser.getNotificationBox();
 }
 
 function importDialog(parent, src, arguments) {
   // load the dialog with a synchronous XHR
   let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
   xhr.open("GET", src, false);