diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 23:16:24 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 23:16:24 +0000 |
commit | eb6439387ab5035450035d606f6ff32319c13789 (patch) | |
tree | 897f9ffa88d64addd5ed0de10039c3dfc383100a /chrome/renderer/render_widget.cc | |
parent | 1640ffbff45713748fb31c9bbae46ea47ab6e8e0 (diff) | |
download | chromium_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 'chrome/renderer/render_widget.cc')
-rw-r--r-- | chrome/renderer/render_widget.cc | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 5c00dc0..9b05e19 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -14,9 +14,7 @@ #include "chrome/common/transport_dib.h" #include "chrome/renderer/render_process.h" #include "skia/ext/platform_canvas.h" -#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #if defined(OS_POSIX) #include "skia/include/SkPixelRef.h" @@ -27,9 +25,7 @@ #include "webkit/glue/webwidget.h" using WebKit::WebInputEvent; -using WebKit::WebRect; using WebKit::WebScreenInfo; -using WebKit::WebSize; RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable) : routing_id_(MSG_ROUTING_NONE), @@ -458,13 +454,13 @@ gfx::NativeViewId RenderWidget::GetContainingView(WebWidget* webwidget) { } void RenderWidget::DidInvalidateRect(WebWidget* webwidget, - const WebRect& rect) { + const gfx::Rect& rect) { // We only want one pending DoDeferredPaint call at any time... bool paint_pending = !paint_rect_.IsEmpty(); // If this invalidate overlaps with a pending scroll, then we have to // downgrade to invalidating the scroll rect. - if (gfx::Rect(rect).Intersects(scroll_rect_)) { + if (rect.Intersects(scroll_rect_)) { paint_rect_ = paint_rect_.Union(scroll_rect_); scroll_rect_ = gfx::Rect(); } @@ -490,7 +486,7 @@ void RenderWidget::DidInvalidateRect(WebWidget* webwidget, } void RenderWidget::DidScrollRect(WebWidget* webwidget, int dx, int dy, - const WebRect& clip_rect) { + const gfx::Rect& clip_rect) { if (dx != 0 && dy != 0) { // We only support scrolling along one axis at a time. DidScrollRect(webwidget, 0, dy, clip_rect); @@ -502,7 +498,7 @@ void RenderWidget::DidScrollRect(WebWidget* webwidget, int dx, int dy, // If we already have a pending scroll operation or if this scroll operation // intersects the existing paint region, then just failover to invalidating. if (!scroll_rect_.IsEmpty() || intersects_with_painting) { - if (!intersects_with_painting && scroll_rect_ == gfx::Rect(clip_rect)) { + if (!intersects_with_painting && scroll_rect_ == clip_rect) { // OK, we can just update the scroll delta (requires same scrolling axis) if (!dx && !scroll_delta_.x()) { scroll_delta_.set_y(scroll_delta_.y() + dy); @@ -565,7 +561,7 @@ void RenderWidget::Show(WebWidget* webwidget, } void RenderWidget::ShowWithItems(WebWidget* webwidget, - const WebRect& bounds, + const gfx::Rect& bounds, int item_height, int selected_index, const std::vector<MenuItem>& items) { @@ -602,13 +598,11 @@ void RenderWidget::Close() { } } -void RenderWidget::GetWindowRect(WebWidget* webwidget, WebRect* result) { - gfx::Rect rect; - Send(new ViewHostMsg_GetWindowRect(routing_id_, host_window_, &rect)); - *result = rect; +void RenderWidget::GetWindowRect(WebWidget* webwidget, gfx::Rect* rect) { + Send(new ViewHostMsg_GetWindowRect(routing_id_, host_window_, rect)); } -void RenderWidget::SetWindowRect(WebWidget* webwidget, const WebRect& pos) { +void RenderWidget::SetWindowRect(WebWidget* webwidget, const gfx::Rect& pos) { if (did_show_) { Send(new ViewHostMsg_RequestMove(routing_id_, pos)); } else { @@ -616,14 +610,12 @@ void RenderWidget::SetWindowRect(WebWidget* webwidget, const WebRect& pos) { } } -void RenderWidget::GetRootWindowRect(WebWidget* webwidget, WebRect* result) { - gfx::Rect rect; - Send(new ViewHostMsg_GetRootWindowRect(routing_id_, host_window_, &rect)); - *result = rect; +void RenderWidget::GetRootWindowRect(WebWidget* webwidget, gfx::Rect* rect) { + Send(new ViewHostMsg_GetRootWindowRect(routing_id_, host_window_, rect)); } void RenderWidget::GetRootWindowResizerRect(WebWidget* webwidget, - WebRect* rect) { + gfx::Rect* rect) { *rect = resizer_rect_; } @@ -702,7 +694,7 @@ void RenderWidget::UpdateIME() { // Retrieve the caret position from the focused widget and verify we should // enabled IMEs attached to the browser process. bool enable_ime = false; - WebRect caret_rect; + gfx::Rect caret_rect; if (!webwidget_ || !webwidget_->ImeUpdateStatus(&enable_ime, &caret_rect)) { // There are not any editable widgets attached to this process. @@ -748,8 +740,8 @@ void RenderWidget::UpdateIME() { // The input focus is not changed. // Notify the caret position to a browser process only if it is changed. if (ime_control_enable_ime_) { - if (caret_rect.x != ime_control_x_ || - caret_rect.y != ime_control_y_) { + if (caret_rect.x() != ime_control_x_ || + caret_rect.y() != ime_control_y_) { Send(new ViewHostMsg_ImeUpdateStatus(routing_id(), IME_MOVE_WINDOWS, caret_rect)); } @@ -758,8 +750,8 @@ void RenderWidget::UpdateIME() { // Save the updated IME status to prevent from sending the same IPC messages. ime_control_updated_ = false; ime_control_enable_ime_ = ime_control_new_state_; - ime_control_x_ = caret_rect.x; - ime_control_y_ = caret_rect.y; + ime_control_x_ = caret_rect.x(); + ime_control_y_ = caret_rect.y(); } void RenderWidget::DidMove(WebWidget* webwidget, |