| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 // This enum is the parameter to various text/page zoom commands so we know | 12 // This enum is the parameter to various text/page zoom commands so we know |
| 13 // what the specific zoom command is. | 13 // what the specific zoom command is. |
| 14 enum PageZoom { | 14 enum PageZoom { |
| 15 PAGE_ZOOM_OUT = -1, | 15 PAGE_ZOOM_OUT = -1, |
| 16 PAGE_ZOOM_RESET = 0, | 16 PAGE_ZOOM_RESET = 0, |
| 17 PAGE_ZOOM_IN = 1, | 17 PAGE_ZOOM_IN = 1, |
| 18 PAGE_ZOOM_LAST = PAGE_ZOOM_IN |
| 18 }; | 19 }; |
| 19 | 20 |
| 20 // 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 |
| 21 // WebView::minTextSizeMultiplier. | 22 // WebView::minTextSizeMultiplier. |
| 22 CONTENT_EXPORT extern const double kMinimumZoomFactor; | 23 CONTENT_EXPORT extern const double kMinimumZoomFactor; |
| 23 | 24 |
| 24 // 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 |
| 25 // WebView::maxTextSizeMultiplier. | 26 // WebView::maxTextSizeMultiplier. |
| 26 CONTENT_EXPORT extern const double kMaximumZoomFactor; | 27 CONTENT_EXPORT extern const double kMaximumZoomFactor; |
| 27 | 28 |
| 28 // Epsilon value for comparing two floating-point zoom values. We don't use | 29 // 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 // 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 // values lose precision due to factor/level conversions. A value of 0.001 |
| 31 // is precise enough for zoom value comparisons. | 32 // is precise enough for zoom value comparisons. |
| 32 CONTENT_EXPORT extern const double kEpsilon; | 33 CONTENT_EXPORT extern const double kEpsilon; |
| 33 | 34 |
| 34 // 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 |
| 35 // considered equal. | 36 // considered equal. |
| 36 CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b); | 37 CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b); |
| 37 | 38 |
| 38 // Converts between zoom factors and levels. | 39 // Converts between zoom factors and levels. |
| 39 CONTENT_EXPORT double ZoomLevelToZoomFactor(double zoom_level); | 40 CONTENT_EXPORT double ZoomLevelToZoomFactor(double zoom_level); |
| 40 CONTENT_EXPORT double ZoomFactorToZoomLevel(double factor); | 41 CONTENT_EXPORT double ZoomFactorToZoomLevel(double factor); |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| 43 | 44 |
| 44 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ | 45 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
| OLD | NEW |