1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
6 #define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
8 #include "content/common/content_export.h"
12 // This enum is the parameter to various text/page zoom commands so we know
13 // what the specific zoom command is.
20 // The minimum zoom factor permitted for a page. This is an alternative to
21 // WebView::minTextSizeMultiplier.
22 CONTENT_EXPORT
extern const double kMinimumZoomFactor
;
24 // The maximum zoom factor permitted for a page. This is an alternative to
25 // WebView::maxTextSizeMultiplier.
26 CONTENT_EXPORT
extern const double kMaximumZoomFactor
;
28 // Epsilon value for comparing two floating-point zoom values. We don't use
29 // std::numeric_limits<> because it is too precise for zoom values. Zoom
30 // values lose precision due to factor/level conversions. A value of 0.001
31 // is precise enough for zoom value comparisons.
32 CONTENT_EXPORT
extern const double kEpsilon
;
34 // Test if two zoom values (either zoom factors or zoom levels) should be
36 CONTENT_EXPORT
bool ZoomValuesEqual(double value_a
, double value_b
);
38 // Converts between zoom factors and levels.
39 CONTENT_EXPORT
double ZoomLevelToZoomFactor(double zoom_level
);
40 CONTENT_EXPORT
double ZoomFactorToZoomLevel(double factor
);
42 } // namespace content
44 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_