Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: webkit/glue/plugins/pepper_plugin_instance.cc

Issue 2900012: Hookup pepper v2 zoom interface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_instance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_plugin_instance.cc
===================================================================
--- webkit/glue/plugins/pepper_plugin_instance.cc (revision 52332)
+++ webkit/glue/plugins/pepper_plugin_instance.cc (working copy)
@@ -17,6 +17,7 @@
#include "third_party/ppapi/c/ppb_instance.h"
#include "third_party/ppapi/c/ppp_find.h"
#include "third_party/ppapi/c/ppp_instance.h"
+#include "third_party/ppapi/c/ppp_zoom.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
@@ -200,7 +201,8 @@
container_(NULL),
full_frame_(false),
find_identifier_(-1),
- plugin_find_interface_(NULL) {
+ plugin_find_interface_(NULL),
+ plugin_zoom_interface_(NULL) {
DCHECK(delegate);
module_->InstanceCreated(this);
delegate_->InstanceCreated(this);
@@ -381,7 +383,9 @@
}
void PluginInstance::Zoom(float factor, bool text_only) {
- // TODO: implement me
+ if (!LoadZoomInterface())
+ return;
+ plugin_zoom_interface_->Zoom(GetPPInstance(), factor, text_only);
}
bool PluginInstance::StartFind(const string16& search_text,
@@ -418,4 +422,14 @@
return !!plugin_find_interface_;
}
+bool PluginInstance::LoadZoomInterface() {
+ if (!plugin_zoom_interface_) {
+ plugin_zoom_interface_ =
+ reinterpret_cast<const PPP_Zoom*>(module_->GetPluginInterface(
+ PPP_ZOOM_INTERFACE));
+ }
+
+ return !!plugin_zoom_interface_;
+}
+
} // namespace pepper
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698