diff options
author | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 18:48:28 +0000 |
---|---|---|
committer | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 18:48:28 +0000 |
commit | 074ff16d3029256a9585529cad5487c1ae6eb409 (patch) | |
tree | e4d57cd79c533507a632ebf70c8ea8850113a9fc /webkit/glue/chrome_client_impl.cc | |
parent | 332ff119039b7dd3ba3d1994dde0b077f015bc03 (diff) | |
download | chromium_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/chrome_client_impl.cc')
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 92 |
1 files changed, 64 insertions, 28 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index d2bbbb4..24cbb7c 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" MSVC_PUSH_WARNING_LEVEL(0); +#include "Cursor.h" #include "FloatRect.h" #include "FileChooser.h" #include "FrameLoadRequest.h" @@ -29,6 +30,7 @@ MSVC_POP_WARNING(); #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webview_delegate.h" #include "webkit/glue/webview_impl.h" +#include "webkit/glue/webwidget_impl.h" struct IWebURLResponse; @@ -356,23 +358,52 @@ WebCore::IntRect ChromeClientImpl::windowResizerRect() const { return rv; } -void ChromeClientImpl::addToDirtyRegion(const WebCore::IntRect& damaged_rect) { - ASSERT_NOT_REACHED(); +void ChromeClientImpl::repaint( + const WebCore::IntRect& paint_rect, bool content_changed, bool immediate, + bool repaint_content_only) { + WebViewDelegate* d = webview_->delegate(); + if (d) + d->DidInvalidateRect(webview_, webkit_glue::FromIntRect(paint_rect)); +} + +void ChromeClientImpl::scroll( + const WebCore::IntSize& scroll_delta, const WebCore::IntRect& scroll_rect, + const WebCore::IntRect& clip_rect) { + WebViewDelegate* d = webview_->delegate(); + if (d) { + int dx = scroll_delta.width(); + int dy = scroll_delta.height(); + d->DidScrollRect(webview_, dx, dy, webkit_glue::FromIntRect(clip_rect)); + } } -void ChromeClientImpl::scrollBackingStore(int dx, int dy, - const WebCore::IntRect& scroll_rect, - const WebCore::IntRect& clip_rect) { - ASSERT_NOT_REACHED(); +WebCore::IntPoint ChromeClientImpl::screenToWindow( + const WebCore::IntPoint&) const { + NOTIMPLEMENTED(); + return WebCore::IntPoint(); } -void ChromeClientImpl::updateBackingStore() { - ASSERT_NOT_REACHED(); +WebCore::IntRect ChromeClientImpl::windowToScreen( + const WebCore::IntRect& rect) const { + WebCore::IntRect screen_rect(rect); + + WebViewDelegate* d = webview_->delegate(); + if (d) { + gfx::Rect window_rect; + d->GetWindowRect(webview_, &window_rect); + screen_rect.move(window_rect.x(), window_rect.y()); + } + + return screen_rect; } -void ChromeClientImpl::mouseDidMoveOverElement(const WebCore::HitTestResult& result, - unsigned modifierFlags) { +PlatformWidget ChromeClientImpl::platformWindow() const { + // We have no native widget. + return NULL; +} +void ChromeClientImpl::mouseDidMoveOverElement( + const WebCore::HitTestResult& result, unsigned modifierFlags) { // Find out if the mouse is over a link, and if so, let our UI know... somehow WebViewDelegate* d = webview_->delegate(); if (d) { @@ -392,6 +423,18 @@ void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text) { } } +void ChromeClientImpl::print(WebCore::Frame* frame) { + WebViewDelegate* d = webview_->delegate(); + if (d) { + d->ScriptedPrint(WebFrameImpl::FromFrame(frame)); + } +} + +void ChromeClientImpl::exceededDatabaseQuota(WebCore::Frame* frame, + const WebCore::String& databaseName) { + // TODO(tc): If we enable the storage API, we need to implement this function. +} + void ChromeClientImpl::runFileChooser(const WebCore::String& default_path, PassRefPtr<WebCore::FileChooser> fileChooser) { WebViewDelegate* delegate = webview_->delegate(); @@ -403,28 +446,21 @@ void ChromeClientImpl::runFileChooser(const WebCore::String& default_path, delegate->RunFileChooser(suggestion, chooser); } -WebCore::IntRect ChromeClientImpl::windowToScreen(const WebCore::IntRect& rect) { - WebCore::IntRect screen_rect(rect); - +void ChromeClientImpl::popupOpened( + WebCore::FramelessScrollView* popup_view, const WebCore::IntRect& bounds) { WebViewDelegate* d = webview_->delegate(); if (d) { - gfx::Rect window_rect; - d->GetWindowRect(webview_, &window_rect); - screen_rect.move(window_rect.x(), window_rect.y()); + WebWidgetImpl* webwidget = + static_cast<WebWidgetImpl*>(d->CreatePopupWidget(webview_)); + webwidget->Init(popup_view, webkit_glue::FromIntRect(bounds)); } - - return screen_rect; } -void ChromeClientImpl::print(WebCore::Frame* frame) { +void ChromeClientImpl::setCursor(const WebCore::Cursor& cursor) { +#if defined(OS_WIN) + // TODO(pinkerton): figure out the cursor delegate methods WebViewDelegate* d = webview_->delegate(); - if (d) { - d->ScriptedPrint(WebFrameImpl::FromFrame(frame)); - } -} - -void ChromeClientImpl::exceededDatabaseQuota(WebCore::Frame* frame, - const WebCore::String& databaseName) { - // TODO(tc): If we enable the storage API, we need to implement this function. + if (d) + d->SetCursor(webview_, cursor.impl()); +#endif } - |