| 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" |
| 11 #include "chrome/browser/ui/views/bookmark_bar_view.h" | 11 #include "chrome/browser/ui/views/bookmark_bar_view.h" |
| 12 #include "chrome/browser/ui/views/download_shelf_view.h" | 12 #include "chrome/browser/ui/views/download_shelf_view.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_frame.h" | 13 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 14 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 15 #include "chrome/browser/ui/views/frame/contents_container.h" | 15 #include "chrome/browser/ui/views/frame/contents_container.h" |
| 16 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 16 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 17 #include "chrome/browser/ui/views/tabs/side_tab_strip.h" | 17 #include "chrome/browser/ui/views/tabs/side_tab_strip.h" |
| 18 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 18 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 19 #include "chrome/browser/ui/views/toolbar_view.h" | 19 #include "chrome/browser/ui/views/toolbar_view.h" |
| 20 #include "gfx/scrollbar_size.h" | 20 #include "gfx/scrollbar_size.h" |
| 21 #include "gfx/point.h" |
| 22 #include "gfx/size.h" |
| 21 #include "views/controls/single_split_view.h" | 23 #include "views/controls/single_split_view.h" |
| 22 #include "views/window/window.h" | 24 #include "views/window/window.h" |
| 23 | 25 |
| 24 #if defined(OS_LINUX) | 26 #if defined(OS_LINUX) |
| 25 #include "views/window/hit_test.h" | 27 #include "views/window/hit_test.h" |
| 26 #endif | 28 #endif |
| 27 | 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 // The visible height of the shadow above the tabs. Clicks in this area are | 32 // The visible height of the shadow above the tabs. Clicks in this area are |
| (...skipping 15 matching lines...) Expand all Loading... |
| 46 toolbar_(NULL), | 48 toolbar_(NULL), |
| 47 contents_split_(NULL), | 49 contents_split_(NULL), |
| 48 contents_container_(NULL), | 50 contents_container_(NULL), |
| 49 infobar_container_(NULL), | 51 infobar_container_(NULL), |
| 50 download_shelf_(NULL), | 52 download_shelf_(NULL), |
| 51 active_bookmark_bar_(NULL), | 53 active_bookmark_bar_(NULL), |
| 52 browser_view_(NULL), | 54 browser_view_(NULL), |
| 53 find_bar_y_(0) { | 55 find_bar_y_(0) { |
| 54 } | 56 } |
| 55 | 57 |
| 58 BrowserViewLayout::~BrowserViewLayout() { |
| 59 } |
| 60 |
| 56 gfx::Size BrowserViewLayout::GetMinimumSize() { | 61 gfx::Size BrowserViewLayout::GetMinimumSize() { |
| 57 // TODO(noname): In theory the tabstrip width should probably be | 62 // TODO(noname): In theory the tabstrip width should probably be |
| 58 // (OTR + tabstrip + caption buttons) width. | 63 // (OTR + tabstrip + caption buttons) width. |
| 59 gfx::Size tabstrip_size( | 64 gfx::Size tabstrip_size( |
| 60 browser()->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ? | 65 browser()->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ? |
| 61 tabstrip_->GetMinimumSize() : gfx::Size()); | 66 tabstrip_->GetMinimumSize() : gfx::Size()); |
| 62 gfx::Size toolbar_size( | 67 gfx::Size toolbar_size( |
| 63 (browser()->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || | 68 (browser()->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || |
| 64 browser()->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) ? | 69 browser()->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) ? |
| 65 toolbar_->GetMinimumSize() : gfx::Size()); | 70 toolbar_->GetMinimumSize() : gfx::Size()); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 bottom -= height; | 515 bottom -= height; |
| 511 } | 516 } |
| 512 return bottom; | 517 return bottom; |
| 513 } | 518 } |
| 514 | 519 |
| 515 bool BrowserViewLayout::InfobarVisible() const { | 520 bool BrowserViewLayout::InfobarVisible() const { |
| 516 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 521 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 517 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 522 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 518 (infobar_container_->GetPreferredSize().height() != 0); | 523 (infobar_container_->GetPreferredSize().height() != 0); |
| 519 } | 524 } |
| OLD | NEW |