From 7b889fe92a45ebce932f5cc19632d7e647533fae Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Tue, 14 Feb 2012 17:50:55 +0000 Subject: [PATCH] Bug 723103 - Update about:home's top sites section after history is cleared (r=mfinkle) --- mobile/android/base/ConfirmPreference.java | 1 + mobile/android/base/GeckoApp.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/mobile/android/base/ConfirmPreference.java b/mobile/android/base/ConfirmPreference.java index 2013436917ee..7d5ae4441316 100644 --- a/mobile/android/base/ConfirmPreference.java +++ b/mobile/android/base/ConfirmPreference.java @@ -68,6 +68,7 @@ class ConfirmPreference extends DialogPreference { BrowserDB.clearHistory(mContext.getContentResolver()); GeckoApp.mAppContext.mFavicons.clearFavicons(); GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("browser:purge-session-history", null)); + GeckoApp.mAppContext.handleClearHistory(); } }); } else if ("clear_private_data".equalsIgnoreCase(mAction)) { diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 2afdf282981e..c6e8a58b4799 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -797,6 +797,18 @@ abstract public class GeckoApp }); } + void handleClearHistory() { + if (mAboutHomeContent == null) + return; + + GeckoApp.mAppContext.mMainHandler.post(new Runnable() { + public void run() { + mAboutHomeContent.update(GeckoApp.mAppContext, + EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES)); + } + }); + } + public StartupMode getStartupMode() { // This function might touch the disk and should not // be called from UI's main thread.