| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 458 } |
| 459 | 459 |
| 460 int BrowserViewLayout::LayoutInfoBar(int top) { | 460 int BrowserViewLayout::LayoutInfoBar(int top) { |
| 461 // In immersive fullscreen, the infobar always starts near the top of the | 461 // In immersive fullscreen, the infobar always starts near the top of the |
| 462 // screen, just under the "light bar" rectangular stripes. | 462 // screen, just under the "light bar" rectangular stripes. |
| 463 if (immersive_mode_controller_->IsEnabled()) { | 463 if (immersive_mode_controller_->IsEnabled()) { |
| 464 top = browser_view_->y(); | 464 top = browser_view_->y(); |
| 465 if (!immersive_mode_controller_->ShouldHideTabIndicators()) | 465 if (!immersive_mode_controller_->ShouldHideTabIndicators()) |
| 466 top += TabStrip::GetImmersiveHeight(); | 466 top += TabStrip::GetImmersiveHeight(); |
| 467 } | 467 } |
| 468 // Raise the |infobar_container_| by its vertical overlap. | |
| 469 infobar_container_->SetVisible(InfobarVisible()); | 468 infobar_container_->SetVisible(InfobarVisible()); |
| 470 infobar_container_->SetBounds( | 469 infobar_container_->SetBounds( |
| 471 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(), | 470 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(), |
| 472 infobar_container_->GetPreferredSize().height()); | 471 infobar_container_->GetPreferredSize().height()); |
| 473 return top + infobar_container_->height(); | 472 return top + infobar_container_->height(); |
| 474 } | 473 } |
| 475 | 474 |
| 476 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { | 475 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { |
| 477 // |contents_container_| contains web page contents and devtools. | 476 // |contents_container_| contains web page contents and devtools. |
| 478 // See browser_view.h for details. | 477 // See browser_view.h for details. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 return bottom; | 544 return bottom; |
| 546 } | 545 } |
| 547 | 546 |
| 548 bool BrowserViewLayout::InfobarVisible() const { | 547 bool BrowserViewLayout::InfobarVisible() const { |
| 549 // Cast to a views::View to access GetPreferredSize(). | 548 // Cast to a views::View to access GetPreferredSize(). |
| 550 views::View* infobar_container = infobar_container_; | 549 views::View* infobar_container = infobar_container_; |
| 551 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 550 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 552 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 551 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 553 (infobar_container->GetPreferredSize().height() != 0); | 552 (infobar_container->GetPreferredSize().height() != 0); |
| 554 } | 553 } |
| OLD | NEW |