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() {
// Reset the bitmap.
mBitmap = null;
if (mBitmap != null) {
// Reset the bitmap.
mBitmap = null;
// Post the reset on the UI thread.
for (OnChangeListener listener : mListeners) {
final OnChangeListener oneListener = listener;
oneListener.post(new Runnable() {
@Override
public void run() {
oneListener.onLightweightThemeReset();
}
});
// Post the reset on the UI thread.
for (OnChangeListener listener : mListeners) {
final OnChangeListener oneListener = listener;
oneListener.post(new Runnable() {
@Override
public void run() {
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() {
return mIsLight;
}