| 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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "app/theme_provider.h" | 9 #include "app/theme_provider.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { | 176 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { |
| 177 } | 177 } |
| 178 | 178 |
| 179 /////////////////////////////////////////////////////////////////////////////// | 179 /////////////////////////////////////////////////////////////////////////////// |
| 180 // OpaqueBrowserFrameView, protected: | 180 // OpaqueBrowserFrameView, protected: |
| 181 | 181 |
| 182 int OpaqueBrowserFrameView::GetReservedHeight() const { | 182 int OpaqueBrowserFrameView::GetReservedHeight() const { |
| 183 return 0; | 183 return 0; |
| 184 } | 184 } |
| 185 | 185 |
| 186 gfx::Rect OpaqueBrowserFrameView::GetBoundsForReservedArea() const { |
| 187 gfx::Rect client_view_bounds = CalculateClientAreaBounds(width(), height()); |
| 188 return gfx::Rect( |
| 189 client_view_bounds.x(), |
| 190 client_view_bounds.y() + client_view_bounds.height(), |
| 191 client_view_bounds.width(), |
| 192 GetReservedHeight()); |
| 193 } |
| 194 |
| 186 /////////////////////////////////////////////////////////////////////////////// | 195 /////////////////////////////////////////////////////////////////////////////// |
| 187 // OpaqueBrowserFrameView, BrowserNonClientFrameView implementation: | 196 // OpaqueBrowserFrameView, BrowserNonClientFrameView implementation: |
| 188 | 197 |
| 189 gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip( | 198 gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip( |
| 190 BaseTabStrip* tabstrip) const { | 199 BaseTabStrip* tabstrip) const { |
| 191 if (browser_view_->UseVerticalTabs()) { | 200 if (browser_view_->UseVerticalTabs()) { |
| 192 gfx::Size ps = tabstrip->GetPreferredSize(); | 201 gfx::Size ps = tabstrip->GetPreferredSize(); |
| 193 return gfx::Rect(NonClientBorderThickness(), | 202 return gfx::Rect(NonClientBorderThickness(), |
| 194 NonClientTopBorderHeight(false, false), ps.width(), | 203 NonClientTopBorderHeight(false, false), ps.width(), |
| 195 browser_view_->height()); | 204 browser_view_->height()); |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 | 1060 |
| 1052 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1061 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
| 1053 int height) const { | 1062 int height) const { |
| 1054 int top_height = NonClientTopBorderHeight(false, false); | 1063 int top_height = NonClientTopBorderHeight(false, false); |
| 1055 int border_thickness = NonClientBorderThickness(); | 1064 int border_thickness = NonClientBorderThickness(); |
| 1056 return gfx::Rect(border_thickness, top_height, | 1065 return gfx::Rect(border_thickness, top_height, |
| 1057 std::max(0, width - (2 * border_thickness)), | 1066 std::max(0, width - (2 * border_thickness)), |
| 1058 std::max(0, height - GetReservedHeight() - | 1067 std::max(0, height - GetReservedHeight() - |
| 1059 top_height - border_thickness)); | 1068 top_height - border_thickness)); |
| 1060 } | 1069 } |
| OLD | NEW |