summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webview_impl.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 16:18:52 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 16:18:52 +0000
commitb3f2b912e8efca9c49026119494ab292d27ccf19 (patch)
tree3261d1de7f7497d2c2fe4d004c2c9bc7c138e3cb /webkit/glue/webview_impl.cc
parent90ca36995f2484d10a68115b798c10f51d70fca4 (diff)
downloadchromium_src-b3f2b912e8efca9c49026119494ab292d27ccf19.zip
chromium_src-b3f2b912e8efca9c49026119494ab292d27ccf19.tar.gz
chromium_src-b3f2b912e8efca9c49026119494ab292d27ccf19.tar.bz2
Switch to using WebPoint, WebRect, and WebSize in more of the glue
layer interface. This will help when we move those interfaces into the WebKit API. This is a second attempt at r13381, which was already reviewed here: http://codereview.chromium.org/63126 The only change between that CL and this one is in render_view.h, where I needed to change a parameter type from gfx::Rect to WebRect. TBR=dglazkov Review URL: http://codereview.chromium.org/64005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webview_impl.cc')
-rw-r--r--webkit/glue/webview_impl.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 78ae88b..aa45bc8 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -121,6 +121,8 @@ using WebKit::WebKeyboardEvent;
using WebKit::WebMouseEvent;
using WebKit::WebMouseWheelEvent;
using WebKit::WebPoint;
+using WebKit::WebRect;
+using WebKit::WebSize;
// Change the text zoom level by kTextSizeMultiplierRatio each time the user
// zooms text in or out (ie., change by 20%). The min and max values limit
@@ -153,7 +155,7 @@ class AutocompletePopupMenuClient : public WebCore::PopupMenuClient {
FontDescription font_description;
#if defined(OS_WIN)
- theme()->systemFont(CSSValueWebkitControl, font_description);
+ theme()->systemFont(CSSValueWebkitControl, 0, font_description);
#else
NOTIMPLEMENTED();
#endif
@@ -368,7 +370,7 @@ WebViewImpl::WebViewImpl()
WTF::initializeThreading();
// set to impossible point so we always get the first mouse pos
- last_mouse_position_.SetPoint(-1, -1);
+ last_mouse_position_ = WebPoint(-1, -1);
// the page will take ownership of the various clients
page_.reset(new Page(new ChromeClientImpl(this),
@@ -411,7 +413,7 @@ void WebViewImpl::MouseMove(const WebMouseEvent& event) {
if (!main_frame() || !main_frame()->frameview())
return;
- last_mouse_position_.SetPoint(event.x, event.y);
+ last_mouse_position_ = WebPoint(event.x, event.y);
// We call mouseMoved here instead of handleMouseMovedEvent because we need
// our ChromeClientImpl to receive changes to the mouse position and
@@ -962,18 +964,18 @@ WebFrame* WebViewImpl::GetNextFrameAfter(WebFrame* frame, bool wrap) {
return next ? WebFrameImpl::FromFrame(next) : NULL;
}
-void WebViewImpl::Resize(const gfx::Size& new_size) {
+void WebViewImpl::Resize(const WebSize& new_size) {
if (size_ == new_size)
return;
size_ = new_size;
if (main_frame()->frameview()) {
- main_frame()->frameview()->resize(size_.width(), size_.height());
+ main_frame()->frameview()->resize(size_.width, size_.height);
main_frame()->frame()->eventHandler()->sendResizeEvent();
}
if (delegate_) {
- gfx::Rect damaged_rect(0, 0, size_.width(), size_.height());
+ WebRect damaged_rect(0, 0, size_.width, size_.height);
delegate_->DidInvalidateRect(this, damaged_rect);
}
}
@@ -998,7 +1000,7 @@ void WebViewImpl::Layout() {
}
}
-void WebViewImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) {
+void WebViewImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
WebFrameImpl* webframe = main_frame();
if (webframe)
webframe->Paint(canvas, rect);
@@ -1286,7 +1288,7 @@ bool WebViewImpl::ImeSetComposition(int string_type,
}
bool WebViewImpl::ImeUpdateStatus(bool* enable_ime,
- gfx::Rect* caret_rect) {
+ WebRect* caret_rect) {
// Store whether the selected node needs IME and the caret rectangle.
// This process consists of the following four steps:
// 1. Retrieve the selection controller of the focused frame;
@@ -1297,22 +1299,27 @@ bool WebViewImpl::ImeUpdateStatus(bool* enable_ime,
const Frame* focused = GetFocusedWebCoreFrame();
if (!focused)
return false;
+
const Editor* editor = focused->editor();
if (!editor || !editor->canEdit())
return false;
+
SelectionController* controller = focused->selection();
if (!controller)
return false;
+
const Node* node = controller->start().node();
if (!node)
return false;
+
*enable_ime = node->shouldUseInputMethod() &&
!controller->isInPasswordField();
const FrameView* view = node->document()->view();
if (!view)
return false;
- const IntRect rect(view->contentsToWindow(controller->absoluteCaretBounds()));
- caret_rect->SetRect(rect.x(), rect.y(), rect.width(), rect.height());
+
+ *caret_rect = webkit_glue::IntRectToWebRect(
+ view->contentsToWindow(controller->absoluteCaretBounds()));
return true;
}
@@ -1324,6 +1331,7 @@ void WebViewImpl::SetTextDirection(WebTextDirection direction) {
const Frame* focused = GetFocusedWebCoreFrame();
if (!focused)
return;
+
Editor* editor = focused->editor();
if (!editor || !editor->canEdit())
return;
@@ -1900,7 +1908,7 @@ void WebViewImpl::RefreshAutofillPopup() {
WebWidgetImpl* web_widget =
static_cast<WebWidgetImpl*>(autocomplete_popup_->client());
web_widget->delegate()->SetWindowRect(
- web_widget, webkit_glue::FromIntRect(new_bounds));
+ web_widget, webkit_glue::IntRectToWebRect(new_bounds));
}
}