summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.cc
diff options
context:
space:
mode:
authoralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 22:33:03 +0000
committeralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 22:33:03 +0000
commite2356245e357455e99aade6a0800032b115c1b53 (patch)
treedcd58e1a53d918716650531111141d266d6aea9b /chrome/renderer/render_widget.cc
parent880a6d5e6933a40338c06fcc5d9fd7ae5e654a4a (diff)
downloadchromium_src-e2356245e357455e99aade6a0800032b115c1b53.zip
chromium_src-e2356245e357455e99aade6a0800032b115c1b53.tar.gz
chromium_src-e2356245e357455e99aade6a0800032b115c1b53.tar.bz2
Handle resize corner layout entirely in the BrowserView (views) or BrowserWindow* (Mac)
and extend RenderViewHost with a concept of reserved contents rect, a place to show extra stuff, such as Sidebar's mini tab UI. sidebar UI implementation warranted this change (mini tabs UI and resize corner area for sidebar contents). TabContentsDelegate::GetRootWindowResizerRect() is no more, reserved contents area is now cached in RenderWidgetHostView and updated upon view resize. Views: BrowserView is responsible for the actual layout and reserved contents area update. Mac: TabContentsController now manages all TabContents views in the main browser window to solve two problems, first to prevent contents flickering during tab change not only for the page, but for the sidebar and devtools contents too and, second, to monitor contents view frame changes and update reserved contents area accordingly. BUG=51084 TEST=All tests should pass, this is a refactoring CL. Review URL: http://codereview.chromium.org/3547008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r--chrome/renderer/render_widget.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index b9c839e..d54bbb9 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -103,7 +103,7 @@ RenderWidget* RenderWidget::Create(int32 opener_id,
// static
WebWidget* RenderWidget::CreateWebWidget(RenderWidget* render_widget) {
switch (render_widget->popup_type_) {
- case WebKit::WebPopupTypeNone: // Nothing to create.
+ case WebKit::WebPopupTypeNone: // Nothing to create.
break;
case WebKit::WebPopupTypeSelect:
case WebKit::WebPopupTypeSuggestion:
@@ -232,15 +232,19 @@ void RenderWidget::OnResize(const gfx::Size& new_size,
if (!webwidget_)
return;
+ // We shouldn't be asked to resize to our current size.
+ DCHECK(size_ != new_size || resizer_rect_ != resizer_rect);
+
// Remember the rect where the resize corner will be drawn.
resizer_rect_ = resizer_rect;
+ if (size_ == new_size)
+ return;
+
// TODO(darin): We should not need to reset this here.
SetHidden(false);
needs_repainting_on_restore_ = false;
- // We shouldn't be asked to resize to our current size.
- DCHECK(size_ != new_size);
size_ = new_size;
// We should not be sent a Resize message if we have not ACK'd the previous
@@ -565,6 +569,7 @@ void RenderWidget::DoDeferredUpdate() {
params.copy_rects.swap(copy_rects); // TODO(darin): clip to bounds?
}
params.view_size = size_;
+ params.resizer_rect = resizer_rect_;
params.plugin_window_moves.swap(plugin_window_moves_);
params.flags = next_paint_flags_;
@@ -661,7 +666,7 @@ void RenderWidget::scheduleComposite() {
// important for the accelerated compositing case. The option of simply
// duplicating all that code is less desirable than "faking out" the
// invalidation path using a magical damage rect.
- didInvalidateRect(WebRect(0,0,1,1));
+ didInvalidateRect(WebRect(0, 0, 1, 1));
}
void RenderWidget::didChangeCursor(const WebCursorInfo& cursor_info) {