1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "content/public/common/page_zoom.h"
11 const double kMinimumZoomFactor
= 0.25;
12 const double kMaximumZoomFactor
= 5.0;
13 const double kEpsilon
= 0.001;
14 const double kTextSizeMultiplierRatio
= 1.2;
16 bool ZoomValuesEqual(double value_a
, double value_b
) {
17 return (std::fabs(value_a
- value_b
) <= kEpsilon
);
20 double ZoomLevelToZoomFactor(double zoom_level
) {
21 return std::pow(kTextSizeMultiplierRatio
, zoom_level
);
24 double ZoomFactorToZoomLevel(double factor
) {
25 return std::log(factor
) / std::log(kTextSizeMultiplierRatio
);
28 } // namespace content