| 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 #ifndef ASH_WM_WORKSPACE_SNAP_SIZER_H_ | 5 #ifndef ASH_WM_WORKSPACE_SNAP_SIZER_H_ |
| 6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_ | 6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // The bounds used in this class are in the container's coordinates. | 24 // The bounds used in this class are in the container's coordinates. |
| 25 class ASH_EXPORT SnapSizer { | 25 class ASH_EXPORT SnapSizer { |
| 26 public: | 26 public: |
| 27 enum Edge { | 27 enum Edge { |
| 28 LEFT_EDGE, | 28 LEFT_EDGE, |
| 29 RIGHT_EDGE | 29 RIGHT_EDGE |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 enum InputType { | 32 enum InputType { |
| 33 TOUCH_MAXIMIZE_BUTTON_INPUT, | 33 TOUCH_MAXIMIZE_BUTTON_INPUT, |
| 34 TOUCH_DRAG_INPUT, |
| 34 OTHER_INPUT | 35 OTHER_INPUT |
| 35 }; | 36 }; |
| 36 | 37 |
| 38 // Snapping is made easier with a touch drag when using touchscreen. |
| 39 static const int kScreenEdgeInsetForTouchDrag; |
| 40 |
| 37 // Set |input_type| to |TOUCH_MAXIMIZE_BUTTON_INPUT| when called by a touch | 41 // Set |input_type| to |TOUCH_MAXIMIZE_BUTTON_INPUT| when called by a touch |
| 38 // operation by the maximize button. This will allow the user to snap resize | 42 // operation by the maximize button. This will allow the user to snap resize |
| 39 // the window beginning close to the border. | 43 // the window beginning close to the border. |
| 40 SnapSizer(wm::WindowState* window_state, | 44 SnapSizer(wm::WindowState* window_state, |
| 41 const gfx::Point& start, | 45 const gfx::Point& start, |
| 42 Edge edge, | 46 Edge edge, |
| 43 InputType input_type); | 47 InputType input_type); |
| 44 virtual ~SnapSizer(); | 48 virtual ~SnapSizer(); |
| 45 | 49 |
| 46 // Snaps a window left or right. | 50 // Snaps a window left or right. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // sizer gets created. | 135 // sizer gets created. |
| 132 const std::vector<int> usable_width_; | 136 const std::vector<int> usable_width_; |
| 133 | 137 |
| 134 DISALLOW_COPY_AND_ASSIGN(SnapSizer); | 138 DISALLOW_COPY_AND_ASSIGN(SnapSizer); |
| 135 }; | 139 }; |
| 136 | 140 |
| 137 } // namespace internal | 141 } // namespace internal |
| 138 } // namespace ash | 142 } // namespace ash |
| 139 | 143 |
| 140 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_ | 144 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_ |
| OLD | NEW |