OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/strings/utf_string_conversions.h" | 8 #include "base/strings/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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 gfx::Rect AppPanelBrowserFrameView::GetWindowBoundsForClientBounds( | 136 gfx::Rect AppPanelBrowserFrameView::GetWindowBoundsForClientBounds( |
137 const gfx::Rect& client_bounds) const { | 137 const gfx::Rect& client_bounds) const { |
138 int top_height = NonClientTopBorderHeight(); | 138 int top_height = NonClientTopBorderHeight(); |
139 int border_thickness = NonClientBorderThickness(); | 139 int border_thickness = NonClientBorderThickness(); |
140 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), | 140 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), |
141 std::max(0, client_bounds.y() - top_height), | 141 std::max(0, client_bounds.y() - top_height), |
142 client_bounds.width() + (2 * border_thickness), | 142 client_bounds.width() + (2 * border_thickness), |
143 client_bounds.height() + top_height + border_thickness); | 143 client_bounds.height() + top_height + border_thickness); |
144 } | 144 } |
145 | 145 |
146 int AppPanelBrowserFrameView::NonClientHitTest(const gfx::Point& point) { | 146 int AppPanelBrowserFrameView::NonClientHitTest(const gfx::Point& point) const { |
147 if (!bounds().Contains(point)) | 147 if (!bounds().Contains(point)) |
148 return HTNOWHERE; | 148 return HTNOWHERE; |
149 | 149 |
150 int frame_component = frame()->client_view()->NonClientHitTest(point); | 150 int frame_component = frame()->client_view()->NonClientHitTest(point); |
151 | 151 |
152 // See if we're in the sysmenu region. (We check the ClientView first to be | 152 // See if we're in the sysmenu region. (We check the ClientView first to be |
153 // consistent with OpaqueBrowserFrameView; it's not really necessary here.) | 153 // consistent with OpaqueBrowserFrameView; it's not really necessary here.) |
154 gfx::Rect sysmenu_rect(IconBounds()); | 154 gfx::Rect sysmenu_rect(IconBounds()); |
155 // In maximized mode we extend the rect to the screen corner to take advantage | 155 // In maximized mode we extend the rect to the screen corner to take advantage |
156 // of Fitts' Law. | 156 // of Fitts' Law. |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 } | 507 } |
508 | 508 |
509 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 509 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
510 int height) const { | 510 int height) const { |
511 int top_height = NonClientTopBorderHeight(); | 511 int top_height = NonClientTopBorderHeight(); |
512 int border_thickness = NonClientBorderThickness(); | 512 int border_thickness = NonClientBorderThickness(); |
513 return gfx::Rect(border_thickness, top_height, | 513 return gfx::Rect(border_thickness, top_height, |
514 std::max(0, width - (2 * border_thickness)), | 514 std::max(0, width - (2 * border_thickness)), |
515 std::max(0, height - top_height - border_thickness)); | 515 std::max(0, height - top_height - border_thickness)); |
516 } | 516 } |
OLD | NEW |