Bug 958189 - Rename ListManager to PanelManager. r=liuche

--HG--
rename : mobile/android/base/home/ListManager.java => mobile/android/base/home/PanelManager.java
This commit is contained in:
Margaret Leibovic 2014-01-10 12:57:20 -08:00
parent 3b526ca45c
commit 975b65d9bd
3 changed files with 13 additions and 14 deletions

View File

@ -10,7 +10,6 @@ import org.mozilla.gecko.home.HomeConfig.HomeConfigBackend;
import org.mozilla.gecko.home.HomeConfig.OnChangeListener; import org.mozilla.gecko.home.HomeConfig.OnChangeListener;
import org.mozilla.gecko.home.HomeConfig.PageEntry; import org.mozilla.gecko.home.HomeConfig.PageEntry;
import org.mozilla.gecko.home.HomeConfig.PageType; import org.mozilla.gecko.home.HomeConfig.PageType;
import org.mozilla.gecko.home.ListManager.ListInfo;
import org.mozilla.gecko.util.HardwareUtils; import org.mozilla.gecko.util.HardwareUtils;
import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.ThreadUtils;

View File

@ -21,14 +21,14 @@ import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ListManager implements GeckoEventListener { public class PanelManager implements GeckoEventListener {
private static final String LOGTAG = "GeckoListManager"; private static final String LOGTAG = "GeckoPanelManager";
public class ListInfo { public class PanelInfo {
public final String id; public final String id;
public final String title; public final String title;
public ListInfo(String id, String title) { public PanelInfo(String id, String title) {
this.id = id; this.id = id;
this.title = title; this.title = title;
} }
@ -36,7 +36,7 @@ public class ListManager implements GeckoEventListener {
private final Context mContext; private final Context mContext;
public ListManager(Context context) { public PanelManager(Context context) {
mContext = context; mContext = context;
// Add a listener to handle any new lists that are added after the lists have been loaded. // Add a listener to handle any new lists that are added after the lists have been loaded.
@ -46,10 +46,10 @@ public class ListManager implements GeckoEventListener {
/** /**
* Reads list info from SharedPreferences. Don't call this on the main thread! * Reads list info from SharedPreferences. Don't call this on the main thread!
* *
* @return List<ListInfo> A list of ListInfos for each registered list. * @return List<PanelInfo> A list of PanelInfos for each registered list.
*/ */
public List<ListInfo> getListInfos() { public List<PanelInfo> getPanelInfos() {
final ArrayList<ListInfo> listInfos = new ArrayList<ListInfo>(); final ArrayList<PanelInfo> panelInfos = new ArrayList<PanelInfo>();
// XXX: We need to use PreferenceManager right now because that's what SharedPreferences.jsm uses (see bug 940575) // XXX: We need to use PreferenceManager right now because that's what SharedPreferences.jsm uses (see bug 940575)
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
@ -60,14 +60,14 @@ public class ListManager implements GeckoEventListener {
final JSONArray lists = new JSONArray(prefValue); final JSONArray lists = new JSONArray(prefValue);
for (int i = 0; i < lists.length(); i++) { for (int i = 0; i < lists.length(); i++) {
final JSONObject list = lists.getJSONObject(i); final JSONObject list = lists.getJSONObject(i);
final ListInfo info = new ListInfo(list.getString("id"), list.getString("title")); final PanelInfo info = new PanelInfo(list.getString("id"), list.getString("title"));
listInfos.add(info); panelInfos.add(info);
} }
} catch (JSONException e) { } catch (JSONException e) {
Log.e(LOGTAG, "Exception getting list info", e); Log.e(LOGTAG, "Exception getting list info", e);
} }
} }
return listInfos; return panelInfos;
} }
/** /**
@ -76,7 +76,7 @@ public class ListManager implements GeckoEventListener {
@Override @Override
public void handleMessage(String event, JSONObject message) { public void handleMessage(String event, JSONObject message) {
try { try {
final ListInfo info = new ListInfo(message.getString("id"), message.getString("title")); final PanelInfo info = new PanelInfo(message.getString("id"), message.getString("title"));
// Do something to update the set of list pages. // Do something to update the set of list pages.

View File

@ -222,10 +222,10 @@ gbjar.sources += [
'home/HomePager.java', 'home/HomePager.java',
'home/HomePagerTabStrip.java', 'home/HomePagerTabStrip.java',
'home/LastTabsPage.java', 'home/LastTabsPage.java',
'home/ListManager.java',
'home/ListPage.java', 'home/ListPage.java',
'home/MostRecentPage.java', 'home/MostRecentPage.java',
'home/MultiTypeCursorAdapter.java', 'home/MultiTypeCursorAdapter.java',
'home/PanelManager.java',
'home/PinSiteDialog.java', 'home/PinSiteDialog.java',
'home/ReadingListPage.java', 'home/ReadingListPage.java',
'home/SearchEngine.java', 'home/SearchEngine.java',