| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 vertical_layout_rect_.width(), | 441 vertical_layout_rect_.width(), |
| 442 bookmark_bar_height); | 442 bookmark_bar_height); |
| 443 // Set visibility after setting bounds, as the visibility update uses the | 443 // Set visibility after setting bounds, as the visibility update uses the |
| 444 // bounds to determine if the mouse is hovering over a button. | 444 // bounds to determine if the mouse is hovering over a button. |
| 445 bookmark_bar_->SetVisible(true); | 445 bookmark_bar_->SetVisible(true); |
| 446 return y + bookmark_bar_height; | 446 return y + bookmark_bar_height; |
| 447 } | 447 } |
| 448 | 448 |
| 449 int BrowserViewLayout::LayoutInfoBar(int top) { | 449 int BrowserViewLayout::LayoutInfoBar(int top) { |
| 450 // In immersive fullscreen, the infobar always starts near the top of the | 450 // In immersive fullscreen, the infobar always starts near the top of the |
| 451 // screen, just under the "light bar" rectangular stripes. | 451 // screen. |
| 452 if (immersive_mode_controller_->IsEnabled()) { | 452 if (immersive_mode_controller_->IsEnabled()) |
| 453 top = browser_view_->y(); | 453 top = browser_view_->y(); |
| 454 if (!immersive_mode_controller_->ShouldHideTabIndicators()) | 454 |
| 455 top += TabStrip::GetImmersiveHeight(); | |
| 456 } | |
| 457 infobar_container_->SetVisible(InfobarVisible()); | 455 infobar_container_->SetVisible(InfobarVisible()); |
| 458 infobar_container_->SetBounds( | 456 infobar_container_->SetBounds( |
| 459 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(), | 457 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(), |
| 460 infobar_container_->GetPreferredSize().height()); | 458 infobar_container_->GetPreferredSize().height()); |
| 461 return top + infobar_container_->height(); | 459 return top + infobar_container_->height(); |
| 462 } | 460 } |
| 463 | 461 |
| 464 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { | 462 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { |
| 465 // |contents_container_| contains web page contents and devtools. | 463 // |contents_container_| contains web page contents and devtools. |
| 466 // See browser_view.h for details. | 464 // See browser_view.h for details. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 return bottom; | 531 return bottom; |
| 534 } | 532 } |
| 535 | 533 |
| 536 bool BrowserViewLayout::InfobarVisible() const { | 534 bool BrowserViewLayout::InfobarVisible() const { |
| 537 // Cast to a views::View to access GetPreferredSize(). | 535 // Cast to a views::View to access GetPreferredSize(). |
| 538 views::View* infobar_container = infobar_container_; | 536 views::View* infobar_container = infobar_container_; |
| 539 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 537 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 540 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 538 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 541 (infobar_container->GetPreferredSize().height() != 0); | 539 (infobar_container->GetPreferredSize().height() != 0); |
| 542 } | 540 } |
| OLD | NEW |