Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | |
| 10 | |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "content/common/content_export.h" | |
| 10 | 13 |
| 11 namespace content { | 14 namespace content { |
| 12 | 15 |
| 13 // This enum is the parameter to various text/page zoom commands so we know | 16 // This enum is the parameter to various text/page zoom commands so we know |
| 14 // what the specific zoom command is. | 17 // what the specific zoom command is. |
| 15 enum PageZoom { | 18 enum PageZoom { |
| 16 PAGE_ZOOM_OUT = -1, | 19 PAGE_ZOOM_OUT = -1, |
| 17 PAGE_ZOOM_RESET = 0, | 20 PAGE_ZOOM_RESET = 0, |
| 18 PAGE_ZOOM_IN = 1, | 21 PAGE_ZOOM_IN = 1, |
| 19 }; | 22 }; |
| 20 | 23 |
| 24 // The minimum zoom factor permitted for a page. This is an alternative to | |
| 25 // WebView::minTextSizeMultiplier. | |
| 26 CONTENT_EXPORT extern const double kMinimumZoomFactor; | |
| 27 | |
| 28 // The maximum zoom factor permitted for a page. This is an alternative to | |
| 29 // WebView::maxTextSizeMultiplier. | |
| 30 CONTENT_EXPORT extern const double kMaximumZoomFactor; | |
| 31 | |
| 32 // This class holds helper methods for the page zoom feature. | |
| 33 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
| |
| 34 public: | |
| 35 // Return a sorted vector of zoom factors. The vector will consist of preset | |
| 36 // values along with a custom value (if the custom value is not already | |
| 37 // represented.) | |
| 38 static std::vector<double> PresetFactorsWithCustomValue(double custom_factor); | |
| 39 | |
| 40 // Return a sorted vector of zoom levels. The vector will consist of preset | |
| 41 // values along with a custom value (if the custom value is not already | |
| 42 // represented.) | |
| 43 static std::vector<double> PresetLevelsWithCustomValue(double custom_level); | |
| 44 | |
| 45 // Test if two zoom values (either zoom factors or zoom levels) should be | |
| 46 // considered equal. | |
| 47 static bool ZoomValuesEqual(double value_a, double value_b); | |
| 48 | |
| 49 private: | |
| 50 enum PageZoomValueType { | |
| 51 PAGE_ZOOM_VALUE_TYPE_FACTOR, | |
| 52 PAGE_ZOOM_VALUE_TYPE_LEVEL, | |
| 53 }; | |
| 54 | |
| 55 static std::vector<double> PresetValuesWithCustomValue( | |
| 56 PageZoomValueType value_type, double custom_value); | |
| 57 }; | |
| 58 | |
| 21 } // namespace content | 59 } // namespace content |
| 22 | 60 |
| 23 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ | 61 #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |
| OLD | NEW |