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

Unified Diff: ui/views/controls/glow_hover_controller.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/glow_hover_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/glow_hover_controller.h
diff --git a/ui/views/controls/glow_hover_controller.h b/ui/views/controls/glow_hover_controller.h
deleted file mode 100644
index 59d27a714c55717be4c8057fcb4ad04c56ec81a3..0000000000000000000000000000000000000000
--- a/ui/views/controls/glow_hover_controller.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_CONTROLS_GLOW_HOVER_CONTROLLER_H_
-#define UI_VIEWS_CONTROLS_GLOW_HOVER_CONTROLLER_H_
-
-#include "ui/gfx/animation/animation_delegate.h"
-#include "ui/gfx/animation/slide_animation.h"
-#include "ui/views/views_export.h"
-
-namespace gfx {
-class Canvas;
-class ImageSkia;
-class Point;
-}
-
-namespace views {
-
-class View;
-
-// GlowHoverController is responsible for drawing a hover effect as is used by
-// the tabstrip. Typical usage:
-// OnMouseEntered() -> invoke Show().
-// OnMouseMoved() -> invoke SetLocation().
-// OnMouseExited() -> invoke Hide().
-// OnPaint() -> if ShouldDraw() returns true invoke Draw().
-// Internally GlowHoverController uses an animation to animate the glow and
-// invokes SchedulePaint() back on the View as necessary.
-class VIEWS_EXPORT GlowHoverController : public gfx::AnimationDelegate {
- public:
- enum Style {
- SUBTLE,
- PRONOUNCED
- };
-
- explicit GlowHoverController(views::View* view);
- virtual ~GlowHoverController();
-
- // Sets the AnimationContainer used by the animation.
- void SetAnimationContainer(gfx::AnimationContainer* container);
-
- // Sets the location of the hover, relative to the View passed to the
- // constructor.
- void SetLocation(const gfx::Point& location);
-
- // Initiates showing the hover.
- void Show(Style style);
-
- // Hides the hover.
- void Hide();
-
- // Hides the hover immediately.
- void HideImmediately();
-
- // Returns the value of the animation.
- double GetAnimationValue() const;
-
- // Returns true if there is something to be drawn. Use this instead of
- // invoking Draw() if creating |mask_image| is expensive.
- bool ShouldDraw() const;
-
- // If the hover is currently visible it is drawn to the supplied canvas.
- // |mask_image| is used to determine what parts of the canvas to draw on.
- void Draw(gfx::Canvas* canvas, const gfx::ImageSkia& mask_image) const;
-
- // gfx::AnimationDelegate overrides:
- virtual void AnimationEnded(const gfx::Animation* animation) override;
- virtual void AnimationProgressed(const gfx::Animation* animation) override;
-
- private:
- // View we're drawing to.
- views::View* view_;
-
- // Opacity of the glow ramps up over time.
- gfx::SlideAnimation animation_;
-
- // Location of the glow, relative to view.
- gfx::Point location_;
- double opacity_scale_;
-
- DISALLOW_COPY_AND_ASSIGN(GlowHoverController);
-};
-
-} // namespace views
-
-#endif // UI_VIEWS_CONTROLS_GLOW_HOVER_CONTROLLER_H_
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/glow_hover_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698