OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "ui/base/events/event_handler.h" |
| 12 |
| 13 namespace ash { |
| 14 namespace internal { |
| 15 |
| 16 class WorkspaceManager; |
| 17 |
| 18 // Class to enable quick workspace switching (scrubbing) via 3 finger vertical |
| 19 // scroll. |
| 20 class ASH_EXPORT WorkspaceCycler : public ui::EventHandler { |
| 21 public: |
| 22 explicit WorkspaceCycler(WorkspaceManager* workspace_manager); |
| 23 virtual ~WorkspaceCycler(); |
| 24 |
| 25 private: |
| 26 // ui::EventHandler overrides: |
| 27 virtual ui::EventResult OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
| 28 |
| 29 WorkspaceManager* workspace_manager_; |
| 30 |
| 31 // Whether the user is scrubbing through workspaces. |
| 32 bool scrubbing_; |
| 33 |
| 34 // The amount of scrolling which has occurred since the last time the |
| 35 // workspace was switched. If scrubbing has just begun, |scroll_x_| and |
| 36 // |scroll_y_| are set to 0. |
| 37 int scroll_x_; |
| 38 int scroll_y_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(WorkspaceCycler); |
| 41 }; |
| 42 |
| 43 } // namespace internal |
| 44 } // namespace ash |
| 45 |
| 46 #endif // ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_ |
OLD | NEW |