Bug 846772 - Observe dynamic toolbar pref on Android. r=kats

Respond to this pref changing instantly instead of requiring a restart.
This commit is contained in:
Chris Lord 2013-03-12 18:32:26 +00:00
parent c908455874
commit 34f36a04cf

View File

@ -458,7 +458,7 @@ abstract public class BrowserApp extends GeckoApp
}
}
// Load the dynamic toolbar pref
// Listen to the dynamic toolbar pref
PrefsHelper.getPref(PREF_CHROME_DYNAMICTOOLBAR, new PrefsHelper.PrefHandlerBase() {
@Override
public void prefValue(String pref, boolean value) {
@ -475,6 +475,7 @@ abstract public class BrowserApp extends GeckoApp
} else {
// Immediately show the toolbar when disabling the dynamic
// toolbar.
mAboutHomeContent.setPadding(0, 0, 0, 0);
mBrowserToolbar.cancelVisibilityAnimation();
mBrowserToolbar.getLayout().scrollTo(0, 0);
}
@ -485,6 +486,13 @@ abstract public class BrowserApp extends GeckoApp
}
});
}
@Override
public boolean isObserver() {
// We want to be notified of changes to be able to switch mode
// without restarting.
return true;
}
});
}