OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
6 #define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ | 6 #define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // This enum is the parameter to various text/page zoom commands so we know | 13 // This enum is the parameter to various text/page zoom commands so we know |
14 // what the specific zoom command is. | 14 // what the specific zoom command is. |
15 enum PageZoom { | 15 enum PageZoom { |
16 PAGE_ZOOM_OUT = -1, | 16 PAGE_ZOOM_OUT = -1, |
17 PAGE_ZOOM_RESET = 0, | 17 PAGE_ZOOM_RESET = 0, |
18 PAGE_ZOOM_IN = 1, | 18 PAGE_ZOOM_IN = 1, |
19 }; | 19 }; |
20 | 20 |
21 // The minimum zoom factor permitted for a page. This is an alternative to | 21 // The minimum zoom factor permitted for a page. This is an alternative to |
22 // WebView::minTextSizeMultiplier. | 22 // WebView::minTextSizeMultiplier. |
23 CONTENT_EXPORT extern const double kMinimumZoomFactor; | 23 CONTENT_EXPORT extern const double kMinimumZoomFactor; |
24 | 24 |
25 // The maximum zoom factor permitted for a page. This is an alternative to | 25 // The maximum zoom factor permitted for a page. This is an alternative to |
26 // WebView::maxTextSizeMultiplier. | 26 // WebView::maxTextSizeMultiplier. |
27 CONTENT_EXPORT extern const double kMaximumZoomFactor; | 27 CONTENT_EXPORT extern const double kMaximumZoomFactor; |
28 | 28 |
| 29 // Epsilon value for comparing two floating-point zoom values. We don't use |
| 30 // std::numeric_limits<> because it is too precise for zoom values. Zoom |
| 31 // values lose precision due to factor/level conversions. A value of 0.001 |
| 32 // is precise enough for zoom value comparisons. |
| 33 CONTENT_EXPORT extern const double kEpsilon; |
| 34 |
29 // Test if two zoom values (either zoom factors or zoom levels) should be | 35 // Test if two zoom values (either zoom factors or zoom levels) should be |
30 // considered equal. | 36 // considered equal. |
31 CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b); | 37 CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b); |
32 | 38 |
33 } // namespace content | 39 } // namespace content |
34 | 40 |
35 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ | 41 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
OLD | NEW |