Chromium Code Reviews| Index: chrome/browser/chromeos/ui/autoclick_ring_handler.h |
| diff --git a/chrome/browser/chromeos/ui/autoclick_ring_handler.h b/chrome/browser/chromeos/ui/autoclick_ring_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..40da6bec80c1b4bcfde8abc35e162f3bb9028e28 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/ui/autoclick_ring_handler.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright (c) 2016 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 CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_ |
| + |
| +#include <memory> |
| + |
| +#include "ash/autoclick/autoclick_controller.h" |
| +#include "base/macros.h" |
| +#include "base/timer/timer.h" |
| +#include "ui/aura/window_observer.h" |
| +#include "ui/events/event.h" |
| +#include "ui/gfx/animation/linear_animation.h" |
| +#include "ui/gfx/geometry/point.h" |
| + |
| +namespace chromeos { |
| + |
| +// AutoclickRingHandler displays an animated affordance that is shown |
| +// on autoclick gesture. The animation sequence consists of two circles which |
| +// shrink towards the spot the autoclick will generate a mouse event. |
| +class AutoclickRingHandler : public gfx::LinearAnimation, |
| + public aura::WindowObserver, |
| + public ash::AutoclickController::Delegate { |
| + public: |
| + AutoclickRingHandler(); |
| + ~AutoclickRingHandler() override; |
| + // Overriden from ash::AutoclickController::Delegate. |
|
jdufault
2016/06/08 17:50:19
Newline between dtor and comment.
sammiequon
2016/06/09 04:03:46
Done.
|
| + void StartGesture(int duration_ms, gfx::Point center) override; |
|
jdufault
2016/06/08 17:50:19
Make overrides private
sammiequon
2016/06/09 04:03:46
Done.
|
| + void StopGesture() override; |
| + void SetGestureCenter(gfx::Point center) override; |
| + |
| + private: |
| + class AutoclickRingView; |
| + |
| + enum AnimationType { |
| + NONE, |
| + GROW_ANIMATION, |
| + SHRINK_ANIMATION, |
| + }; |
| + |
| + aura::Window* GetTargetWindow(); |
| + void SetTapDownTarget(); |
| + void StartAnimation(int duration_ms); |
| + void StopAutoclickRing(); |
| + void SetTapDownTarget(aura::Window* target); |
| + |
| + // Overridden from gfx::LinearAnimation. |
| + void AnimateToState(double state) override; |
| + void AnimationStopped() override; |
| + |
| + // Overridden from aura::WindowObserver. |
| + void OnWindowDestroying(aura::Window* window) override; |
| + |
| + std::unique_ptr<AutoclickRingView> view_; |
| + gfx::Point tap_down_location_; |
| + aura::Window* tap_down_target_; |
| + AnimationType current_animation_type_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutoclickRingHandler); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_ |