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

Unified Diff: ash/autoclick/autoclick_controller.h

Issue 2016073004: Show a visual indicator for the progress of auto-click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed errors from patch set 5. Created 4 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
Index: ash/autoclick/autoclick_controller.h
diff --git a/ash/autoclick/autoclick_controller.h b/ash/autoclick/autoclick_controller.h
index 46b9ef48089678fab9e38bc0bebfbc1c67411b14..17ccdffc623d1ad71311d527ed18179e59d923ad 100644
--- a/ash/autoclick/autoclick_controller.h
+++ b/ash/autoclick/autoclick_controller.h
@@ -5,7 +5,12 @@
#ifndef ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H
#define ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H
+#include <memory>
+
#include "ash/ash_export.h"
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "ui/gfx/geometry/point.h"
namespace ash {
@@ -14,8 +19,30 @@ namespace ash {
// the mouse had been at rest.
class ASH_EXPORT AutoclickController {
public:
+ class Delegate {
+ public:
+ Delegate() {}
+ virtual ~Delegate() {}
+
+ // Called when an autoclick gesture begins.
oshima 2016/06/15 21:26:28 document the coordinate of |center|. I assume it's
sammiequon 2016/06/15 23:19:59 Done.
+ virtual void StartGesture(base::TimeDelta duration, gfx::Point center) = 0;
oshima 2016/06/15 21:26:28 const gfx::Point&
sammiequon 2016/06/15 23:19:59 Done.
+
+ // Called when the gesture has ended, either because the mouse moved or
+ // because the autoclick completed.
+ virtual void StopGesture() = 0;
+
+ // Called when the autoclick target has changed.
+ virtual void SetGestureCenter(gfx::Point center) = 0;
oshima 2016/06/15 21:26:28 ditto
sammiequon 2016/06/15 23:19:59 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
virtual ~AutoclickController() {}
+ // Set the delegate to work with.
+ virtual void SetDelegate(std::unique_ptr<Delegate> delegate) = 0;
+
// Set whether autoclicking is enabled.
virtual void SetEnabled(bool enabled) = 0;
@@ -24,10 +51,10 @@ class ASH_EXPORT AutoclickController {
// Set the time to wait in milliseconds from when the mouse stops moving
// to when the autoclick event is sent.
- virtual void SetAutoclickDelay(int delay_ms) = 0;
+ virtual void SetAutoclickDelay(base::TimeDelta delay) = 0;
// Returns the autoclick delay in milliseconds.
- virtual int GetAutoclickDelay() const = 0;
+ virtual base::TimeDelta GetAutoclickDelay() const = 0;
static AutoclickController* CreateInstance();
@@ -35,6 +62,9 @@ class ASH_EXPORT AutoclickController {
// the autoclick.
static const int kDefaultAutoclickDelayMs;
+ // Gets the default wait time as a base::TimeDelta object.
+ static base::TimeDelta GetDefaultAutoclickDelay();
+
protected:
AutoclickController() {}
};
« no previous file with comments | « no previous file | ash/autoclick/autoclick_controller.cc » ('j') | chrome/browser/chromeos/ui/autoclick_ring_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698