Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: content/renderer/render_widget.cc

Issue 2333353002: Don't set view_screen_rect_ on RequestMove ACK (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index c135f14e277771d4a38bcc09ac48ccd0f120784a..167a3f64e66a66e4a1f7647e3b313da6c68f5a8e 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -689,8 +689,6 @@ void RenderWidget::OnWasShown(bool needs_repainting,
void RenderWidget::OnRequestMoveAck() {
DCHECK(pending_window_rect_count_);
pending_window_rect_count_--;
- if (!pending_window_rect_count_)
- view_screen_rect_ = pending_window_rect_;
}
GURL RenderWidget::GetURLForGraphicsContext3D() {
@@ -1339,10 +1337,20 @@ void RenderWidget::Close() {
}
WebRect RenderWidget::windowRect() {
- if (pending_window_rect_count_)
+ if (pending_window_rect_count_) {
+ // NOTE(mbelshe): If there is a pending_window_rect_, then getting
+ // the RootWindowRect is probably going to return wrong results since the
+ // browser may not have processed the Move yet. There isn't really anything
+ // good to do in this case, and it shouldn't happen - since this size is
+ // only really needed for windowToScreen, which is only used for Popups.
return pending_window_rect_;
+ }
- return view_screen_rect_;
+ return window_screen_rect_;
+}
+
+WebRect RenderWidget::viewRect() {
+ return view_screen_rect_;
}
void RenderWidget::setToolTipText(const blink::WebString& text,
@@ -1375,19 +1383,13 @@ void RenderWidget::setWindowRect(const WebRect& rect_in_screen) {
void RenderWidget::SetPendingWindowRect(const WebRect& rect) {
pending_window_rect_ = rect;
pending_window_rect_count_++;
-}
-gfx::Rect RenderWidget::RootWindowRect() {
- if (pending_window_rect_count_) {
- // NOTE(mbelshe): If there is a pending_window_rect_, then getting
- // the RootWindowRect is probably going to return wrong results since the
- // browser may not have processed the Move yet. There isn't really anything
- // good to do in this case, and it shouldn't happen - since this size is
- // only really needed for windowToScreen, which is only used for Popups.
- return pending_window_rect_;
+ // Popups don't get size updates back from the browser so just store the set
+ // values.
+ if (popup_type_ != blink::WebPopupTypeNone) {
+ window_screen_rect_ = rect;
+ view_screen_rect_ = rect;
}
-
- return window_screen_rect_;
}
WebRect RenderWidget::windowResizerRect() {
@@ -1520,11 +1522,10 @@ void RenderWidget::OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
void RenderWidget::OnUpdateWindowScreenRect(
const gfx::Rect& window_screen_rect) {
- if (screen_metrics_emulator_) {
+ if (screen_metrics_emulator_)
screen_metrics_emulator_->OnUpdateWindowScreenRect(window_screen_rect);
- } else {
+ else
window_screen_rect_ = window_screen_rect;
- }
}
void RenderWidget::OnSetFrameSinkId(const cc::FrameSinkId& frame_sink_id) {
@@ -1859,7 +1860,7 @@ void RenderWidget::DidAutoResize(const gfx::Size& new_size) {
size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height);
if (resizing_mode_selector_->is_synchronous_mode()) {
- gfx::Rect new_pos(RootWindowRect().x(), RootWindowRect().y(),
+ gfx::Rect new_pos(windowRect().x, windowRect().y,
size_.width(), size_.height());
view_screen_rect_ = new_pos;
window_screen_rect_ = new_pos;
« no previous file with comments | « content/renderer/render_widget.h ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698