Bug 708772 - (3/3) Use honeycomb theme and tablet layout on ICS tablets [r=mfinkle, a=ehsan]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 14 Dec 2011 13:54:16 -0800
changeset 82597 759a688577d55f173e61b1e3d352c17057dabfb8
parent 82596 ae066b87a5254d720868695ffe78382bd2a6e003
child 82598 41f75cbb91f2e3b3f7ce4f4fc993e605e1c87275
push idunknown
push userunknown
push dateunknown
reviewersmfinkle, ehsan
bugs708772
milestone11.0a1
Bug 708772 - (3/3) Use honeycomb theme and tablet layout on ICS tablets [r=mfinkle, a=ehsan]
mobile/xul/chrome/content/Util.js
mobile/xul/themes/core/jar.mn
--- a/mobile/xul/chrome/content/Util.js
+++ b/mobile/xul/chrome/content/Util.js
@@ -172,25 +172,31 @@ let Util = {
     // Act according to user prefs if tablet mode has been
     // explicitly disabled or enabled.
     if (tabletPref == 0)
       return this._isTablet = false;
     else if (tabletPref == 1)
       return this._isTablet = true;
 
 #ifdef ANDROID
-    // Disable tablet mode on non-honeycomb devices because of theme bugs (bug 705026)
     let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
     let shellVersion = sysInfo.get("shellVersion") || "";
     let matches = shellVersion.match(/\((\d+)\)$/);
     if (matches) {
       let sdkVersion = parseInt(matches[1]);
-      if (sdkVersion < 11 || sdkVersion > 13)
+      // Disable tablet mode on pre-honeycomb devices because of theme bugs (bug 705026)
+      if (sdkVersion < 11)
         return this._isTablet = false;
+
+      // Always enable tablet mode on honeycomb devices.
+      if (sdkVersion < 14)
+        return this._isTablet = true;
     }
+    // On Ice Cream Sandwich devices, switch modes based on screen size.
+    return this._isTablet = sysInfo.get("isTablet");
 #endif
 
     let dpi = this.displayDPI;
     if (dpi <= 96)
       return this._isTablet = (window.innerWidth > 1024);
 
     // See the tablet_panel_minwidth from mobile/themes/core/defines.inc
     let tablet_panel_minwidth = 124;
--- a/mobile/xul/themes/core/jar.mn
+++ b/mobile/xul/themes/core/jar.mn
@@ -141,17 +141,17 @@ chrome.jar:
   skin/images/handle-end.png                (images/handle-end.png)
   skin/images/homescreen-blank-hdpi.png     (images/homescreen-blank-hdpi.png)
   skin/images/homescreen-default-hdpi.png   (images/homescreen-default-hdpi.png)
   skin/images/aurora-lightbox-bg.jpg        (images/aurora-lightbox-bg.jpg)
   skin/images/aurora-lightbox-logo.png      (images/aurora-lightbox-logo.png)
   skin/images/aurora-lightbox-close.png     (images/aurora-lightbox-close.png)
 
 chrome.jar:
-% skin browser classic/1.0 %skin/gingerbread/ os=Android osversion=2.3 osversion=2.3.3 osversion=2.3.4 osversion=2.3.5 osversion=2.3.6 osversion=2.3.7 osversion=2.3.8 osversion>=4.0
+% skin browser classic/1.0 %skin/gingerbread/ os=Android osversion>=2.3
 % skin browser gingerbread/1.0 %skin/gingerbread/
   skin/gingerbread/aboutPage.css                        (aboutPage.css)
   skin/gingerbread/about.css                            (about.css)
   skin/gingerbread/aboutHome.css                        (aboutHome.css)
 * skin/gingerbread/browser.css                          (gingerbread/browser.css)
 * skin/gingerbread/content.css                          (gingerbread/content.css)
   skin/gingerbread/config.css                           (config.css)
 * skin/gingerbread/forms.css                            (gingerbread/forms.css)
@@ -280,17 +280,20 @@ chrome.jar:
   skin/gingerbread/images/errorpage-larry-black.png     (images/errorpage-larry-black.png)
   skin/gingerbread/images/homescreen-blank-hdpi.png     (images/homescreen-blank-hdpi.png)
   skin/gingerbread/images/homescreen-default-hdpi.png   (images/homescreen-default-hdpi.png)
   skin/gingerbread/images/aurora-lightbox-bg.jpg        (images/aurora-lightbox-bg.jpg)
   skin/gingerbread/images/aurora-lightbox-logo.png      (images/aurora-lightbox-logo.png)
   skin/gingerbread/images/aurora-lightbox-close.png     (images/aurora-lightbox-close.png)
 
 chrome.jar:
-% skin browser classic/1.0 %skin/honeycomb/ os=Android osversion=3.0 osversion=3.1 osversion=3.2 osversion=3.2.1 osversion=3.2.2 osversion=3.2.3 osversion=3.2.4 osversion=3.2.5 osversion=3.2.6 osversion=3.2.7 osversion=3.2.8 osversion=3.2.9
+# Always use the honeycomb theme on honeycomb devices.
+% skin browser classic/1.0 %skin/honeycomb/ os=Android osversion>=3.0
+# On Ice Cream Sandwich devices, switch themes based on screen size.
+% skin browser classic/1.0 %skin/gingerbread/ os=Android osversion>=4.0 tablet=0
 % skin browser honeycomb/1.0 %skin/honeycomb/
   skin/honeycomb/aboutPage.css                        (aboutPage.css)
   skin/honeycomb/about.css                            (about.css)
   skin/honeycomb/aboutHome.css                        (aboutHome.css)
 * skin/honeycomb/browser.css                          (honeycomb/browser.css)
 * skin/honeycomb/content.css                          (content.css)
   skin/honeycomb/config.css                           (config.css)
 * skin/honeycomb/forms.css                            (honeycomb/forms.css)