LEFT | RIGHT |
1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- | 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- |
2 * This Source Code Form is subject to the terms of the Mozilla Public | 2 * This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 package org.mozilla.gecko.home; | 6 package org.mozilla.gecko.home; |
7 | 7 |
8 import static org.mozilla.gecko.home.HomeConfig.createBuiltinPanelConfig; | 8 import static org.mozilla.gecko.home.HomeConfig.createBuiltinPanelConfig; |
9 | 9 |
10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 syncFlags = panelConfig.getFlags(); | 174 syncFlags = panelConfig.getFlags(); |
175 } else if (type == PanelType.COMBINED_HISTORY) { | 175 } else if (type == PanelType.COMBINED_HISTORY) { |
176 // Partial landing of bug 1220928 combined the History and Sync
panels of users who didn't | 176 // Partial landing of bug 1220928 combined the History and Sync
panels of users who didn't |
177 // have home panel customizations (including new users), thus th
ey don't this migration. | 177 // have home panel customizations (including new users), thus th
ey don't this migration. |
178 return jsonPanels; | 178 return jsonPanels; |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 // Since we removed the sync panel, it's expected to not be present at t
his point | 182 // Since we removed the sync panel, it's expected to not be present at t
his point |
183 // See https://issues.adblockplus.org/ticket/5989 | 183 // See https://issues.adblockplus.org/ticket/5989 |
184 if(syncIndex == -1) { | 184 if (syncIndex == -1) { |
185 final PanelConfig newPanel = createBuiltinPanelConfig(context, Panel
Type.COMBINED_HISTORY, historyFlags); | 185 final PanelConfig newPanel = createBuiltinPanelConfig(context, Panel
Type.COMBINED_HISTORY, historyFlags); |
186 jsonPanels.put(historyIndex, newPanel.toJSON()); | 186 jsonPanels.put(historyIndex, newPanel.toJSON()); |
187 return jsonPanels; | 187 return jsonPanels; |
188 } | 188 } |
189 | 189 |
190 if (historyIndex == -1 || syncIndex == -1) { | 190 if (historyIndex == -1 || syncIndex == -1) { |
191 throw new IllegalArgumentException("Expected both History and Sync p
anels to be present prior to Combined History."); | 191 throw new IllegalArgumentException("Expected both History and Sync p
anels to be present prior to Combined History."); |
192 } | 192 } |
193 | 193 |
194 PanelConfig newPanel; | 194 PanelConfig newPanel; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 lbm.unregisterReceiver(mReloadBroadcastReceiver); | 662 lbm.unregisterReceiver(mReloadBroadcastReceiver); |
663 } | 663 } |
664 | 664 |
665 private class ReloadBroadcastReceiver extends BroadcastReceiver { | 665 private class ReloadBroadcastReceiver extends BroadcastReceiver { |
666 @Override | 666 @Override |
667 public void onReceive(Context context, Intent intent) { | 667 public void onReceive(Context context, Intent intent) { |
668 mReloadListener.onReload(); | 668 mReloadListener.onReload(); |
669 } | 669 } |
670 } | 670 } |
671 } | 671 } |
LEFT | RIGHT |