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 "ash/wm/frame_painter.h" | 5 #include "ash/wm/frame_painter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 gfx::Rect expanded_bounds = view->bounds(); | 306 gfx::Rect expanded_bounds = view->bounds(); |
307 int outside_bounds = kResizeOutsideBoundsSize; | 307 int outside_bounds = kResizeOutsideBoundsSize; |
308 | 308 |
309 if (aura::Env::GetInstance()->is_touch_down()) | 309 if (aura::Env::GetInstance()->is_touch_down()) |
310 outside_bounds *= kResizeOutsideBoundsScaleForTouch; | 310 outside_bounds *= kResizeOutsideBoundsScaleForTouch; |
311 expanded_bounds.Inset(-outside_bounds, -outside_bounds); | 311 expanded_bounds.Inset(-outside_bounds, -outside_bounds); |
312 | 312 |
313 if (!expanded_bounds.Contains(point)) | 313 if (!expanded_bounds.Contains(point)) |
314 return HTNOWHERE; | 314 return HTNOWHERE; |
315 | 315 |
316 // No avatar button. | |
317 | |
318 // Check the frame first, as we allow a small area overlapping the contents | 316 // Check the frame first, as we allow a small area overlapping the contents |
319 // to be used for resize handles. | 317 // to be used for resize handles. |
320 bool can_ever_resize = frame_->widget_delegate() ? | 318 bool can_ever_resize = frame_->widget_delegate() ? |
321 frame_->widget_delegate()->CanResize() : | 319 frame_->widget_delegate()->CanResize() : |
322 false; | 320 false; |
323 // Don't allow overlapping resize handles when the window is maximized or | 321 // Don't allow overlapping resize handles when the window is maximized or |
324 // fullscreen, as it can't be resized in those states. | 322 // fullscreen, as it can't be resized in those states. |
325 int resize_border = | 323 int resize_border = |
326 frame_->IsMaximized() || frame_->IsFullscreen() ? 0 : | 324 frame_->IsMaximized() || frame_->IsFullscreen() ? 0 : |
327 kResizeInsideBoundsSize; | 325 kResizeInsideBoundsSize; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // icon. Don't use |window_icon_| for this computation as it may be NULL. | 828 // icon. Don't use |window_icon_| for this computation as it may be NULL. |
831 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; | 829 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; |
832 return gfx::Rect( | 830 return gfx::Rect( |
833 title_x, | 831 title_x, |
834 std::max(0, title_y), | 832 std::max(0, title_y), |
835 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), | 833 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), |
836 title_font.GetHeight()); | 834 title_font.GetHeight()); |
837 } | 835 } |
838 | 836 |
839 } // namespace ash | 837 } // namespace ash |
OLD | NEW |