зеркало из https://github.com/mozilla/gecko-dev.git
Bug 789887 - Avoid creating unnecessary AboutHomeRunnables. r=lucasr
This commit is contained in:
Родитель
92e087e715
Коммит
d887b504a1
|
@ -51,6 +51,7 @@ abstract public class BrowserApp extends GeckoApp
|
|||
|
||||
public static BrowserToolbar mBrowserToolbar;
|
||||
private AboutHomeContent mAboutHomeContent;
|
||||
private boolean mAboutHomeShowing;
|
||||
|
||||
static Vector<MenuItem> sAddonMenuItems = new Vector<MenuItem>();
|
||||
|
||||
|
@ -584,17 +585,25 @@ abstract public class BrowserApp extends GeckoApp
|
|||
mAboutHomeContent.update(EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES));
|
||||
}
|
||||
|
||||
public void showAboutHome() {
|
||||
private void showAboutHome() {
|
||||
if (mAboutHomeShowing)
|
||||
return;
|
||||
|
||||
mAboutHomeShowing = true;
|
||||
Runnable r = new AboutHomeRunnable(true);
|
||||
mMainHandler.postAtFrontOfQueue(r);
|
||||
}
|
||||
|
||||
public void hideAboutHome() {
|
||||
private void hideAboutHome() {
|
||||
if (!mAboutHomeShowing)
|
||||
return;
|
||||
|
||||
mAboutHomeShowing = false;
|
||||
Runnable r = new AboutHomeRunnable(false);
|
||||
mMainHandler.postAtFrontOfQueue(r);
|
||||
}
|
||||
|
||||
public class AboutHomeRunnable implements Runnable {
|
||||
private class AboutHomeRunnable implements Runnable {
|
||||
boolean mShow;
|
||||
AboutHomeRunnable(boolean show) {
|
||||
mShow = show;
|
||||
|
|
Загрузка…
Ссылка в новой задаче