summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 21:49:30 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 21:49:30 +0000
commit7c51b0ee951bf8ed70d0ed6506567991c611d070 (patch)
tree0d559aad012f55a540a990143bd1d9264e240319 /chrome/renderer
parent03ce3cd72a2bb330c774f47cea4ad346d5c26cad (diff)
downloadchromium_src-7c51b0ee951bf8ed70d0ed6506567991c611d070.zip
chromium_src-7c51b0ee951bf8ed70d0ed6506567991c611d070.tar.gz
chromium_src-7c51b0ee951bf8ed70d0ed6506567991c611d070.tar.bz2
Start using WebCursorInfo from the WebKit API. WebCursorInfo is a
lightweight struct containing a description of a cursor that the embedder should render. WebCursor still exists. Instead of WebCursor initializing from a PlatformCursor, it now initializes from a WebCursorInfo. TEST=none BUG=10039 R=jam Review URL: http://codereview.chromium.org/155172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/print_web_view_helper.h3
-rw-r--r--chrome/renderer/render_widget.cc8
-rw-r--r--chrome/renderer/render_widget.h3
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc8
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h2
5 files changed, 18 insertions, 6 deletions
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 77079fd..dcfab9d 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -81,7 +81,8 @@ class PrintWebViewHelper : public WebViewDelegate {
virtual void CloseWidgetSoon(WebWidget* webwidget) {}
virtual void Focus(WebWidget* webwidget) {}
virtual void Blur(WebWidget* webwidget) {}
- virtual void SetCursor(WebWidget* webwidget, const WebCursor& cursor) {}
+ virtual void SetCursor(WebWidget* webwidget,
+ const WebKit::WebCursorInfo& cursor) {}
virtual void GetWindowRect(WebWidget* webwidget, WebKit::WebRect* rect);
virtual void SetWindowRect(WebWidget* webwidget,
const WebKit::WebRect& rect) {}
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 4a786c8..daede7a 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -15,6 +15,7 @@
#include "chrome/renderer/render_process.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkShader.h"
+#include "webkit/api/public/WebCursorInfo.h"
#include "webkit/api/public/WebRect.h"
#include "webkit/api/public/WebScreenInfo.h"
#include "webkit/api/public/WebSize.h"
@@ -27,6 +28,7 @@
#include "webkit/glue/webtextdirection.h"
#include "webkit/glue/webwidget.h"
+using WebKit::WebCursorInfo;
using WebKit::WebInputEvent;
using WebKit::WebRect;
using WebKit::WebScreenInfo;
@@ -561,7 +563,11 @@ void RenderWidget::DidScrollRect(WebWidget* webwidget, int dx, int dy,
this, &RenderWidget::DoDeferredScroll));
}
-void RenderWidget::SetCursor(WebWidget* webwidget, const WebCursor& cursor) {
+void RenderWidget::SetCursor(WebWidget* webwidget,
+ const WebCursorInfo& cursor_info) {
+ // TODO(darin): Eliminate this temporary.
+ WebCursor cursor(cursor_info);
+
// Only send a SetCursor message if we need to make a change.
if (!current_cursor_.IsEqual(cursor)) {
current_cursor_ = cursor;
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index fe69433..0d5308b 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -80,7 +80,8 @@ class RenderWidget : public IPC::Channel::Listener,
virtual void CloseWidgetSoon(WebWidget* webwidget);
virtual void Focus(WebWidget* webwidget);
virtual void Blur(WebWidget* webwidget);
- virtual void SetCursor(WebWidget* webwidget, const WebCursor& cursor);
+ virtual void SetCursor(WebWidget* webwidget,
+ const WebKit::WebCursorInfo& cursor);
virtual void GetWindowRect(WebWidget* webwidget, WebKit::WebRect* rect);
virtual void SetWindowRect(WebWidget* webwidget,
const WebKit::WebRect& rect);
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index e7650a7..8314b71 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -30,6 +30,7 @@
#include "grit/generated_resources.h"
#include "net/base/mime_util.h"
#include "printing/native_metafile.h"
+#include "webkit/api/public/WebCursorInfo.h"
#include "webkit/api/public/WebDragData.h"
#include "webkit/api/public/WebString.h"
#include "webkit/api/public/WebVector.h"
@@ -42,6 +43,7 @@
#include "chrome/common/ipc_channel_posix.h"
#endif
+using WebKit::WebCursorInfo;
using WebKit::WebInputEvent;
using WebKit::WebDragData;
using WebKit::WebVector;
@@ -627,16 +629,18 @@ void WebPluginDelegateProxy::SetFocus() {
bool WebPluginDelegateProxy::HandleInputEvent(
const WebInputEvent& event,
- WebCursor* cursor) {
+ WebCursorInfo* cursor_info) {
bool handled;
+ WebCursor cursor;
// A windowless plugin can enter a modal loop in the context of a
// NPP_HandleEvent call, in which case we need to pump messages to
// the plugin. We pass of the corresponding event handle to the
// plugin process, which is set if the plugin does enter a modal loop.
IPC::SyncMessage* message = new PluginMsg_HandleInputEvent(
- instance_id_, &event, &handled, cursor);
+ instance_id_, &event, &handled, &cursor);
message->set_pump_messages_event(modal_loop_pump_messages_event_.get());
Send(message);
+ cursor.GetCursorInfo(cursor_info);
return handled;
}
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index b665015..f7b91e8 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -60,7 +60,7 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
virtual void DidFinishLoadWithReason(NPReason reason);
virtual void SetFocus();
virtual bool HandleInputEvent(const WebKit::WebInputEvent& event,
- WebCursor* cursor);
+ WebKit::WebCursorInfo* cursor);
virtual int GetProcessId();
// IPC::Channel::Listener implementation: