| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/wm/workspace/two_step_edge_cycler.h" | 5 #include "ash/wm/workspace/two_step_edge_cycler.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 // We cycle to the second mode if any of the following happens while the mouse | 12 // We cycle to the second mode if any of the following happens while the mouse |
| 13 // is on the edge of the workspace: | 13 // is on the edge of the workspace: |
| 14 // . The user stops moving the mouse for |kMaxDelay| and then moves the mouse | 14 // . The user stops moving the mouse for |kMaxDelay| and then moves the mouse |
| 15 // again in the preferred direction from the last paused location for at least | 15 // again in the preferred direction from the last paused location for at least |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 ++num_moves_; | 55 ++num_moves_; |
| 56 bool moved_in_the_same_direction_after_pause = | 56 bool moved_in_the_same_direction_after_pause = |
| 57 paused_ && std::abs(location.x() - paused_x_) >= kMaxPixelsAfterPause; | 57 paused_ && std::abs(location.x() - paused_x_) >= kMaxPixelsAfterPause; |
| 58 second_mode_ = moved_in_the_same_direction_after_pause || | 58 second_mode_ = moved_in_the_same_direction_after_pause || |
| 59 std::abs(location.x() - start_x_) >= kMaxPixels || | 59 std::abs(location.x() - start_x_) >= kMaxPixels || |
| 60 num_moves_ >= kMaxMoves; | 60 num_moves_ >= kMaxMoves; |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace ash | 63 } // namespace ash |
| OLD | NEW |