diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 08:26:49 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 08:26:49 +0000 |
commit | 24a7f3c1308fd32d8620f5bd412ede8f84da9794 (patch) | |
tree | 6102a956d92d49466394a9cac1960bef2af87fca /webkit/glue | |
parent | 64c8ec0d7073939d6be8e5a23bc926078d23193c (diff) | |
download | chromium_src-24a7f3c1308fd32d8620f5bd412ede8f84da9794.zip chromium_src-24a7f3c1308fd32d8620f5bd412ede8f84da9794.tar.gz chromium_src-24a7f3c1308fd32d8620f5bd412ede8f84da9794.tar.bz2 |
Chrome side of adding search support to Pepper.
Review URL: http://codereview.chromium.org/1075011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/npapi_extension_thunk.cc | 22 | ||||
-rw-r--r-- | webkit/glue/webplugin_delegate.h | 10 |
2 files changed, 29 insertions, 3 deletions
diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/glue/plugins/npapi_extension_thunk.cc index 1ffecfc..d653b35 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.cc +++ b/webkit/glue/plugins/npapi_extension_thunk.cc @@ -414,17 +414,33 @@ static void CopyTextToClipboard(NPP id, const char* content) { scw.WriteText(UTF8ToUTF16(content)); } +static void NumberOfFindResultsChanged(NPP id, int total, bool final_result) { + scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + if (plugin) { + plugin->webplugin()->delegate()->NumberOfFindResultsChanged( + total, final_result); + } +} + +static void SelectedFindResultChanged(NPP id, int index) { + scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + if (plugin) + plugin->webplugin()->delegate()->SelectedFindResultChanged(index); +} + namespace NPAPI { NPError GetPepperExtensionsFunctions(void* value) { - static const NPExtensions kExtensions = { + static const NPNExtensions kExtensions = { &AcquireDevice, &CopyTextToClipboard, + &NumberOfFindResultsChanged, + &SelectedFindResultChanged, }; // Return a pointer to the canonical function table. - NPExtensions* extensions = const_cast<NPExtensions*>(&kExtensions); - NPExtensions** exts = reinterpret_cast<NPExtensions**>(value); + NPNExtensions* extensions = const_cast<NPNExtensions*>(&kExtensions); + NPNExtensions** exts = reinterpret_cast<NPNExtensions**>(value); *exts = extensions; return NPERR_NO_ERROR; } diff --git a/webkit/glue/webplugin_delegate.h b/webkit/glue/webplugin_delegate.h index 343f486..19eee7a 100644 --- a/webkit/glue/webplugin_delegate.h +++ b/webkit/glue/webplugin_delegate.h @@ -138,6 +138,16 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate, // has become seekable. virtual WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id) = 0; + + // See WebPluginContainerImpl's description of the interface. + virtual bool SupportsFind() { return false; } + virtual void StartFind(const std::string& search_text, + bool case_sensitive, + int identifier) {} + virtual void SelectFindResult(bool forward) {} + virtual void StopFind() {} + virtual void NumberOfFindResultsChanged(int total, bool final_result) {} + virtual void SelectedFindResultChanged(int index) {} }; } // namespace webkit_glue |