Bug 1139672 - Home panels: Update default order. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 03 Aug 2015 15:29:37 +0200
changeset 256975 e1e678b33aa6ac01b524803faf9103f14bb4aaca
parent 256974 f63aa8d0a399d02aed164a2b524416fcd60b4902
child 256976 7f0cc9a2bf79950da4f9a4c4ab7df7c73e5a497d
push id14556
push users.kaspari@gmail.com
push dateSun, 09 Aug 2015 17:57:03 +0000
treeherderfx-team@e1e678b33aa6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1139672
milestone42.0a1
Bug 1139672 - Home panels: Update default order. r=margaret
mobile/android/base/home/HomeConfigPrefsBackend.java
mobile/android/tests/browser/robocop/components/AboutHomeComponent.java
--- a/mobile/android/base/home/HomeConfigPrefsBackend.java
+++ b/mobile/android/base/home/HomeConfigPrefsBackend.java
@@ -69,34 +69,25 @@ class HomeConfigPrefsBackend implements 
 
     private State loadDefaultConfig() {
         final ArrayList<PanelConfig> panelConfigs = new ArrayList<PanelConfig>();
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.TOP_SITES,
                                                   EnumSet.of(PanelConfig.Flags.DEFAULT_PANEL)));
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.BOOKMARKS));
-        panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.READING_LIST));
-
-        final PanelConfig historyEntry = createBuiltinPanelConfig(mContext, PanelType.HISTORY);
-        final PanelConfig recentTabsEntry = createBuiltinPanelConfig(mContext, PanelType.RECENT_TABS);
+        panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.HISTORY));
 
-        // We disable Synced Tabs for guest mode profiles.
-        final PanelConfig remoteTabsEntry;
+        // We disable Synced Tabs for guest mode / restricted profiles.
         if (RestrictedProfiles.isAllowed(mContext, Restriction.DISALLOW_MODIFY_ACCOUNTS)) {
-            remoteTabsEntry = createBuiltinPanelConfig(mContext, PanelType.REMOTE_TABS);
-        } else {
-            remoteTabsEntry = null;
+            panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.REMOTE_TABS));
         }
 
-        panelConfigs.add(historyEntry);
-        panelConfigs.add(recentTabsEntry);
-        if (remoteTabsEntry != null) {
-            panelConfigs.add(remoteTabsEntry);
-        }
+        panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.RECENT_TABS));
+        panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.READING_LIST));
 
         return new State(panelConfigs, true);
     }
 
     /**
      * Iterate through the panels to check if they are all disabled.
      */
     private static boolean allPanelsAreDisabled(JSONArray jsonPanels) throws JSONException {
--- a/mobile/android/tests/browser/robocop/components/AboutHomeComponent.java
+++ b/mobile/android/tests/browser/robocop/components/AboutHomeComponent.java
@@ -29,20 +29,20 @@ import com.jayway.android.robotium.solo.
  * A class representing any interactions that take place on the Awesomescreen.
  */
 public class AboutHomeComponent extends BaseComponent {
     private static final String LOGTAG = AboutHomeComponent.class.getSimpleName();
 
     private static final List<PanelType> PANEL_ORDERING = Arrays.asList(
             PanelType.TOP_SITES,
             PanelType.BOOKMARKS,
-            PanelType.READING_LIST,
             PanelType.HISTORY,
+            PanelType.REMOTE_TABS,
             PanelType.RECENT_TABS,
-            PanelType.REMOTE_TABS
+            PanelType.READING_LIST
     );
 
     // The percentage of the panel to swipe between 0 and 1. This value was set through
     // testing: 0.55f was tested on try and fails on armv6 devices.
     private static final float SWIPE_PERCENTAGE = 0.70f;
 
     public AboutHomeComponent(final UITestContext testContext) {
         super(testContext);