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/app_panel_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/views/frame/browser_frame.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (frame_->IsMaximized()) | 150 if (frame_->IsMaximized()) |
151 sysmenu_rect.SetRect(0, 0, sysmenu_rect.right(), sysmenu_rect.bottom()); | 151 sysmenu_rect.SetRect(0, 0, sysmenu_rect.right(), sysmenu_rect.bottom()); |
152 sysmenu_rect.set_x(GetMirroredXForRect(sysmenu_rect)); | 152 sysmenu_rect.set_x(GetMirroredXForRect(sysmenu_rect)); |
153 if (sysmenu_rect.Contains(point)) | 153 if (sysmenu_rect.Contains(point)) |
154 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; | 154 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; |
155 | 155 |
156 if (frame_component != HTNOWHERE) | 156 if (frame_component != HTNOWHERE) |
157 return frame_component; | 157 return frame_component; |
158 | 158 |
159 // Then see if the point is within any of the window controls. | 159 // Then see if the point is within any of the window controls. |
160 if (close_button_->IsVisible() && | 160 if (close_button_->visible() && |
161 close_button_->GetMirroredBounds().Contains(point)) | 161 close_button_->GetMirroredBounds().Contains(point)) |
162 return HTCLOSE; | 162 return HTCLOSE; |
163 | 163 |
164 int window_component = GetHTComponentForFrame(point, | 164 int window_component = GetHTComponentForFrame(point, |
165 NonClientBorderThickness(), NonClientBorderThickness(), | 165 NonClientBorderThickness(), NonClientBorderThickness(), |
166 kResizeAreaCornerSize, kResizeAreaCornerSize, | 166 kResizeAreaCornerSize, kResizeAreaCornerSize, |
167 frame_->window_delegate()->CanResize()); | 167 frame_->window_delegate()->CanResize()); |
168 // Fall back to the caption if no other component matches. | 168 // Fall back to the caption if no other component matches. |
169 return (window_component == HTNOWHERE) ? HTCAPTION : window_component; | 169 return (window_component == HTNOWHERE) ? HTCAPTION : window_component; |
170 } | 170 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 } | 495 } |
496 | 496 |
497 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 497 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
498 int height) const { | 498 int height) const { |
499 int top_height = NonClientTopBorderHeight(); | 499 int top_height = NonClientTopBorderHeight(); |
500 int border_thickness = NonClientBorderThickness(); | 500 int border_thickness = NonClientBorderThickness(); |
501 return gfx::Rect(border_thickness, top_height, | 501 return gfx::Rect(border_thickness, top_height, |
502 std::max(0, width - (2 * border_thickness)), | 502 std::max(0, width - (2 * border_thickness)), |
503 std::max(0, height - top_height - border_thickness)); | 503 std::max(0, height - top_height - border_thickness)); |
504 } | 504 } |
OLD | NEW |