| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sidebar/sidebar_manager.h" | 7 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 8 #include "chrome/browser/ui/find_bar/find_bar.h" | 8 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 10 #include "chrome/browser/ui/view_ids.h" | 10 #include "chrome/browser/ui/view_ids.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 tabstrip_bounds.set_origin(tabstrip_origin); | 316 tabstrip_bounds.set_origin(tabstrip_origin); |
| 317 | 317 |
| 318 tabstrip_->SetVisible(true); | 318 tabstrip_->SetVisible(true); |
| 319 tabstrip_->SetBoundsRect(tabstrip_bounds); | 319 tabstrip_->SetBoundsRect(tabstrip_bounds); |
| 320 return tabstrip_bounds.bottom(); | 320 return tabstrip_bounds.bottom(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 int BrowserViewLayout::LayoutToolbar(int top) { | 323 int BrowserViewLayout::LayoutToolbar(int top) { |
| 324 int browser_view_width = vertical_layout_rect_.width(); | 324 int browser_view_width = vertical_layout_rect_.width(); |
| 325 bool toolbar_visible = browser_view_->IsToolbarVisible(); | 325 bool toolbar_visible = browser_view_->IsToolbarVisible(); |
| 326 toolbar_->location_bar()->set_focusable(toolbar_visible); | 326 toolbar_->location_bar()->SetLocationEntryFocusable(toolbar_visible); |
| 327 int y = top; | 327 int y = top; |
| 328 y -= (toolbar_visible && browser_view_->IsTabStripVisible()) ? | 328 y -= (toolbar_visible && browser_view_->IsTabStripVisible()) ? |
| 329 kToolbarTabStripVerticalOverlap : 0; | 329 kToolbarTabStripVerticalOverlap : 0; |
| 330 int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; | 330 int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; |
| 331 toolbar_->SetVisible(toolbar_visible); | 331 toolbar_->SetVisible(toolbar_visible); |
| 332 toolbar_->SetBounds(vertical_layout_rect_.x(), y, browser_view_width, height); | 332 toolbar_->SetBounds(vertical_layout_rect_.x(), y, browser_view_width, height); |
| 333 | 333 |
| 334 return y + height; | 334 return y + height; |
| 335 } | 335 } |
| 336 | 336 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 532 } |
| 533 #endif | 533 #endif |
| 534 return bottom; | 534 return bottom; |
| 535 } | 535 } |
| 536 | 536 |
| 537 bool BrowserViewLayout::InfobarVisible() const { | 537 bool BrowserViewLayout::InfobarVisible() const { |
| 538 // 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. |
| 539 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 539 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 540 (infobar_container_->GetPreferredSize().height() != 0); | 540 (infobar_container_->GetPreferredSize().height() != 0); |
| 541 } | 541 } |
| OLD | NEW |