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