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