summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/webview_plugin.cc11
-rw-r--r--webkit/glue/plugins/webview_plugin.h6
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_