Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 1 | // Copyright 2017 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 ASH_HIGHLIGHTER_HIGHLIGHTER_RESULT_VIEW_H_ |
| 6 | #define ASH_HIGHLIGHTER_HIGHLIGHTER_RESULT_VIEW_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
| 10 | #include "base/macros.h" |
Vladislav Kaznacheev | 96a9abb | 2017-08-17 01:43:37 | [diff] [blame] | 11 | #include "base/time/time.h" |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 12 | #include "ui/views/view.h" |
| 13 | |
| 14 | namespace aura { |
| 15 | class Window; |
| 16 | } |
| 17 | |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 18 | namespace ui { |
| 19 | class Layer; |
| 20 | } |
| 21 | |
| 22 | namespace views { |
| 23 | class Widget; |
| 24 | } |
| 25 | |
| 26 | namespace ash { |
| 27 | |
Vladislav Kaznacheev | 96a9abb | 2017-08-17 01:43:37 | [diff] [blame] | 28 | enum class HighlighterGestureType; |
| 29 | |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 30 | // HighlighterResultView displays an animated shape that represents |
| 31 | // the result of the selection. |
| 32 | class HighlighterResultView : public views::View { |
| 33 | public: |
| 34 | HighlighterResultView(aura::Window* root_window); |
| 35 | |
| 36 | ~HighlighterResultView() override; |
| 37 | |
Vladislav Kaznacheev | 35e2cdbd | 2017-08-04 22:40:26 | [diff] [blame] | 38 | void Animate(const gfx::RectF& bounds, |
Vladislav Kaznacheev | 96a9abb | 2017-08-17 01:43:37 | [diff] [blame] | 39 | HighlighterGestureType gesture_type, |
Vladislav Kaznacheev | 35e2cdbd | 2017-08-04 22:40:26 | [diff] [blame] | 40 | const base::Closure& done); |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 41 | |
| 42 | private: |
Vladislav Kaznacheev | 35e2cdbd | 2017-08-04 22:40:26 | [diff] [blame] | 43 | void FadeIn(const base::TimeDelta& duration, const base::Closure& done); |
| 44 | void FadeOut(const base::Closure& done); |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 45 | |
| 46 | std::unique_ptr<views::Widget> widget_; |
| 47 | std::unique_ptr<ui::Layer> result_layer_; |
Vladislav Kaznacheev | 35e2cdbd | 2017-08-04 22:40:26 | [diff] [blame] | 48 | std::unique_ptr<base::OneShotTimer> animation_timer_; |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 49 | |
| 50 | DISALLOW_COPY_AND_ASSIGN(HighlighterResultView); |
| 51 | }; |
| 52 | |
| 53 | } // namespace ash |
| 54 | |
| 55 | #endif // ASH_HIGHLIGHTER_HIGHLIGHTER_RESULT_VIEW_H_ |