summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 00:32:41 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 00:32:41 +0000
commit88045c8d05982c298bfb3dac96d841af33230130 (patch)
tree0222e6b3db8b5e5baca615284d14b6a7cb7e178e /webkit
parent410caed3335c728c02133a37a629b58f0b6c8286 (diff)
downloadchromium_src-88045c8d05982c298bfb3dac96d841af33230130.zip
chromium_src-88045c8d05982c298bfb3dac96d841af33230130.tar.gz
chromium_src-88045c8d05982c298bfb3dac96d841af33230130.tar.bz2
Remove GetSelectedText from Instance interface.
BUG=57492 Review URL: http://codereview.chromium.org/3673005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/pepper_plugin_instance.cc39
-rw-r--r--webkit/glue/plugins/pepper_plugin_instance.h9
2 files changed, 33 insertions, 15 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_instance.cc b/webkit/glue/plugins/pepper_plugin_instance.cc
index fb251e0..c051fff 100644
--- a/webkit/glue/plugins/pepper_plugin_instance.cc
+++ b/webkit/glue/plugins/pepper_plugin_instance.cc
@@ -26,6 +26,7 @@
#include "third_party/ppapi/c/dev/ppb_fullscreen_dev.h"
#include "third_party/ppapi/c/dev/ppb_zoom_dev.h"
#include "third_party/ppapi/c/dev/ppp_find_dev.h"
+#include "third_party/ppapi/c/dev/ppp_selection_dev.h"
#include "third_party/ppapi/c/dev/ppp_zoom_dev.h"
#include "third_party/ppapi/c/pp_input_event.h"
#include "third_party/ppapi/c/pp_instance.h"
@@ -274,8 +275,9 @@ PluginInstance::PluginInstance(PluginDelegate* delegate,
has_content_area_focus_(false),
find_identifier_(-1),
plugin_find_interface_(NULL),
- plugin_zoom_interface_(NULL),
plugin_private_interface_(NULL),
+ plugin_selection_interface_(NULL),
+ plugin_zoom_interface_(NULL),
#if defined (OS_LINUX)
num_pages_(0),
pdf_output_done_(false),
@@ -577,7 +579,10 @@ bool PluginInstance::GetBitmapForOptimizedPluginPaint(
}
string16 PluginInstance::GetSelectedText(bool html) {
- PP_Var rv = instance_interface_->GetSelectedText(pp_instance(), html);
+ if (!LoadSelectionInterface())
+ return string16();
+
+ PP_Var rv = plugin_selection_interface_->GetSelectedText(pp_instance(), html);
scoped_refptr<StringVar> string(StringVar::FromPPVar(rv));
Var::PluginReleasePPVar(rv); // Release the ref the plugin transfered to us.
if (!string)
@@ -640,16 +645,6 @@ bool PluginInstance::LoadFindInterface() {
return !!plugin_find_interface_;
}
-bool PluginInstance::LoadZoomInterface() {
- if (!plugin_zoom_interface_) {
- plugin_zoom_interface_ =
- reinterpret_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface(
- PPP_ZOOM_DEV_INTERFACE));
- }
-
- return !!plugin_zoom_interface_;
-}
-
bool PluginInstance::LoadPrivateInterface() {
if (!plugin_private_interface_) {
plugin_private_interface_ =
@@ -660,6 +655,26 @@ bool PluginInstance::LoadPrivateInterface() {
return !!plugin_private_interface_;
}
+bool PluginInstance::LoadSelectionInterface() {
+ if (!plugin_selection_interface_) {
+ plugin_selection_interface_ =
+ reinterpret_cast<const PPP_Selection_Dev*>(module_->GetPluginInterface(
+ PPP_SELECTION_DEV_INTERFACE));
+ }
+
+ return !!plugin_selection_interface_;
+}
+
+bool PluginInstance::LoadZoomInterface() {
+ if (!plugin_zoom_interface_) {
+ plugin_zoom_interface_ =
+ reinterpret_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface(
+ PPP_ZOOM_DEV_INTERFACE));
+ }
+
+ return !!plugin_zoom_interface_;
+}
+
bool PluginInstance::PluginHasFocus() const {
return has_webkit_focus_ && has_content_area_focus_;
}
diff --git a/webkit/glue/plugins/pepper_plugin_instance.h b/webkit/glue/plugins/pepper_plugin_instance.h
index 197d944..e0cc25d 100644
--- a/webkit/glue/plugins/pepper_plugin_instance.h
+++ b/webkit/glue/plugins/pepper_plugin_instance.h
@@ -29,6 +29,7 @@ struct PPB_Zoom_Dev;
struct PPP_Find_Dev;
struct PPP_Instance;
struct PPP_Private;
+struct PPP_Selection_Dev;
struct PPP_Zoom_Dev;
class SkBitmap;
@@ -161,8 +162,9 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
private:
bool LoadFindInterface();
- bool LoadZoomInterface();
bool LoadPrivateInterface();
+ bool LoadSelectionInterface();
+ bool LoadZoomInterface();
// Determines if we think the plugin has focus, both content area and webkit
// (see has_webkit_focus_ below).
@@ -221,10 +223,11 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
// The id of the current find operation, or -1 if none is in process.
int find_identifier_;
- // The plugin find and zoom interfaces.
+ // The plugin-provided interfaces.
const PPP_Find_Dev* plugin_find_interface_;
- const PPP_Zoom_Dev* plugin_zoom_interface_;
const PPP_Private* plugin_private_interface_;
+ const PPP_Selection_Dev* plugin_selection_interface_;
+ const PPP_Zoom_Dev* plugin_zoom_interface_;
// This is only valid between a successful PrintBegin call and a PrintEnd
// call.