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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 case VIEW_ID_BOOKMARK_BAR: | 250 case VIEW_ID_BOOKMARK_BAR: |
251 active_bookmark_bar_ = NULL; | 251 active_bookmark_bar_ = NULL; |
252 break; | 252 break; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 void BrowserViewLayout::Layout(views::View* host) { | 256 void BrowserViewLayout::Layout(views::View* host) { |
257 vertical_layout_rect_ = browser_view_->GetLocalBounds(); | 257 vertical_layout_rect_ = browser_view_->GetLocalBounds(); |
258 int top = LayoutTabStripRegion(); | 258 int top = LayoutTabStripRegion(); |
259 if (browser_view_->IsTabStripVisible()) { | 259 if (browser_view_->IsTabStripVisible()) { |
260 tabstrip_->SetBackgroundOffset(gfx::Point( | 260 int x = tabstrip_->GetMirroredX() + browser_view_->GetMirroredX() + |
261 tabstrip_->GetMirroredX() + browser_view_->GetMirroredX(), | 261 browser_view_->frame()->GetThemeBackgroundXInset(); |
| 262 tabstrip_->SetBackgroundOffset(gfx::Point(x, |
262 browser_view_->frame()->GetTabStripInsets(false).top)); | 263 browser_view_->frame()->GetTabStripInsets(false).top)); |
263 } | 264 } |
264 top = LayoutToolbar(top); | 265 top = LayoutToolbar(top); |
265 top = LayoutBookmarkAndInfoBars(top); | 266 top = LayoutBookmarkAndInfoBars(top); |
266 int bottom = LayoutDownloadShelf(browser_view_->height()); | 267 int bottom = LayoutDownloadShelf(browser_view_->height()); |
267 int active_top_margin = GetTopMarginForActiveContent(); | 268 int active_top_margin = GetTopMarginForActiveContent(); |
268 top -= active_top_margin; | 269 top -= active_top_margin; |
269 contents_container_->SetActiveTopMargin(active_top_margin); | 270 contents_container_->SetActiveTopMargin(active_top_margin); |
270 LayoutTabContents(top, bottom); | 271 LayoutTabContents(top, bottom); |
271 // This must be done _after_ we lay out the WebContents since this | 272 // This must be done _after_ we lay out the WebContents since this |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 bottom -= height; | 478 bottom -= height; |
478 } | 479 } |
479 return bottom; | 480 return bottom; |
480 } | 481 } |
481 | 482 |
482 bool BrowserViewLayout::InfobarVisible() const { | 483 bool BrowserViewLayout::InfobarVisible() const { |
483 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 484 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
484 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 485 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
485 (infobar_container_->GetPreferredSize().height() != 0); | 486 (infobar_container_->GetPreferredSize().height() != 0); |
486 } | 487 } |
OLD | NEW |