| 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/workspace/multi_window_resize_controller.h" | 5 #include "ash/wm/workspace/multi_window_resize_controller.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "ash/wm/workspace/workspace_window_resizer.h" | 10 #include "ash/wm/workspace/workspace_window_resizer.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 // View contained in the widget. Passes along mouse events to the | 85 // View contained in the widget. Passes along mouse events to the |
| 86 // MultiWindowResizeController so that it can start/stop the resize loop. | 86 // MultiWindowResizeController so that it can start/stop the resize loop. |
| 87 class MultiWindowResizeController::ResizeView : public views::View { | 87 class MultiWindowResizeController::ResizeView : public views::View { |
| 88 public: | 88 public: |
| 89 explicit ResizeView(MultiWindowResizeController* controller, | 89 explicit ResizeView(MultiWindowResizeController* controller, |
| 90 Direction direction) | 90 Direction direction) |
| 91 : controller_(controller), direction_(direction) {} | 91 : controller_(controller), direction_(direction) {} |
| 92 | 92 |
| 93 // views::View overrides: | 93 // views::View overrides: |
| 94 gfx::Size GetPreferredSize() const override { | 94 gfx::Size CalculatePreferredSize() const override { |
| 95 const bool vert = direction_ == LEFT_RIGHT; | 95 const bool vert = direction_ == LEFT_RIGHT; |
| 96 return gfx::Size(vert ? kShortSide : kLongSide, | 96 return gfx::Size(vert ? kShortSide : kLongSide, |
| 97 vert ? kLongSide : kShortSide); | 97 vert ? kLongSide : kShortSide); |
| 98 } | 98 } |
| 99 void OnPaint(gfx::Canvas* canvas) override { | 99 void OnPaint(gfx::Canvas* canvas) override { |
| 100 cc::PaintFlags flags; | 100 cc::PaintFlags flags; |
| 101 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x7F)); | 101 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x7F)); |
| 102 flags.setAntiAlias(true); | 102 flags.setAntiAlias(true); |
| 103 canvas->DrawRoundRect(gfx::RectF(GetLocalBounds()), 2, flags); | 103 canvas->DrawRoundRect(gfx::RectF(GetLocalBounds()), 2, flags); |
| 104 | 104 |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 const gfx::Point& location_in_screen, | 597 const gfx::Point& location_in_screen, |
| 598 int component) const { | 598 int component) const { |
| 599 gfx::Point window_loc = ConvertPointFromScreen(window, location_in_screen); | 599 gfx::Point window_loc = ConvertPointFromScreen(window, location_in_screen); |
| 600 const int window_component = | 600 const int window_component = |
| 601 window->delegate() ? window->delegate()->GetNonClientComponent(window_loc) | 601 window->delegate() ? window->delegate()->GetNonClientComponent(window_loc) |
| 602 : HTNOWHERE; | 602 : HTNOWHERE; |
| 603 return window_component == component; | 603 return window_component == component; |
| 604 } | 604 } |
| 605 | 605 |
| 606 } // namespace ash | 606 } // namespace ash |
| OLD | NEW |