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

Unified Diff: chrome/browser/ui/views/tab_contents/tab_contents_container.cc

Issue 6121007: Revert 71230 to see if it is related to hang on linux interactive_ui_tests.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « chrome/browser/ui/views/tab_contents/tab_contents_container.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tab_contents/tab_contents_container.cc
===================================================================
--- chrome/browser/ui/views/tab_contents/tab_contents_container.cc (revision 71251)
+++ chrome/browser/ui/views/tab_contents/tab_contents_container.cc (working copy)
@@ -25,7 +25,8 @@
TabContentsContainer::TabContentsContainer()
: native_container_(NULL),
- tab_contents_(NULL) {
+ tab_contents_(NULL),
+ reserved_area_delegate_(NULL) {
SetID(VIEW_ID_TAB_CONTAINER);
}
@@ -45,6 +46,9 @@
tab_contents_->WasHidden();
RemoveObservers();
}
+#if !defined(TOUCH_UI)
+ TabContents* old_contents = tab_contents_;
+#endif
tab_contents_ = contents;
// When detaching the last tab of the browser ChangeTabContents is invoked
// with NULL. Don't attempt to do anything in that case.
@@ -59,7 +63,9 @@
Layout();
}
#else
- RenderWidgetHostViewChanged(tab_contents_->GetRenderWidgetHostView());
+ RenderWidgetHostViewChanged(
+ old_contents ? old_contents->GetRenderWidgetHostView() : NULL,
+ tab_contents_->GetRenderWidgetHostView());
native_container_->AttachContents(tab_contents_);
#endif
AddObservers();
@@ -76,17 +82,6 @@
native_container_->SetFastResize(fast_resize);
}
-void TabContentsContainer::SetReservedContentsRect(
- const gfx::Rect& reserved_rect) {
- cached_reserved_rect_ = reserved_rect;
-#if !defined(TOUCH_UI)
- if (tab_contents_ && tab_contents_->GetRenderWidgetHostView()) {
- tab_contents_->GetRenderWidgetHostView()->set_reserved_contents_rect(
- reserved_rect);
- }
-#endif
-}
-
////////////////////////////////////////////////////////////////////////////////
// TabContentsContainer, NotificationObserver implementation:
@@ -113,6 +108,8 @@
views::View::Layout();
#else
if (native_container_) {
+ if (reserved_area_delegate_)
+ reserved_area_delegate_->UpdateReservedContentsRect(this);
native_container_->GetView()->SetBounds(0, 0, width(), height());
native_container_->GetView()->Layout();
}
@@ -161,8 +158,10 @@
#if defined(TOUCH_UI)
NOTIMPLEMENTED(); // TODO(anicolao)
#else
- if (new_host)
- RenderWidgetHostViewChanged(new_host->view());
+ if (new_host) {
+ RenderWidgetHostViewChanged(
+ old_host ? old_host->view() : NULL, new_host->view());
+ }
native_container_->RenderViewHostChanged(old_host, new_host);
#endif
}
@@ -175,7 +174,12 @@
}
void TabContentsContainer::RenderWidgetHostViewChanged(
- RenderWidgetHostView* new_view) {
- if (new_view)
- new_view->set_reserved_contents_rect(cached_reserved_rect_);
+ RenderWidgetHostView* old_view, RenderWidgetHostView* new_view) {
+ // Carry over the reserved rect, if possible.
+ if (old_view && new_view) {
+ new_view->set_reserved_contents_rect(old_view->reserved_contents_rect());
+ } else {
+ if (reserved_area_delegate_)
+ reserved_area_delegate_->UpdateReservedContentsRect(this);
+ }
}
« no previous file with comments | « chrome/browser/ui/views/tab_contents/tab_contents_container.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698