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

Side by Side Diff: chrome/browser/chromeos/ui/autoclick_ring_handler.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: Used a timedelta in autoclick controller instead of int. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_
6 #define CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_
7
8 #include <memory>
9
10 #include "ash/autoclick/autoclick_controller.h"
11 #include "base/macros.h"
12 #include "base/timer/timer.h"
13 #include "ui/aura/window_observer.h"
14 #include "ui/events/event.h"
15 #include "ui/gfx/animation/linear_animation.h"
16 #include "ui/gfx/geometry/point.h"
17
18 namespace chromeos {
19
20 // AutoclickRingHandler displays an animated affordance that is shown
21 // on autoclick gesture. The animation sequence consists of two circles which
22 // shrink towards the spot the autoclick will generate a mouse event.
23 class AutoclickRingHandler : public gfx::LinearAnimation,
24 public aura::WindowObserver,
25 public ash::AutoclickController::Delegate {
26 public:
27 AutoclickRingHandler();
28 ~AutoclickRingHandler() override;
29
30 private:
31 // Overriden from ash::AutoclickController::Delegate.
32 void StartGesture(base::TimeDelta duration, gfx::Point center) override;
33 void StopGesture() override;
34 void SetGestureCenter(gfx::Point center) override;
35
36 class AutoclickRingView;
37
38 enum AnimationType {
39 NONE,
40 GROW_ANIMATION,
41 SHRINK_ANIMATION,
42 };
43
44 aura::Window* GetTargetWindow();
45 void SetTapDownTarget();
46 void StartAnimation(base::TimeDelta duration);
47 void StopAutoclickRing();
48 void SetTapDownTarget(aura::Window* target);
49
50 // Overridden from gfx::LinearAnimation.
51 void AnimateToState(double state) override;
52 void AnimationStopped() override;
53
54 // Overridden from aura::WindowObserver.
55 void OnWindowDestroying(aura::Window* window) override;
56
57 std::unique_ptr<AutoclickRingView> view_;
58 gfx::Point tap_down_location_;
59 aura::Window* tap_down_target_;
60 AnimationType current_animation_type_;
61
62 DISALLOW_COPY_AND_ASSIGN(AutoclickRingHandler);
63 };
64
65 } // namespace chromeos
66
67 #endif // CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698