Index: chrome/browser/ui/views/frame/top_container_view.cc |
diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc |
index 8e4e6a3eb184da672d5fb96a8330cc09c2b5a295..d9768545fa2a16e414509574d472ca70250e50bd 100644 |
--- a/chrome/browser/ui/views/frame/top_container_view.cc |
+++ b/chrome/browser/ui/views/frame/top_container_view.cc |
@@ -15,6 +15,24 @@ TopContainerView::TopContainerView(BrowserView* browser_view) |
TopContainerView::~TopContainerView() { |
} |
+gfx::Rect TopContainerView::GetTargetBoundsInScreen() const { |
+ if (!parent()) |
+ return bounds(); |
+ |
+ // Compute transform relative to parent. |
+ gfx::Transform transform; |
+ if (layer()) |
+ transform = layer()->GetTargetTransform(); |
+ gfx::Transform translation; |
+ translation.Translate(static_cast<float>(GetMirroredX()), |
+ static_cast<float>(y())); |
+ transform.ConcatTransform(translation); |
+ |
+ gfx::Point origin(parent()->GetBoundsInScreen().origin()); |
+ transform.TransformPoint(origin); |
+ return gfx::Rect(origin, size()); |
+} |
+ |
gfx::Size TopContainerView::GetPreferredSize() { |
// The view wants to be as wide as its parent and tall enough to fully show |
// its last child view. |
@@ -27,6 +45,13 @@ std::string TopContainerView::GetClassName() const { |
return "TopContainerView"; |
} |
+void TopContainerView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
+ ImmersiveModeController* immersive_controller = |
+ browser_view_->immersive_mode_controller(); |
+ if (immersive_controller->IsEnabled()) |
+ immersive_controller->OnTopContainerBoundsChanged(); |
+} |
+ |
void TopContainerView::PaintChildren(gfx::Canvas* canvas) { |
if (browser_view_->immersive_mode_controller()->IsRevealed()) { |
// Top-views depend on parts of the frame (themes, window buttons) being |