| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/window/custom_frame_view.h" | 5 #include "chrome/views/window/custom_frame_view.h" |
| 6 | 6 |
| 7 #include "base/win_util.h" | 7 #include "base/win_util.h" |
| 8 #include "chrome/common/gfx/path.h" | 8 #include "chrome/common/gfx/path.h" |
| 9 #include "chrome/common/gfx/chrome_canvas.h" | 9 #include "chrome/common/gfx/chrome_canvas.h" |
| 10 #include "chrome/common/gfx/chrome_font.h" | 10 #include "chrome/common/gfx/chrome_font.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 const gfx::Rect& client_bounds) const { | 275 const gfx::Rect& client_bounds) const { |
| 276 int top_height = NonClientTopBorderHeight(); | 276 int top_height = NonClientTopBorderHeight(); |
| 277 int border_thickness = NonClientBorderThickness(); | 277 int border_thickness = NonClientBorderThickness(); |
| 278 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), | 278 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), |
| 279 std::max(0, client_bounds.y() - top_height), | 279 std::max(0, client_bounds.y() - top_height), |
| 280 client_bounds.width() + (2 * border_thickness), | 280 client_bounds.width() + (2 * border_thickness), |
| 281 client_bounds.height() + top_height + border_thickness); | 281 client_bounds.height() + top_height + border_thickness); |
| 282 } | 282 } |
| 283 | 283 |
| 284 gfx::Point CustomFrameView::GetSystemMenuPoint() const { | 284 gfx::Point CustomFrameView::GetSystemMenuPoint() const { |
| 285 gfx::Point system_menu_point(FrameBorderThickness(), | 285 gfx::Point system_menu_point( |
| 286 MirroredXCoordinateInsideView(FrameBorderThickness()), |
| 286 NonClientTopBorderHeight() - BottomEdgeThicknessWithinNonClientHeight()); | 287 NonClientTopBorderHeight() - BottomEdgeThicknessWithinNonClientHeight()); |
| 287 ConvertPointToScreen(this, &system_menu_point); | 288 ConvertPointToScreen(this, &system_menu_point); |
| 288 return system_menu_point; | 289 return system_menu_point; |
| 289 } | 290 } |
| 290 | 291 |
| 291 int CustomFrameView::NonClientHitTest(const gfx::Point& point) { | 292 int CustomFrameView::NonClientHitTest(const gfx::Point& point) { |
| 292 // Then see if the point is within any of the window controls. | 293 // Then see if the point is within any of the window controls. |
| 293 if (close_button_->GetBounds(APPLY_MIRRORING_TRANSFORMATION).Contains(point)) | 294 if (close_button_->GetBounds(APPLY_MIRRORING_TRANSFORMATION).Contains(point)) |
| 294 return HTCLOSE; | 295 return HTCLOSE; |
| 295 if (restore_button_->GetBounds(APPLY_MIRRORING_TRANSFORMATION).Contains( | 296 if (restore_button_->GetBounds(APPLY_MIRRORING_TRANSFORMATION).Contains( |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 active_resources_ = new ActiveWindowResources; | 688 active_resources_ = new ActiveWindowResources; |
| 688 inactive_resources_ = new InactiveWindowResources; | 689 inactive_resources_ = new InactiveWindowResources; |
| 689 | 690 |
| 690 title_font_ = win_util::GetWindowTitleFont(); | 691 title_font_ = win_util::GetWindowTitleFont(); |
| 691 | 692 |
| 692 initialized = true; | 693 initialized = true; |
| 693 } | 694 } |
| 694 } | 695 } |
| 695 | 696 |
| 696 } // namespace views | 697 } // namespace views |
| OLD | NEW |