Bug 824132: Persona sends a Reset message on start. [r=mfinkle]

--HG--
extra : rebase_source : e8e47801fbc3f4ec55e6d7637e4586a587cdda16
This commit is contained in:
Sriram Ramasubramanian 2012-12-26 11:10:14 -08:00
parent a8b5158916
commit 2fea3c89ff

View File

@ -113,18 +113,20 @@ public class LightweightTheme implements GeckoEventListener {
} }
public void resetLightweightTheme() { public void resetLightweightTheme() {
// Reset the bitmap. if (mBitmap != null) {
mBitmap = null; // Reset the bitmap.
mBitmap = null;
// Post the reset on the UI thread. // Post the reset on the UI thread.
for (OnChangeListener listener : mListeners) { for (OnChangeListener listener : mListeners) {
final OnChangeListener oneListener = listener; final OnChangeListener oneListener = listener;
oneListener.post(new Runnable() { oneListener.post(new Runnable() {
@Override @Override
public void run() { public void run() {
oneListener.onLightweightThemeReset(); oneListener.onLightweightThemeReset();
} }
}); });
}
} }
} }
@ -162,6 +164,21 @@ public class LightweightTheme implements GeckoEventListener {
} }
} }
/**
* A lightweight theme is enabled only if there is an active bitmap.
*
* @return True if the theme is enabled.
*/
public boolean isEnabled() {
return (mBitmap != null);
}
/**
* Based on the luminance of the domanint color, a theme is classified as light or dark.
*
* @return True if the theme is light.
*/
public boolean isLightTheme() { public boolean isLightTheme() {
return mIsLight; return mIsLight;
} }