diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 22:32:09 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 22:32:09 +0000 |
commit | 0aff351884839884720f9c99c8314ff5f114c521 (patch) | |
tree | d810e10602126f7a9dc6f2ba7ffe6c6b1b313334 /webkit/glue/plugins | |
parent | 8d64615ba9c394e0b52a9e6e727a2f5c8203726a (diff) | |
download | chromium_src-0aff351884839884720f9c99c8314ff5f114c521.zip chromium_src-0aff351884839884720f9c99c8314ff5f114c521.tar.gz chromium_src-0aff351884839884720f9c99c8314ff5f114c521.tar.bz2 |
Use a tooltip for the plugin name. Really useful for click-to-play when the
plugin rectangle is small.
BUG=49832
TEST=NONE
Review URL: http://codereview.chromium.org/5378001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/webview_plugin.cc | 11 | ||||
-rw-r--r-- | webkit/glue/plugins/webview_plugin.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/glue/plugins/webview_plugin.cc index feb5720..31403fe 100644 --- a/webkit/glue/plugins/webview_plugin.cc +++ b/webkit/glue/plugins/webview_plugin.cc @@ -7,6 +7,7 @@ #include "base/message_loop.h" #include "base/metrics/histogram.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" +#include "third_party/WebKit/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" @@ -86,6 +87,8 @@ void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) { bool WebViewPlugin::initialize(WebPluginContainer* container) { container_ = container; + if (container_) + old_title_ = container_->element().getAttribute("title"); return true; } @@ -94,6 +97,8 @@ void WebViewPlugin::destroy() { delegate_->WillDestroyPlugin(); delegate_ = NULL; } + if (container_) + container_->element().setAttribute("title", old_title_); container_ = NULL; MessageLoop::current()->DeleteSoon(FROM_HERE, this); } @@ -163,6 +168,12 @@ void WebViewPlugin::didFailLoading(const WebURLError& error) { error_.reset(new WebURLError(error)); } +void WebViewPlugin::setToolTipText(const WebKit::WebString& text, + WebKit::WebTextDirection hint) { + if (container_) + container_->element().setAttribute("title", text); +} + void WebViewPlugin::startDragging(const WebDragData&, WebDragOperationsMask, const WebImage&, diff --git a/webkit/glue/plugins/webview_plugin.h b/webkit/glue/plugins/webview_plugin.h index 9695aa2..95f32a5 100644 --- a/webkit/glue/plugins/webview_plugin.h +++ b/webkit/glue/plugins/webview_plugin.h @@ -12,6 +12,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" +#include "third_party/WebKit/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" @@ -93,6 +95,9 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, // WebViewClient methods: virtual bool acceptsLoadDrops() { return false; } + virtual void setToolTipText(const WebKit::WebString&, + WebKit::WebTextDirection); + virtual void startDragging(const WebKit::WebDragData& drag_data, WebKit::WebDragOperationsMask mask, const WebKit::WebImage& image, @@ -125,6 +130,7 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, std::list<std::string> data_; bool finished_loading_; scoped_ptr<WebKit::WebURLError> error_; + WebKit::WebString old_title_; }; #endif // WEBKIT_GLUE_PLUGINS_WEBVIEW_PLUGIN_H_ |