summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webview_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/webview_impl.cc')
-rw-r--r--webkit/glue/webview_impl.cc28
1 files changed, 10 insertions, 18 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index cac8594..408246b 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -121,8 +121,6 @@ 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
@@ -365,7 +363,7 @@ WebViewImpl::WebViewImpl()
WTF::initializeThreading();
// set to impossible point so we always get the first mouse pos
- last_mouse_position_ = WebPoint(-1, -1);
+ last_mouse_position_.SetPoint(-1, -1);
// the page will take ownership of the various clients
page_.reset(new Page(new ChromeClientImpl(this),
@@ -408,7 +406,7 @@ void WebViewImpl::MouseMove(const WebMouseEvent& event) {
if (!main_frame() || !main_frame()->frameview())
return;
- last_mouse_position_ = WebPoint(event.x, event.y);
+ last_mouse_position_.SetPoint(event.x, event.y);
// We call mouseMoved here instead of handleMouseMovedEvent because we need
// our ChromeClientImpl to receive changes to the mouse position and
@@ -959,18 +957,18 @@ WebFrame* WebViewImpl::GetNextFrameAfter(WebFrame* frame, bool wrap) {
return next ? WebFrameImpl::FromFrame(next) : NULL;
}
-void WebViewImpl::Resize(const WebSize& new_size) {
+void WebViewImpl::Resize(const gfx::Size& 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_) {
- WebRect damaged_rect(0, 0, size_.width, size_.height);
+ gfx::Rect damaged_rect(0, 0, size_.width(), size_.height());
delegate_->DidInvalidateRect(this, damaged_rect);
}
}
@@ -995,7 +993,7 @@ void WebViewImpl::Layout() {
}
}
-void WebViewImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
+void WebViewImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) {
WebFrameImpl* webframe = main_frame();
if (webframe)
webframe->Paint(canvas, rect);
@@ -1250,7 +1248,7 @@ bool WebViewImpl::ImeSetComposition(int string_type,
}
bool WebViewImpl::ImeUpdateStatus(bool* enable_ime,
- WebRect* caret_rect) {
+ gfx::Rect* 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;
@@ -1261,27 +1259,22 @@ 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;
-
- *caret_rect = webkit_glue::IntRectToWebRect(
- view->contentsToWindow(controller->absoluteCaretBounds()));
+ const IntRect rect(view->contentsToWindow(controller->absoluteCaretBounds()));
+ caret_rect->SetRect(rect.x(), rect.y(), rect.width(), rect.height());
return true;
}
@@ -1293,7 +1286,6 @@ void WebViewImpl::SetTextDirection(WebTextDirection direction) {
const Frame* focused = GetFocusedWebCoreFrame();
if (!focused)
return;
-
Editor* editor = focused->editor();
if (!editor || !editor->canEdit())
return;
@@ -1870,7 +1862,7 @@ void WebViewImpl::RefreshAutofillPopup() {
WebWidgetImpl* web_widget =
static_cast<WebWidgetImpl*>(autocomplete_popup_->client());
web_widget->delegate()->SetWindowRect(
- web_widget, webkit_glue::IntRectToWebRect(new_bounds));
+ web_widget, webkit_glue::FromIntRect(new_bounds));
}
}