summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webwidget_impl.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:16:24 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:16:24 +0000
commiteb6439387ab5035450035d606f6ff32319c13789 (patch)
tree897f9ffa88d64addd5ed0de10039c3dfc383100a /webkit/glue/webwidget_impl.cc
parent1640ffbff45713748fb31c9bbae46ea47ab6e8e0 (diff)
downloadchromium_src-eb6439387ab5035450035d606f6ff32319c13789.zip
chromium_src-eb6439387ab5035450035d606f6ff32319c13789.tar.gz
chromium_src-eb6439387ab5035450035d606f6ff32319c13789.tar.bz2
Reverting dfisher changes 133386 and 13381
TBR=darin Review URL: http://codereview.chromium.org/58018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webwidget_impl.cc')
-rw-r--r--webkit/glue/webwidget_impl.cc39
1 files changed, 19 insertions, 20 deletions
diff --git a/webkit/glue/webwidget_impl.cc b/webkit/glue/webwidget_impl.cc
index 79408fb..0c5f062 100644
--- a/webkit/glue/webwidget_impl.cc
+++ b/webkit/glue/webwidget_impl.cc
@@ -19,6 +19,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
MSVC_POP_WARNING();
#undef LOG
+#include "base/gfx/rect.h"
#include "base/logging.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
@@ -33,9 +34,6 @@ using WebKit::WebInputEvent;
using WebKit::WebKeyboardEvent;
using WebKit::WebMouseEvent;
using WebKit::WebMouseWheelEvent;
-using WebKit::WebPoint;
-using WebKit::WebRect;
-using WebKit::WebSize;
// WebWidget ----------------------------------------------------------------
@@ -50,7 +48,7 @@ WebWidgetImpl::WebWidgetImpl(WebWidgetDelegate* delegate)
: delegate_(delegate),
widget_(NULL) {
// set to impossible point so we always get the first mouse pos
- last_mouse_position_ = WebPoint(-1, -1);
+ last_mouse_position_.SetPoint(-1, -1);
}
WebWidgetImpl::~WebWidgetImpl() {
@@ -59,7 +57,7 @@ WebWidgetImpl::~WebWidgetImpl() {
}
void WebWidgetImpl::Init(WebCore::FramelessScrollView* widget,
- const WebRect& bounds) {
+ const gfx::Rect& bounds) {
widget_ = widget;
widget_->setClient(this);
@@ -70,7 +68,7 @@ void WebWidgetImpl::Init(WebCore::FramelessScrollView* widget,
}
void WebWidgetImpl::InitWithItems(WebCore::FramelessScrollView* widget,
- const WebRect& bounds,
+ const gfx::Rect& bounds,
int item_height,
int selected_index,
const std::vector<MenuItem>& items) {
@@ -85,9 +83,10 @@ void WebWidgetImpl::InitWithItems(WebCore::FramelessScrollView* widget,
void WebWidgetImpl::MouseMove(const WebMouseEvent& event) {
// don't send mouse move messages if the mouse hasn't moved.
- if (event.x != last_mouse_position_.x ||
- event.y != last_mouse_position_.y) {
- last_mouse_position_ = WebPoint(event.x, event.y);
+ if (event.x != last_mouse_position_.x() ||
+ event.y != last_mouse_position_.y()) {
+ last_mouse_position_.SetPoint(event.x, event.y);
+
widget_->handleMouseMoveEvent(MakePlatformMouseEvent(widget_, event));
}
}
@@ -124,18 +123,18 @@ void WebWidgetImpl::Close() {
Release(); // Balances AddRef from WebWidget::Create
}
-void WebWidgetImpl::Resize(const WebSize& new_size) {
+void WebWidgetImpl::Resize(const gfx::Size& new_size) {
if (size_ == new_size)
return;
size_ = new_size;
if (widget_) {
- IntRect new_geometry(0, 0, size_.width, size_.height);
+ IntRect new_geometry(0, 0, size_.width(), size_.height());
widget_->setFrameRect(new_geometry);
}
if (delegate_) {
- WebRect damaged_rect(0, 0, size_.width, size_.height);
+ gfx::Rect damaged_rect(0, 0, size_.width(), size_.height());
delegate_->DidInvalidateRect(this, damaged_rect);
}
}
@@ -143,11 +142,11 @@ void WebWidgetImpl::Resize(const WebSize& new_size) {
void WebWidgetImpl::Layout() {
}
-void WebWidgetImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
+void WebWidgetImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) {
if (!widget_)
return;
- if (!rect.isEmpty()) {
+ if (!rect.IsEmpty()) {
#if defined(OS_MACOSX)
CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext();
GraphicsContext gc(context);
@@ -157,7 +156,9 @@ void WebWidgetImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
#endif
- widget_->paint(&gc, webkit_glue::WebRectToIntRect(rect));
+ IntRect dirty_rect(rect.x(), rect.y(), rect.width(), rect.height());
+
+ widget_->paint(&gc, dirty_rect);
}
}
@@ -216,7 +217,7 @@ bool WebWidgetImpl::ImeSetComposition(int string_type,
}
bool WebWidgetImpl::ImeUpdateStatus(bool* enable_ime,
- WebRect* caret_rect) {
+ gfx::Rect* caret_rect) {
return false;
}
@@ -234,8 +235,7 @@ void WebWidgetImpl::repaint(const WebCore::IntRect& paint_rect,
if (!content_changed || paint_rect.isEmpty())
return;
if (delegate_)
- delegate_->DidInvalidateRect(this,
- webkit_glue::IntRectToWebRect(paint_rect));
+ delegate_->DidInvalidateRect(this, webkit_glue::FromIntRect(paint_rect));
}
void WebWidgetImpl::scroll(const WebCore::IntSize& scroll_delta,
@@ -244,8 +244,7 @@ void WebWidgetImpl::scroll(const WebCore::IntSize& scroll_delta,
if (delegate_) {
int dx = scroll_delta.width();
int dy = scroll_delta.height();
- delegate_->DidScrollRect(this, dx, dy,
- webkit_glue::IntRectToWebRect(clip_rect));
+ delegate_->DidScrollRect(this, dx, dy, webkit_glue::FromIntRect(clip_rect));
}
}