diff options
| author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 07:28:25 +0000 |
|---|---|---|
| committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 07:28:25 +0000 |
| commit | b75b829359b4b432d0462ab5011542f99f2021a5 (patch) | |
| tree | 564389d8698b140e97918a4cefd7ad18c7c99e7f /webkit/glue/plugins/pepper_webplugin_impl.cc | |
| parent | 3ec5d92cbba6b7b13ead81ebfd9e3c202fae001d (diff) | |
| download | chromium_src-b75b829359b4b432d0462ab5011542f99f2021a5.zip chromium_src-b75b829359b4b432d0462ab5011542f99f2021a5.tar.gz chromium_src-b75b829359b4b432d0462ab5011542f99f2021a5.tar.bz2 | |
Chrome side of consolidating zoom code for pepper plugins (i.e. pdf) and the rest of Chrome. Allows plugins to have different zoom ranges, and also to update zoom on its own.
Review URL: http://codereview.chromium.org/3419023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/pepper_webplugin_impl.cc')
| -rw-r--r-- | webkit/glue/plugins/pepper_webplugin_impl.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webkit/glue/plugins/pepper_webplugin_impl.cc b/webkit/glue/plugins/pepper_webplugin_impl.cc index 32903b0..0cea7219 100644 --- a/webkit/glue/plugins/pepper_webplugin_impl.cc +++ b/webkit/glue/plugins/pepper_webplugin_impl.cc @@ -4,10 +4,13 @@ #include "webkit/glue/plugins/pepper_webplugin_impl.h" +#include <cmath> + #include "base/message_loop.h" #include "third_party/ppapi/c/pp_var.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" +#include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_plugin_module.h" #include "webkit/glue/plugins/pepper_url_loader.h" @@ -19,6 +22,7 @@ using WebKit::WebPluginParams; using WebKit::WebRect; using WebKit::WebString; using WebKit::WebVector; +using WebKit::WebView; namespace pepper { @@ -165,8 +169,14 @@ WebKit::WebString WebPluginImpl::selectionAsMarkup() const { return instance_->GetSelectedText(true); } -void WebPluginImpl::setZoomFactor(float scale, bool text_only) { - instance_->Zoom(scale, text_only); +void WebPluginImpl::setZoomLevel(double level, bool text_only) { +#ifdef ZOOM_LEVEL_IS_DOUBLE + double factor = WebView::zoomLevelToZoomFactor(level); +#else + double factor = std::pow(1.2, level); +#endif + + instance_->Zoom(factor, text_only); } bool WebPluginImpl::startFind(const WebKit::WebString& search_text, |
