Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20fa839d authored by Grace Kloba's avatar Grace Kloba Committed by Android Git Automerger
Browse files

am 19fa6d45: am 738a0460: Merge "Don\'t inflate the zoom button controller...

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 '19fa6d45' into kraken

* commit '19fa6d45':
  Don't inflate the zoom button controller until we
parents fe13eebe 19fa6d45
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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 {