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

Unified Diff: ash/autoclick/common/autoclick_controller_common.h

Issue 2193563002: ash: Refactor autoclick common code to ash/autoclick/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: widget; source_set Created 4 years, 4 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/autoclick/common/DEPS ('k') | ash/autoclick/common/autoclick_controller_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/autoclick/common/autoclick_controller_common.h
diff --git a/ash/autoclick/common/autoclick_controller_common.h b/ash/autoclick/common/autoclick_controller_common.h
new file mode 100644
index 0000000000000000000000000000000000000000..177211b94f0f98a3684e88ec13bac0b7f83de4c5
--- /dev/null
+++ b/ash/autoclick/common/autoclick_controller_common.h
@@ -0,0 +1,64 @@
+// Copyright 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_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H
+#define ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H
+
+#include "ash/autoclick/common/autoclick_ring_handler.h"
+#include "base/macros.h"
+#include "base/timer/timer.h"
+#include "ui/gfx/geometry/point.h"
+
+namespace views {
+class Widget;
+}
+
+namespace ui {
+class MouseEvent;
+class KeyEvent;
+class TouchEvent;
+class GestureEvent;
+class ScrollEvent;
+}
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+
+// Autoclick controller common code for ash and mus.
+class AutoclickControllerCommon {
+ public:
+ AutoclickControllerCommon();
+ ~AutoclickControllerCommon();
+
+ void HandleMouseEvent(const ui::MouseEvent& event,
+ aura::Window* target,
+ views::Widget* widget,
+ base::TimeDelta delay);
+ void HandleKeyEvent(const ui::KeyEvent& event);
+ void HandleTouchEvent(const ui::TouchEvent& event);
+ void HandleGestureEvent(const ui::GestureEvent& event);
+ void HandleScrollEvent(const ui::ScrollEvent& event);
+
+ void ResetAutoclickTimer(base::Timer* new_timer);
sadrul 2016/08/09 15:53:16 The common code here should create+own+manage the
riajiang 2016/08/10 20:18:59 Done.
+ void StopAutoclickTimer();
+ void UpdateAnchorLocation(const gfx::Point& anchor_location);
+ int GetMouseEventFlags();
+
+ private:
+ int mouse_event_flags_;
+ std::unique_ptr<base::Timer> autoclick_timer_;
+ // The position in screen coordinates used to determine
+ // the distance the mouse has moved.
+ gfx::Point anchor_location_;
+ std::unique_ptr<AutoclickRingHandler> autoclick_ring_handler_;
+
sadrul 2016/08/09 15:53:16 This common code should also own the views::Widget
riajiang 2016/08/10 20:18:59 Done.
+ DISALLOW_COPY_AND_ASSIGN(AutoclickControllerCommon);
+};
+
+} // namespace ash
+
+#endif // ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H
« no previous file with comments | « ash/autoclick/common/DEPS ('k') | ash/autoclick/common/autoclick_controller_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698