diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 08:01:23 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 08:01:23 +0000 |
commit | afdbd149a0c64d20e560ff1b57158106d179a513 (patch) | |
tree | 66c5481d49e5b6f857b4c12b437e0c683fcc0e0a /webkit | |
parent | d9ad4f82602c8fef9de36c6988e6fd7f2a3fdd2c (diff) | |
download | chromium_src-afdbd149a0c64d20e560ff1b57158106d179a513.zip chromium_src-afdbd149a0c64d20e560ff1b57158106d179a513.tar.gz chromium_src-afdbd149a0c64d20e560ff1b57158106d179a513.tar.bz2 |
Chrome side of removing WebPlugin::supportsFind.
Review URL: http://codereview.chromium.org/2898005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_instance.cc | 8 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_instance.h | 3 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_webplugin_impl.cc | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_webplugin_impl.h | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate.h | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_impl.cc | 12 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_impl.h | 6 |
7 files changed, 37 insertions, 14 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_instance.cc b/webkit/glue/plugins/pepper_plugin_instance.cc index 7238ae9..ca284c7 100644 --- a/webkit/glue/plugins/pepper_plugin_instance.cc +++ b/webkit/glue/plugins/pepper_plugin_instance.cc @@ -348,15 +348,11 @@ void PluginInstance::Zoom(float factor, bool text_only) { // TODO: implement me } -bool PluginInstance::SupportsFind() { - // TODO: implement me - return false; -} - -void PluginInstance::StartFind(const string16& search_text, +bool PluginInstance::StartFind(const string16& search_text, bool case_sensitive, int identifier) { find_identifier_ = identifier; + return false; // TODO: implement me } diff --git a/webkit/glue/plugins/pepper_plugin_instance.h b/webkit/glue/plugins/pepper_plugin_instance.h index f24fa05..0f836f0 100644 --- a/webkit/glue/plugins/pepper_plugin_instance.h +++ b/webkit/glue/plugins/pepper_plugin_instance.h @@ -101,8 +101,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { string16 GetSelectedText(bool html); void Zoom(float factor, bool text_only); - bool SupportsFind(); - void StartFind(const string16& search_text, + bool StartFind(const string16& search_text, bool case_sensitive, int identifier); void SelectFindResult(bool forward); diff --git a/webkit/glue/plugins/pepper_webplugin_impl.cc b/webkit/glue/plugins/pepper_webplugin_impl.cc index c2cae30..ec34683 100644 --- a/webkit/glue/plugins/pepper_webplugin_impl.cc +++ b/webkit/glue/plugins/pepper_webplugin_impl.cc @@ -161,8 +161,15 @@ void WebPluginImpl::setZoomFactor(float scale, bool text_only) { instance_->Zoom(scale, text_only); } +#if defined(WEBPLUGIN_FIND_HAS_RETURN_TYPE) +bool WebPluginImpl::startFind(const WebKit::WebString& search_text, + bool case_sensitive, + int identifier) { + return instance_->StartFind(search_text, case_sensitive, identifier); +} +#else bool WebPluginImpl::supportsFind() { - return instance_->SupportsFind(); + return true; } void WebPluginImpl::startFind(const WebString& search_text, @@ -170,6 +177,7 @@ void WebPluginImpl::startFind(const WebString& search_text, int identifier) { instance_->StartFind(search_text, case_sensitive, identifier); } +#endif void WebPluginImpl::selectFindResult(bool forward) { instance_->SelectFindResult(forward); diff --git a/webkit/glue/plugins/pepper_webplugin_impl.h b/webkit/glue/plugins/pepper_webplugin_impl.h index 0b1827d..e3b16b8 100644 --- a/webkit/glue/plugins/pepper_webplugin_impl.h +++ b/webkit/glue/plugins/pepper_webplugin_impl.h @@ -64,10 +64,16 @@ class WebPluginImpl : public WebKit::WebPlugin { virtual WebKit::WebString selectionAsText() const; virtual WebKit::WebString selectionAsMarkup() const; virtual void setZoomFactor(float scale, bool text_only); +#if defined(WEBPLUGIN_FIND_HAS_RETURN_TYPE) + virtual bool startFind(const WebKit::WebString& search_text, + bool case_sensitive, + int identifier); +#else virtual bool supportsFind(); virtual void startFind(const WebKit::WebString& search_text, bool case_sensitive, int identifier); +#endif virtual void selectFindResult(bool forward); virtual void stopFind(); diff --git a/webkit/glue/plugins/webplugin_delegate.h b/webkit/glue/plugins/webplugin_delegate.h index 3b04d24..901cdea 100644 --- a/webkit/glue/plugins/webplugin_delegate.h +++ b/webkit/glue/plugins/webplugin_delegate.h @@ -20,7 +20,6 @@ #include "webkit/glue/plugins/webplugin_file_delegate.h" #include "webkit/glue/plugins/webplugin_print_delegate.h" - class FilePath; class GURL; struct NPObject; @@ -142,10 +141,9 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate, 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 string16& search_text, + virtual bool StartFind(const string16& search_text, bool case_sensitive, - int identifier) {} + int identifier) { return false; } virtual void SelectFindResult(bool forward) {} virtual void StopFind() {} virtual void NumberOfFindResultsChanged(int total, bool final_result) {} diff --git a/webkit/glue/plugins/webplugin_impl.cc b/webkit/glue/plugins/webplugin_impl.cc index d7ba1a4..8f45b97 100644 --- a/webkit/glue/plugins/webplugin_impl.cc +++ b/webkit/glue/plugins/webplugin_impl.cc @@ -449,8 +449,17 @@ void WebPluginImpl::setZoomFactor(float scale, bool text_only) { delegate_->SetZoomFactor(scale, text_only); } +#if defined(WEBPLUGIN_FIND_HAS_RETURN_TYPE) +bool WebPluginImpl::startFind(const WebKit::WebString& search_text, + bool case_sensitive, + int identifier) { + if (!delegate_) + return false; + return delegate_->StartFind(search_text, case_sensitive, identifier); +} +#else bool WebPluginImpl::supportsFind() { - return delegate_ && delegate_->SupportsFind(); + return true; } void WebPluginImpl::startFind(const WebString& search_text, @@ -459,6 +468,7 @@ void WebPluginImpl::startFind(const WebString& search_text, if (delegate_) delegate_->StartFind(search_text, case_sensitive, identifier); } +#endif void WebPluginImpl::selectFindResult(bool forward) { if (delegate_) diff --git a/webkit/glue/plugins/webplugin_impl.h b/webkit/glue/plugins/webplugin_impl.h index 033dcb3..aed2e08 100644 --- a/webkit/glue/plugins/webplugin_impl.h +++ b/webkit/glue/plugins/webplugin_impl.h @@ -97,10 +97,16 @@ class WebPluginImpl : public WebPlugin, virtual WebKit::WebString selectionAsText() const; virtual WebKit::WebString selectionAsMarkup() const; virtual void setZoomFactor(float scale, bool text_only); +#if defined(WEBPLUGIN_FIND_HAS_RETURN_TYPE) + virtual bool startFind(const WebKit::WebString& search_text, + bool case_sensitive, + int identifier); +#else virtual bool supportsFind(); virtual void startFind(const WebKit::WebString& search_text, bool case_sensitive, int identifier); +#endif virtual void selectFindResult(bool forward); virtual void stopFind(); |