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

Unified Diff: ash/shelf/shelf_bezel_event_filter.h

Issue 15931005: Move bezel event routing for the shelf into ShelfLayoutManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed failing test after discussing with sadrul Created 7 years, 6 months 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
« no previous file with comments | « ash/ash.gyp ('k') | ash/shelf/shelf_bezel_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_bezel_event_filter.h
diff --git a/ash/shelf/shelf_bezel_event_filter.h b/ash/shelf/shelf_bezel_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..028e5b7bed4f8052eb29140e8df8330e77be01ee
--- /dev/null
+++ b/ash/shelf/shelf_bezel_event_filter.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2013 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_SHELF_SHELF_BEZEL_EVENT_FILTER_H_
+#define ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_
+
+#include "ash/wm/gestures/shelf_gesture_handler.h"
+#include "ui/base/events/event_handler.h"
+#include "ui/gfx/rect.h"
+
+namespace ash {
+namespace internal {
+class ShelfLayoutManager;
+
+// Detects and forwards touch gestures that occur on a bezel sensor to the
+// shelf.
+class ShelfBezelEventFilter : public ui::EventHandler {
+ public:
+ explicit ShelfBezelEventFilter(ShelfLayoutManager* shelf);
+ virtual ~ShelfBezelEventFilter();
+
+ // Overridden from ui::EventHandler:
+ virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+
+ private:
+ bool IsShelfOnBezel(const gfx::Rect& screen,
+ const gfx::Point& point) const;
+
+ ShelfLayoutManager* shelf_; // non-owned
+ bool in_touch_drag_;
+ ShelfGestureHandler gesture_handler_;
+ DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventFilter);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_
« no previous file with comments | « ash/ash.gyp ('k') | ash/shelf/shelf_bezel_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698