diff options
author | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 02:59:01 +0000 |
---|---|---|
committer | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 02:59:01 +0000 |
commit | 0f083403ad489e6fd3305c540e14ea6c9a460061 (patch) | |
tree | aab6a4a6772cc76c6389aa45c64b4339398365e9 /content/public | |
parent | 8caadebcb838083821519861da751992401ce0fe (diff) | |
download | chromium_src-0f083403ad489e6fd3305c540e14ea6c9a460061.zip chromium_src-0f083403ad489e6fd3305c540e14ea6c9a460061.tar.gz chromium_src-0f083403ad489e6fd3305c540e14ea6c9a460061.tar.bz2 |
Page zoom improvements:
1. Change from using zoom levels to a range of preset zoom factors (percentages). Zoom levels are the values that WebKit uses for page zoom. While zoom levels are simple to implement, they result in undesirable percentages like 57%, 144%, 207%, etc. Changing to zoom factors gives us user-friendly zoom percentages.
2. Increase the range of supported zoom values. A user can now zoom between 25% to 500%.
3. Use an epsilon value when comparing zoom floating point values. The previous version was doing an equality comparison of double values which may not always work as expected.
BUG=71484
TEST=Exercise zoom in/out via the wrench menu; exercise default page zoom setting in options window
Review URL: http://codereview.chromium.org/8528011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r-- | content/public/common/page_zoom.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/content/public/common/page_zoom.h b/content/public/common/page_zoom.h index 956169f..3abe75a 100644 --- a/content/public/common/page_zoom.h +++ b/content/public/common/page_zoom.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,7 +6,7 @@ #define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ #pragma once -#include "base/basictypes.h" +#include "content/common/content_export.h" namespace content { @@ -18,6 +18,18 @@ enum PageZoom { 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; + +// Test if two zoom values (either zoom factors or zoom levels) should be +// considered equal. +CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b); + } // namespace content #endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_ |