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

cc / trees / mobile_optimized_viewport_util.h [blame]

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

#ifndef CC_TREES_MOBILE_OPTIMIZED_VIEWPORT_UTIL_H_
#define CC_TREES_MOBILE_OPTIMIZED_VIEWPORT_UTIL_H_

#include "ui/gfx/geometry/size_f.h"

namespace cc {
namespace util {

// Returns whether the viewport should be considered mobile optimized,
// not needing the double tap to zoom gesture.
// Arguments:
// min_page_scale_factor - the minimum page scale
// max_page_scale_factor - the maximum page scale
// current_page_scale_factor - current page scale
// scrollable_viewport_size - the size of the user-visible scrolling viewport
// in CSS layout coordinates
// scrollable_size - the size of the root scrollable area in CSS layout
// coordinates
// viewport_meta_mobile_optimized - if the viewport meta tag is mobile
// optimized
bool IsMobileOptimized(float min_page_scale_factor,
                       float max_page_scale_factor,
                       float current_page_scale_factor,
                       gfx::SizeF scrollable_viewport_size,
                       gfx::SizeF scrollable_size,
                       bool viewport_meta_mobile_optimized);
}  // namespace util
}  // namespace cc

#endif  // CC_TREES_MOBILE_OPTIMIZED_VIEWPORT_UTIL_H_