Chromium Code Reviews| Index: content/public/common/page_zoom.h |
| =================================================================== |
| --- content/public/common/page_zoom.h (revision 109526) |
| +++ content/public/common/page_zoom.h (working copy) |
| @@ -6,7 +6,10 @@ |
| #define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
| #pragma once |
| +#include <vector> |
| + |
| #include "base/basictypes.h" |
| +#include "content/common/content_export.h" |
| namespace content { |
| @@ -18,6 +21,41 @@ |
| PAGE_ZOOM_IN = 1, |
| }; |
| +// The minimum zoom factor permitted for a page. This is an alternative to |
| +// WebView::minTextSizeMultiplier. |
| +CONTENT_EXPORT extern const double kMinimumZoomFactor; |
| + |
| +// The maximum zoom factor permitted for a page. This is an alternative to |
| +// WebView::maxTextSizeMultiplier. |
| +CONTENT_EXPORT extern const double kMaximumZoomFactor; |
| + |
| +// This class holds helper methods for the page zoom feature. |
| +class CONTENT_EXPORT PageZoomHelpers { |
|
James Hawkins
2011/11/15 18:35:51
Consider using a named namespace instead of a clas
csilv
2011/11/19 00:17:45
I addressed this by getting rid of the class (and
|
| + public: |
| + // Return a sorted vector of zoom factors. The vector will consist of preset |
| + // values along with a custom value (if the custom value is not already |
| + // represented.) |
| + static std::vector<double> PresetFactorsWithCustomValue(double custom_factor); |
| + |
| + // Return a sorted vector of zoom levels. The vector will consist of preset |
| + // values along with a custom value (if the custom value is not already |
| + // represented.) |
| + static std::vector<double> PresetLevelsWithCustomValue(double custom_level); |
| + |
| + // Test if two zoom values (either zoom factors or zoom levels) should be |
| + // considered equal. |
| + static bool ZoomValuesEqual(double value_a, double value_b); |
| + |
| + private: |
| + enum PageZoomValueType { |
| + PAGE_ZOOM_VALUE_TYPE_FACTOR, |
| + PAGE_ZOOM_VALUE_TYPE_LEVEL, |
| + }; |
| + |
| + static std::vector<double> PresetValuesWithCustomValue( |
| + PageZoomValueType value_type, double custom_value); |
| +}; |
| + |
| } // namespace content |
| #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |