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

Commit e16cd540 authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang Committed by Android (Google) Code Review
Browse files

Merge "Use fixed viewport for all devices in wide viewport mode."

parents 395d6a29 99415605
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -183,7 +183,6 @@ public class WebSettings {
    private boolean         mJavaScriptCanOpenWindowsAutomatically = false;
    private boolean         mUseDoubleTree = false;
    private boolean         mUseWideViewport = false;
    private boolean         mUseFixedViewport = false;
    private boolean         mSupportMultipleWindows = false;
    private boolean         mShrinksStandaloneImagesToFit = false;
    private long            mMaximumDecodedImageSize = 0; // 0 means default
@@ -383,13 +382,6 @@ public class WebSettings {
        mDefaultTextEncoding = context.getString(com.android.internal.
                                                 R.string.default_text_encoding);

        // Detect tablet device for fixed viewport mode.
        final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        final int landscapeWidth = Math.max(metrics.widthPixels, metrics.heightPixels);
        final int minTabletWidth = context.getResources().getDimensionPixelSize(
            com.android.internal.R.dimen.min_xlarge_screen_width);
        mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= minTabletWidth);

        if (sLockForLocaleSettings == null) {
            sLockForLocaleSettings = new Object();
            sLocale = Locale.getDefault();
@@ -1652,11 +1644,11 @@ public class WebSettings {
    }

    /**
     * Returns whether to use fixed viewport.  Fixed viewport should operate only
     * when wide viewport is on.
     * Returns whether to use fixed viewport.  Use fixed viewport
     * whenever wide viewport is on.
     */
    /* package */ boolean getUseFixedViewport() {
        return getUseWideViewPort() && mUseFixedViewport;
        return getUseWideViewPort();
    }

    /**