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

Unified Diff: ash/autoclick/common/autoclick_ring_handler.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: interface 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
Index: ash/autoclick/common/autoclick_ring_handler.h
diff --git a/chrome/browser/chromeos/ui/autoclick_ring_handler.h b/ash/autoclick/common/autoclick_ring_handler.h
similarity index 52%
rename from chrome/browser/chromeos/ui/autoclick_ring_handler.h
rename to ash/autoclick/common/autoclick_ring_handler.h
index 991dfd68b866317ba58e20c016a5a6ae102a794d..bf424e68a4ede94272914bb7cf4d9503963d8982 100644
--- a/chrome/browser/chromeos/ui/autoclick_ring_handler.h
+++ b/ash/autoclick/common/autoclick_ring_handler.h
@@ -1,39 +1,34 @@
-// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Copyright 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_
+#ifndef ASH_AUTOCLICK_COMMON_AUTOCLICK_RING_HANDLER_H_
+#define ASH_AUTOCLICK_COMMON_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"
+#include "ui/views/widget/widget.h"
-namespace chromeos {
+namespace ash {
// 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 {
+class AutoclickRingHandler : public gfx::LinearAnimation {
public:
AutoclickRingHandler();
~AutoclickRingHandler() override;
- private:
- // Overriden from ash::AutoclickController::Delegate.
void StartGesture(base::TimeDelta duration,
- const gfx::Point& center_point_in_screen) override;
- void StopGesture() override;
- void SetGestureCenter(const gfx::Point& center_point_in_screen) override;
+ const gfx::Point& center_point_in_screen,
+ views::Widget* widget);
+ void StopGesture();
+ void SetGestureCenter(const gfx::Point& center_point_in_screen,
+ views::Widget* widget);
+ private:
class AutoclickRingView;
enum class AnimationType {
@@ -42,32 +37,24 @@ class AutoclickRingHandler : public gfx::LinearAnimation,
SHRINK_ANIMATION,
};
- aura::Window* GetTargetWindow();
- void SetTapDownTarget();
void StartAnimation(base::TimeDelta duration);
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_;
+ views::Widget* ring_widget_;
// Location of the simulated mouse event from auto click in screen
// coordinates.
gfx::Point tap_down_location_;
- // The target window is observed by AutoclickRingHandler for the duration of
- // a autoclick gesture.
- aura::Window* tap_down_target_;
AnimationType current_animation_type_;
base::TimeDelta animation_duration_;
DISALLOW_COPY_AND_ASSIGN(AutoclickRingHandler);
};
-} // namespace chromeos
+} // namespace ash
-#endif // CHROME_BROWSER_CHROMEOS_UI_AUTOCLICK_RING_HANDLER_H_
+#endif // ASH_AUTOCLICK_COMMON_AUTOCLICK_RING_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698