| 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/app_panel_browser_frame_view.h" | 5 #include "chrome/browser/views/frame/app_panel_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 gfx::Rect AppPanelBrowserFrameView::GetWindowBoundsForClientBounds( | 146 gfx::Rect AppPanelBrowserFrameView::GetWindowBoundsForClientBounds( |
| 147 const gfx::Rect& client_bounds) const { | 147 const gfx::Rect& client_bounds) const { |
| 148 int top_height = NonClientTopBorderHeight(); | 148 int top_height = NonClientTopBorderHeight(); |
| 149 int border_thickness = NonClientBorderThickness(); | 149 int border_thickness = NonClientBorderThickness(); |
| 150 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), | 150 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), |
| 151 std::max(0, client_bounds.y() - top_height), | 151 std::max(0, client_bounds.y() - top_height), |
| 152 client_bounds.width() + (2 * border_thickness), | 152 client_bounds.width() + (2 * border_thickness), |
| 153 client_bounds.height() + top_height + border_thickness); | 153 client_bounds.height() + top_height + border_thickness); |
| 154 } | 154 } |
| 155 | 155 |
| 156 gfx::Point AppPanelBrowserFrameView::GetSystemMenuPoint() const { | |
| 157 gfx::Point system_menu_point( | |
| 158 MirroredXCoordinateInsideView(FrameBorderThickness()), | |
| 159 NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() - | |
| 160 kClientEdgeThickness); | |
| 161 ConvertPointToScreen(this, &system_menu_point); | |
| 162 return system_menu_point; | |
| 163 } | |
| 164 | |
| 165 int AppPanelBrowserFrameView::NonClientHitTest(const gfx::Point& point) { | 156 int AppPanelBrowserFrameView::NonClientHitTest(const gfx::Point& point) { |
| 166 if (!bounds().Contains(point)) | 157 if (!bounds().Contains(point)) |
| 167 return HTNOWHERE; | 158 return HTNOWHERE; |
| 168 | 159 |
| 169 int frame_component = | 160 int frame_component = |
| 170 frame_->GetWindow()->GetClientView()->NonClientHitTest(point); | 161 frame_->GetWindow()->GetClientView()->NonClientHitTest(point); |
| 171 if (frame_component != HTNOWHERE) | 162 if (frame_component != HTNOWHERE) |
| 172 return frame_component; | 163 return frame_component; |
| 173 | 164 |
| 174 // Then see if the point is within any of the window controls. | 165 // Then see if the point is within any of the window controls. |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 507 } |
| 517 | 508 |
| 518 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 509 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
| 519 int height) const { | 510 int height) const { |
| 520 int top_height = NonClientTopBorderHeight(); | 511 int top_height = NonClientTopBorderHeight(); |
| 521 int border_thickness = NonClientBorderThickness(); | 512 int border_thickness = NonClientBorderThickness(); |
| 522 return gfx::Rect(border_thickness, top_height, | 513 return gfx::Rect(border_thickness, top_height, |
| 523 std::max(0, width - (2 * border_thickness)), | 514 std::max(0, width - (2 * border_thickness)), |
| 524 std::max(0, height - top_height - border_thickness)); | 515 std::max(0, height - top_height - border_thickness)); |
| 525 } | 516 } |
| OLD | NEW |