Bug 576330 - Minor code cleanup [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Thu, 01 Jul 2010 15:39:31 -0400
changeset 66349 8a06ecf16a5544d91057ec277184815e7fb0d7d7
parent 66348 a45f4801e170075474ca07e703ddeb7fa35c253f
child 66350 753b296b41019557b8dfdf3e66f31ec08ee80a7a
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)
reviewersvingtetun
bugs576330
Bug 576330 - Minor code cleanup [r=vingtetun]
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.js
mobile/chrome/content/browser.xul
mobile/chrome/content/content.js
mobile/chrome/content/preferences.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -644,28 +644,16 @@ var BrowserUI = {
 
   switchTask: function switchTask() {
     try {
       let phone = Cc["@mozilla.org/phone/support;1"].createInstance(Ci.nsIPhoneSupport);
       phone.switchTask();
     } catch(e) { }
   },
 
-#ifdef WINCE
-  updateDefaultBrowser: function updateDefaultBrowser(aSet) {
-    try {
-      let phone = Cc["@mozilla.org/phone/support;1"].getService(Ci.nsIPhoneSupport);
-      if (aSet)
-        phone.setDefaultBrowser();
-      else
-        phone.restoreDefaultBrowser();
-    } catch(e) { }
-  },
-#endif
-
   handleEscape: function () {
     // Check open dialogs
     let dialog = this.activeDialog;
     if (dialog) {
       dialog.close();
       return;
     }
     
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2638,20 +2638,16 @@ Tab.prototype = {
     if (this._browser) {
       var browser = this._browser;
       browser.removeProgressListener(this._listener);
 
       this._browser = null;
       this._listener = null;
       this._loading = false;
 
-      try { // this will throw if we're not loading
-        this._stopResizeAndPaint();
-      } catch(ex) {}
-
       Util.executeSoon(function() {
         document.getElementById("browsers").removeChild(browser);
       });
     }
   },
 
   /* Set up the initial zoom level. While the bvs.defaultZoomLevel of a tab is
      equal to bvs.zoomLevel this mean that not user action has happended and
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -52,19 +52,17 @@
 ]>
 
 <window id="main-window"
         onload="Browser.startup();"
         onunload="Browser.shutdown();"
         onclose="return Browser.closing();"
         windowtype="navigator:browser"
         title="&brandShortName;"
-#ifdef WINCE
-        sizemode="fullscreen"
-#elifdef MOZ_PLATFORM_MAEMO
+#ifdef MOZ_PLATFORM_MAEMO
         sizemode="fullscreen"
 #else
         width="800"
         height="500"
 #endif
         onkeypress="onDebugKeyPress(event);"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
@@ -174,26 +172,20 @@
 
     <!-- scrolling -->
     <key id="key_pageUp" keycode="VK_UP" modifiers="shift" command="cmd_scrollPageUp"/>
     <key id="key_pageDown" keycode="VK_DOWN" modifiers="shift" command="cmd_scrollPageDown"/>
 
     <!-- misc -->
     <key id="key_zoomin" keycode="VK_UP" modifiers="accel" command="cmd_zoomin"/>
     <key id="key_zoomout" keycode="VK_DOWN" modifiers="accel" command="cmd_zoomout"/>
-#ifndef WINCE
     <key id="key_quit" key="q" modifiers="accel" command="cmd_quit"/>
     <key id="key_fullscreen" keycode="VK_F6" command="cmd_fullscreen"/>
     <key id="key_zoomin2" keycode="VK_F7" command="cmd_volumeRight"/>
     <key id="key_zoomout2" keycode="VK_F8" command="cmd_volumeLeft"/>
-#else
-    <key id="key_quit" keycode="VK_F4" command="cmd_quit"/>
-    <key id="key_zoomin2" keycode="VK_F1" command="cmd_zoomin"/>
-    <key id="key_zoomout2" keycode="VK_F2" command="cmd_zoomout"/>
-#endif
 
     <!-- tabs -->
     <key id="key_newTab" key="t" modifiers="accel" command="cmd_newTab"/>
     <key id="key_closeTab" key="w" modifiers="accel" command="cmd_closeTab"/>
   </keyset>
 
   <stack flex="1" id="stack">
     <scrollbox id="controls-scrollbox" style="overflow: hidden; -moz-box-orient: horizontal; position: relative;" flex="1">
@@ -403,22 +395,17 @@
 #endif
               </setting>
               <setting id="prefs-uilanguage" title="&language.title;" type="control">
                 <menulist id="prefs-languages" oncommand="PreferencesView.updateLocale();">
                   <menupopup>
                     <menuitem id="prefs-languages-auto" label="&language.auto;" value="auto"/>
                   </menupopup>
                 </menulist>
-               </setting>
-#ifdef WINCE
-              <setting id="prefs-default-browser" type="bool" title="&defaultBrowser.title;" oncommand="BrowserUI.updateDefaultBrowser(this.value);">
-                &defaultBrowser.description;
               </setting>
-#endif
               <setting id="prefs-homepage" title="&homepage.title;" type="control">
                 <menulist id="prefs-homepage-options" oncommand="PreferencesView.updateHomePage();">
                   <menupopup>
                     <menuitem id="prefs-homepage-default" label="&homepage.default;" value="default"/>
                     <menuitem id="prefs-homepage-none" label="&homepage.none;" value="none"/>
                     <menuitem id="prefs-homepage-currentpage" label="&homepage.currentpage;" value="currentpage"/>
                   </menupopup>
                 </menulist>
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -463,18 +463,18 @@ Content.prototype = {
           return;
 
         let element = elementFromPoint(x, y);
         if (!element)
           return;
 
         this._sendMouseEvent("mousedown", element, x, y);
 
-	// If we don't release the implicit capture, we'll get dragging problems
-	// when a contextmenu is displayed
+        // If we don't release the implicit capture, we'll get dragging problems
+        // when a contextmenu is displayed
         element.ownerDocument.releaseCapture();
 
         if (element.mozMatchesSelector("*:link,*:visited,*:link *,*:visited *,*[role=button],button,input,option,select,textarea,label")) {
           this._overlayTimeout = content.setTimeout(function() {
             let rects = getContentClientRects(element);
             sendSyncMessage("Browser:Highlight", { rects: rects });
           }, kTapOverlayTimeout);
         }
@@ -484,17 +484,17 @@ Content.prototype = {
         let element = elementFromPoint(x, y);
         if (modifiers == Ci.nsIDOMNSEvent.CONTROL_MASK) {
           let uri = Util.getHrefForElement(element);
           if (uri)
             sendAsyncMessage("Browser:OpenURI", { uri: uri });
         } else if (!this._formAssistant.open(element)) {
           this._sendMouseEvent("mouseup", element, x, y);
         }
-	break;
+        break;
       }
 
       case "Browser:MouseCancel":
         this._cancelMouseEvent();
         if (this._overlayTimeout) {
           content.clearTimeout(this._overlayTimeout);
           this._overlayTimeout = 0;
         }
--- a/mobile/chrome/content/preferences.js
+++ b/mobile/chrome/content/preferences.js
@@ -113,21 +113,16 @@ var PreferencesView = {
                             },
                             false);
   },
 
   _delayedInit: function ev__delayedInit() {
     if (this._languages)
       return;
 
-#ifdef WINCE
-    let phone = Cc["@mozilla.org/phone/support;1"].getService(Ci.nsIPhoneSupport);
-    document.getElementById("prefs-default-browser").value = phone.isDefaultBrowser(false);
-#endif
-
     this._languages = document.getElementById("prefs-languages");
     this._loadLocales();
 
     this._loadHomePage();
   },
 
   _loadLocales: function _loadLocales() {
     // Query available and selected locales