Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: ash/wm/workspace/workspace_cycler.h

Issue 11417150: Implement workspace scrubbing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/workspace/workspace_cycler.h
diff --git a/ash/wm/workspace/workspace_cycler.h b/ash/wm/workspace/workspace_cycler.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f95b9444c529878fb562eaf6e364307034e59aa
--- /dev/null
+++ b/ash/wm/workspace/workspace_cycler.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_
+#define ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ui/base/events/event_handler.h"
+
+namespace ash {
+namespace internal {
+
+class WorkspaceManager;
+
+// Class to enable quick workspace switching (scrubbing) via 3 finger vertical
+// drag.
+class ASH_EXPORT WorkspaceCycler : public ui::EventHandler {
+ public:
+ explicit WorkspaceCycler(WorkspaceManager* workspace_manager);
+ virtual ~WorkspaceCycler();
+
+ private:
+ // ui::EventHandler overrides:
+ virtual ui::EventResult OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
+
+ WorkspaceManager* workspace_manager_;
+
+ // Whether the user is scrubbing through workspaces.
+ bool scrubbing_;
+
+ // The amount of scrolling which has occurred since the last time the
+ // workspace was switched. If scrubbing has just begun, |scroll_x_| and
+ // |scroll_y| are set to 0.
+ int scroll_x_;
+ int scroll_y_;
+
+ DISALLOW_COPY_AND_ASSIGN(WorkspaceCycler);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_WM_WORKSPACE_WORKSPACE_CYCLER_H_

Powered by Google App Engine
This is Rietveld 408576698