| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/frame/browser_view_layout.h" | 5 #include "chrome/browser/views/frame/browser_view_layout.h" |
| 6 | 6 |
| 7 #include "chrome/browser/find_bar.h" | 7 #include "chrome/browser/find_bar.h" |
| 8 #include "chrome/browser/find_bar_controller.h" | 8 #include "chrome/browser/find_bar_controller.h" |
| 9 #include "chrome/browser/view_ids.h" | 9 #include "chrome/browser/view_ids.h" |
| 10 #include "chrome/browser/views/bookmark_bar_view.h" | 10 #include "chrome/browser/views/bookmark_bar_view.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 break; | 251 break; |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 void BrowserViewLayout::Layout(views::View* host) { | 255 void BrowserViewLayout::Layout(views::View* host) { |
| 256 vertical_layout_rect_ = browser_view_->GetLocalBounds(true); | 256 vertical_layout_rect_ = browser_view_->GetLocalBounds(true); |
| 257 LayoutExtensionAppIconAndTitle(); | 257 LayoutExtensionAppIconAndTitle(); |
| 258 int top = LayoutTabStrip(); | 258 int top = LayoutTabStrip(); |
| 259 if (browser_view_->IsTabStripVisible() && !browser_view_->UseVerticalTabs()) { | 259 if (browser_view_->IsTabStripVisible() && !browser_view_->UseVerticalTabs()) { |
| 260 tabstrip_->SetBackgroundOffset(gfx::Point( | 260 tabstrip_->SetBackgroundOffset(gfx::Point( |
| 261 tabstrip_->x() - browser_view_->GetToolbarBounds().x(), | 261 tabstrip_->MirroredX() + browser_view_->MirroredX(), |
| 262 tabstrip_->y())); | 262 browser_view_->frame()->GetHorizontalTabStripVerticalOffset(false))); |
| 263 } | 263 } |
| 264 top = LayoutToolbar(top); | 264 top = LayoutToolbar(top); |
| 265 top = LayoutBookmarkAndInfoBars(top); | 265 top = LayoutBookmarkAndInfoBars(top); |
| 266 int bottom = LayoutExtensionAndDownloadShelves(); | 266 int bottom = LayoutExtensionAndDownloadShelves(); |
| 267 LayoutTabContents(top, bottom); | 267 LayoutTabContents(top, bottom); |
| 268 // This must be done _after_ we lay out the TabContents since this | 268 // This must be done _after_ we lay out the TabContents since this |
| 269 // code calls back into us to find the bounding box the find bar | 269 // code calls back into us to find the bounding box the find bar |
| 270 // must be laid out within, and that code depends on the | 270 // must be laid out within, and that code depends on the |
| 271 // TabContentsContainer's bounds being up to date. | 271 // TabContentsContainer's bounds being up to date. |
| 272 if (browser()->HasFindBarController()) { | 272 if (browser()->HasFindBarController()) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 bottom -= height; | 452 bottom -= height; |
| 453 } | 453 } |
| 454 return bottom; | 454 return bottom; |
| 455 } | 455 } |
| 456 | 456 |
| 457 bool BrowserViewLayout::InfobarVisible() const { | 457 bool BrowserViewLayout::InfobarVisible() const { |
| 458 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 458 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 459 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 459 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 460 (infobar_container_->GetPreferredSize().height() != 0); | 460 (infobar_container_->GetPreferredSize().height() != 0); |
| 461 } | 461 } |
| OLD | NEW |