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

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

Issue 6247001: Re-land 71230.... (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 71256)
+++ chrome/browser/ui/views/tab_contents/tab_contents_container.cc (working copy)
@@ -25,8 +25,7 @@
TabContentsContainer::TabContentsContainer()
: native_container_(NULL),
- tab_contents_(NULL),
- reserved_area_delegate_(NULL) {
+ tab_contents_(NULL) {
SetID(VIEW_ID_TAB_CONTAINER);
}
@@ -46,9 +45,6 @@
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.
@@ -63,9 +59,7 @@
Layout();
}
#else
- RenderWidgetHostViewChanged(
- old_contents ? old_contents->GetRenderWidgetHostView() : NULL,
- tab_contents_->GetRenderWidgetHostView());
+ RenderWidgetHostViewChanged(tab_contents_->GetRenderWidgetHostView());
native_container_->AttachContents(tab_contents_);
#endif
AddObservers();
@@ -82,6 +76,17 @@
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:
@@ -108,8 +113,6 @@
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();
}
@@ -158,10 +161,8 @@
#if defined(TOUCH_UI)
NOTIMPLEMENTED(); // TODO(anicolao)
#else
- if (new_host) {
- RenderWidgetHostViewChanged(
- old_host ? old_host->view() : NULL, new_host->view());
- }
+ if (new_host)
+ RenderWidgetHostViewChanged(new_host->view());
native_container_->RenderViewHostChanged(old_host, new_host);
#endif
}
@@ -174,12 +175,7 @@
}
void TabContentsContainer::RenderWidgetHostViewChanged(
- 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);
- }
+ RenderWidgetHostView* new_view) {
+ if (new_view)
+ new_view->set_reserved_contents_rect(cached_reserved_rect_);
}
« 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