1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77

content / public / android / java / src / org / chromium / content_public / browser / RenderCoordinates.java [blame]

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.content_public.browser;

import org.chromium.content.browser.RenderCoordinatesImpl;

/** Provides dimension/coordinate information of the view rendered by content layer. */
public interface RenderCoordinates {
    /**
     * @return {@link Coord} instance associated with the given {@link WebContents}.
     */
    static RenderCoordinates fromWebContents(WebContents webContents) {
        return RenderCoordinatesImpl.fromWebContents(webContents);
    }

    /**
     * @return Horizontal scroll offset in physical pixels (approx, integer).
     */
    int getScrollXPixInt();

    /**
     * @return Vertical scroll offset in physical pixels (approx, integer).
     */
    int getScrollYPixInt();

    /**
     * @return Approximate width of the content in physical pixels (integer).
     */
    int getContentWidthPixInt();

    /**
     * @return Approximate height of the content in physical pixels (integer).
     */
    int getContentHeightPixInt();

    /**
     * @return Render-reported width of the viewport in physical pixels (approx, integer).
     */
    int getLastFrameViewportWidthPixInt();

    /**
     * @return Render-reported height of the viewport in physical pixels (approx, integer).
     */
    int getLastFrameViewportHeightPixInt();

    /**
     * @return Maximum possible vertical scroll in physical pixels (approx, integer).
     */
    int getMaxVerticalScrollPixInt();

    /**
     * @return Maximum possible horizontal scroll in physical pixels (approx, integer).
     */
    int getMaxHorizontalScrollPixInt();

    /**
     * @return The Physical on-screen Y offset amount below the browser controls.
     */
    int getContentOffsetYPixInt();

    /**
     * @return Current page scale factor (approx, integer).
     */
    int getPageScaleFactorInt();

    /**
     * @return Current page scale factor.
     */
    float getPageScaleFactor();

    /**
     * @return Minimum page scale factor.
     */
    float getMinPageScaleFactor();
}