summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webwidget_impl.cc
diff options
context:
space:
mode:
authordglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 18:48:28 +0000
committerdglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 18:48:28 +0000
commit074ff16d3029256a9585529cad5487c1ae6eb409 (patch)
treee4d57cd79c533507a632ebf70c8ea8850113a9fc /webkit/glue/webwidget_impl.cc
parent332ff119039b7dd3ba3d1994dde0b077f015bc03 (diff)
downloadchromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.zip
chromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.tar.gz
chromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.tar.bz2
Landing 36102:37604 merge on trunk
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webwidget_impl.cc')
-rw-r--r--webkit/glue/webwidget_impl.cc105
1 files changed, 57 insertions, 48 deletions
diff --git a/webkit/glue/webwidget_impl.cc b/webkit/glue/webwidget_impl.cc
index 381c4b8..c04bedb 100644
--- a/webkit/glue/webwidget_impl.cc
+++ b/webkit/glue/webwidget_impl.cc
@@ -22,6 +22,7 @@ MSVC_POP_WARNING();
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "webkit/glue/event_conversion.h"
+#include "webkit/glue/glue_util.h"
#include "webkit/glue/webinputevent.h"
#include "webkit/glue/webwidget_delegate.h"
#include "webkit/glue/webwidget_impl.h"
@@ -45,15 +46,13 @@ WebWidgetImpl::WebWidgetImpl(WebWidgetDelegate* delegate)
}
WebWidgetImpl::~WebWidgetImpl() {
- if (widget_) {
+ if (widget_)
widget_->setClient(NULL);
- }
}
-void WebWidgetImpl::Init(WebCore::Widget* widget, const gfx::Rect& bounds) {
- DCHECK(widget->isFrameView());
- widget_ = static_cast<FramelessScrollView*>(widget);
-
+void WebWidgetImpl::Init(WebCore::FramelessScrollView* widget,
+ const gfx::Rect& bounds) {
+ widget_ = widget;
widget_->setClient(this);
if (delegate_) {
@@ -109,7 +108,7 @@ void WebWidgetImpl::Resize(const gfx::Size& new_size) {
if (widget_) {
IntRect new_geometry(0, 0, size_.width(), size_.height());
- widget_->setFrameGeometry(new_geometry);
+ widget_->setFrameRect(new_geometry);
}
if (delegate_) {
@@ -197,51 +196,47 @@ bool WebWidgetImpl::ImeUpdateStatus(bool* enable_ime, const void** id,
return false;
}
-const SkBitmap* WebWidgetImpl::getPreloadedResourceBitmap(int resource_id) {
- return NULL;
-}
-
-const WTF::Vector<RefPtr<WebCore::Range> >* WebWidgetImpl::getTickmarks(
- WebCore::Frame* frame) {
- return NULL;
-}
+//-----------------------------------------------------------------------------
+// WebCore::HostWindow
-size_t WebWidgetImpl::getActiveTickmarkIndex(WebCore::Frame* frame) {
- return kNoTickmark;
+void WebWidgetImpl::repaint(const WebCore::IntRect& paint_rect,
+ bool content_changed,
+ bool immediate,
+ bool repaint_content_only) {
+ if (delegate_)
+ delegate_->DidInvalidateRect(this, webkit_glue::FromIntRect(paint_rect));
}
-void WebWidgetImpl::onScrollPositionChanged(Widget* widget) {
+void WebWidgetImpl::scroll(const WebCore::IntSize& scroll_delta,
+ const WebCore::IntRect& scroll_rect,
+ const WebCore::IntRect& clip_rect) {
+ if (delegate_) {
+ int dx = scroll_delta.width();
+ int dy = scroll_delta.height();
+ delegate_->DidScrollRect(this, dx, dy, webkit_glue::FromIntRect(clip_rect));
+ }
}
-//-----------------------------------------------------------------------------
-// WebCore::WidgetClientWin
-
-gfx::ViewHandle WebWidgetImpl::containingWindow() {
- return delegate_ ? delegate_->GetContainingWindow(this) : NULL;
+WebCore::IntPoint WebWidgetImpl::screenToWindow(
+ const WebCore::IntPoint& point) const {
+ NOTIMPLEMENTED();
+ return WebCore::IntPoint();
}
-void WebWidgetImpl::invalidateRect(const IntRect& damaged_rect) {
- if (delegate_)
- delegate_->DidInvalidateRect(this, gfx::Rect(damaged_rect.x(),
- damaged_rect.y(),
- damaged_rect.width(),
- damaged_rect.height()));
+WebCore::IntRect WebWidgetImpl::windowToScreen(
+ const WebCore::IntRect& rect) const {
+ NOTIMPLEMENTED();
+ return WebCore::IntRect();
}
-void WebWidgetImpl::scrollRect(int dx, int dy, const IntRect& clip_rect) {
- if (delegate_)
- delegate_->DidScrollRect(this, dx, dy, gfx::Rect(clip_rect.x(),
- clip_rect.y(),
- clip_rect.width(),
- clip_rect.height()));
+PlatformWidget WebWidgetImpl::platformWindow() const {
+ return NULL;
}
-void WebWidgetImpl::popupOpened(WebCore::Widget* widget,
- const WebCore::IntRect& bounds) {
- NOTREACHED() << "popupOpened called on a popup";
-}
+//-----------------------------------------------------------------------------
+// WebCore::FramelessScrollViewClient
-void WebWidgetImpl::popupClosed(WebCore::Widget* widget) {
+void WebWidgetImpl::popupClosed(WebCore::FramelessScrollView* widget) {
DCHECK(widget == widget_);
if (widget_) {
widget_->setClient(NULL);
@@ -250,16 +245,29 @@ void WebWidgetImpl::popupClosed(WebCore::Widget* widget) {
delegate_->CloseWidgetSoon(this);
}
-void WebWidgetImpl::setCursor(const WebCore::Cursor& cursor) {
-#if defined(OS_WIN)
- // TODO(pinkerton): re-enable when WebCursor is ported
- if (delegate_)
- delegate_->SetCursor(this, cursor.impl());
-#endif
+//-----------------------------------------------------------------------------
+// WebCore::WidgetClientWin
+
+// TODO(darin): Figure out what happens to these methods.
+#if 0
+gfx::ViewHandle WebWidgetImpl::containingWindow() {
+ return delegate_ ? delegate_->GetContainingWindow(this) : NULL;
}
-void WebWidgetImpl::setFocus() {
- delegate_->Focus(this);
+const SkBitmap* WebWidgetImpl::getPreloadedResourceBitmap(int resource_id) {
+ return NULL;
+}
+
+void WebWidgetImpl::onScrollPositionChanged(Widget* widget) {
+}
+
+const WTF::Vector<RefPtr<WebCore::Range> >* WebWidgetImpl::getTickmarks(
+ WebCore::Frame* frame) {
+ return NULL;
+}
+
+size_t WebWidgetImpl::getActiveTickmarkIndex(WebCore::Frame* frame) {
+ return kNoTickmark;
}
bool WebWidgetImpl::isHidden() {
@@ -268,3 +276,4 @@ bool WebWidgetImpl::isHidden() {
return delegate_->IsHidden();
}
+#endif