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 aaaa3fc551
commit 7e36d3f8d7

View File

@ -449,7 +449,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) {
@ -466,6 +466,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);
}
@ -476,6 +477,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;
}
});
}