am 19fa6d45: am 738a0460: Merge "Don\'t inflate the zoom button controller until we are going to show it. This should shave 5% of Browser start up time on Sapphire." into froyo
Merge commit '19fa6d4586df8ff7897fcc73b2228b431502d58e' into kraken * commit '19fa6d4586df8ff7897fcc73b2228b431502d58e': Don't inflate the zoom button controller until we
This commit is contained in:
@@ -874,18 +874,18 @@ public class WebView extends AbsoluteLayout
|
||||
}
|
||||
|
||||
private void updateZoomButtonsEnabled() {
|
||||
if (mZoomButtonsController == null) return;
|
||||
boolean canZoomIn = mActualScale < mMaxZoomScale;
|
||||
boolean canZoomOut = mActualScale > mMinZoomScale && !mInZoomOverview;
|
||||
ZoomButtonsController controller = getZoomButtonsController();
|
||||
if (!canZoomIn && !canZoomOut) {
|
||||
// Hide the zoom in and out buttons, as well as the fit to page
|
||||
// button, if the page cannot zoom
|
||||
controller.getZoomControls().setVisibility(View.GONE);
|
||||
mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
|
||||
} else {
|
||||
// Set each one individually, as a page may be able to zoom in
|
||||
// or out.
|
||||
controller.setZoomInEnabled(canZoomIn);
|
||||
controller.setZoomOutEnabled(canZoomOut);
|
||||
mZoomButtonsController.setZoomInEnabled(canZoomIn);
|
||||
mZoomButtonsController.setZoomOutEnabled(canZoomOut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4013,7 +4013,8 @@ public class WebView extends AbsoluteLayout
|
||||
}
|
||||
} else {
|
||||
if (mWebViewCore != null && getSettings().getBuiltInZoomControls()
|
||||
&& !getZoomButtonsController().isVisible()) {
|
||||
&& (mZoomButtonsController == null ||
|
||||
!mZoomButtonsController.isVisible())) {
|
||||
/*
|
||||
* The zoom controls come in their own window, so our window
|
||||
* loses focus. Our policy is to not draw the cursor ring if
|
||||
@@ -5842,7 +5843,7 @@ public class WebView extends AbsoluteLayout
|
||||
}
|
||||
WebSettings settings = getSettings();
|
||||
if (settings.getBuiltInZoomControls()) {
|
||||
if (getZoomButtonsController().isVisible()) {
|
||||
if (mZoomButtonsController != null) {
|
||||
mZoomButtonsController.setVisible(false);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user