Bug 967286 - Default to Layout.FRAME if layout type isn't specified (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 25 Feb 2014 17:40:50 +0000
changeset 170434 95ff5102419c0e9f741a0792c9b0d0205e93b8f8
parent 170433 6fa0c7a9f778bacc2bfd722b7b5f86381e1d1ce5
child 170435 7ab155a7aa6767b9a0e047d0b08e27ed946ddebe
push id5286
push userlrocha@mozilla.com
push dateTue, 25 Feb 2014 17:41:02 +0000
treeherderfx-team@95ff5102419c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs967286
milestone30.0a1
Bug 967286 - Default to Layout.FRAME if layout type isn't specified (r=margaret)
mobile/android/modules/Home.jsm
--- a/mobile/android/modules/Home.jsm
+++ b/mobile/android/modules/Home.jsm
@@ -205,17 +205,20 @@ let HomePanels = (function () {
 
   let _generatePanel = function(id) {
     let panel = new Panel(id, _registeredPanels[id]());
 
     if (!panel.id || !panel.title) {
       throw "Home.panels: Can't create a home panel without an id and title!";
     }
 
-    if (!_valueExists(Layout, panel.layout)) {
+    if (!panel.layout) {
+      // Use FRAME layout by default
+      panel.layout = Layout.FRAME;
+    } else if (!_valueExists(Layout, panel.layout)) {
       throw "Home.panels: Invalid layout for panel: panel.id = " + panel.id + ", panel.layout =" + panel.layout;
     }
 
     for (let view of panel.views) {
       if (!_valueExists(View, view.type)) {
         throw "Home.panels: Invalid view type: panel.id = " + panel.id + ", view.type = " + view.type;
       }