| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/find_bar/find_bar.h" | 7 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 8 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 8 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
| 10 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 10 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 if (contents_split_->child_at(1) && contents_split_->child_at(1)->visible()) | 430 if (contents_split_->child_at(1) && contents_split_->child_at(1)->visible()) |
| 431 return 0; | 431 return 0; |
| 432 | 432 |
| 433 // Adjust for separator. | 433 // Adjust for separator. |
| 434 return active_bookmark_bar_->height() - | 434 return active_bookmark_bar_->height() - |
| 435 views::NonClientFrameView::kClientEdgeThickness; | 435 views::NonClientFrameView::kClientEdgeThickness; |
| 436 } | 436 } |
| 437 | 437 |
| 438 int BrowserViewLayout::LayoutDownloadShelf(int bottom) { | 438 int BrowserViewLayout::LayoutDownloadShelf(int bottom) { |
| 439 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 439 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 440 // Re-layout the shelf either if it is visible or if it's close animation | 440 // Re-layout the shelf either if it is visible or if its close animation |
| 441 // is currently running. ChromiumOS uses ActiveDownloadsUI instead of | 441 // is currently running. ChromiumOS uses ActiveDownloadsUI instead of |
| 442 // DownloadShelf. | 442 // DownloadShelf. |
| 443 if (browser_view_->IsDownloadShelfVisible() || | 443 if (browser_view_->IsDownloadShelfVisible() || |
| 444 (download_shelf_ && download_shelf_->IsClosing())) { | 444 (download_shelf_ && download_shelf_->IsClosing())) { |
| 445 bool visible = browser()->SupportsWindowFeature( | 445 bool visible = browser()->SupportsWindowFeature( |
| 446 Browser::FEATURE_DOWNLOADSHELF); | 446 Browser::FEATURE_DOWNLOADSHELF); |
| 447 DCHECK(download_shelf_); | 447 DCHECK(download_shelf_); |
| 448 int height = visible ? download_shelf_->GetPreferredSize().height() : 0; | 448 int height = visible ? download_shelf_->GetPreferredSize().height() : 0; |
| 449 download_shelf_->SetVisible(visible); | 449 download_shelf_->SetVisible(visible); |
| 450 download_shelf_->SetBounds(vertical_layout_rect_.x(), bottom - height, | 450 download_shelf_->SetBounds(vertical_layout_rect_.x(), bottom - height, |
| 451 vertical_layout_rect_.width(), height); | 451 vertical_layout_rect_.width(), height); |
| 452 download_shelf_->Layout(); | 452 download_shelf_->Layout(); |
| 453 bottom -= height; | 453 bottom -= height; |
| 454 } | 454 } |
| 455 #endif | 455 #endif |
| 456 return bottom; | 456 return bottom; |
| 457 } | 457 } |
| 458 | 458 |
| 459 bool BrowserViewLayout::InfobarVisible() const { | 459 bool BrowserViewLayout::InfobarVisible() const { |
| 460 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 460 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 461 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 461 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 462 (infobar_container_->GetPreferredSize().height() != 0); | 462 (infobar_container_->GetPreferredSize().height() != 0); |
| 463 } | 463 } |
| OLD | NEW |