blob: 06d2f35802d1e744a58d44d0c008f5518a843cab [file] [log] [blame]
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:321// 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 Kaznacheev96a9abb2017-08-17 01:43:3711#include "base/time/time.h"
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3212#include "ui/views/view.h"
13
14namespace aura {
15class Window;
16}
17
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3218namespace ui {
19class Layer;
20}
21
22namespace views {
23class Widget;
24}
25
26namespace ash {
27
Vladislav Kaznacheev96a9abb2017-08-17 01:43:3728enum class HighlighterGestureType;
29
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3230// HighlighterResultView displays an animated shape that represents
31// the result of the selection.
32class HighlighterResultView : public views::View {
33 public:
34 HighlighterResultView(aura::Window* root_window);
35
36 ~HighlighterResultView() override;
37
Vladislav Kaznacheev35e2cdbd2017-08-04 22:40:2638 void Animate(const gfx::RectF& bounds,
Vladislav Kaznacheev96a9abb2017-08-17 01:43:3739 HighlighterGestureType gesture_type,
Vladislav Kaznacheev35e2cdbd2017-08-04 22:40:2640 const base::Closure& done);
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3241
42 private:
Vladislav Kaznacheev35e2cdbd2017-08-04 22:40:2643 void FadeIn(const base::TimeDelta& duration, const base::Closure& done);
44 void FadeOut(const base::Closure& done);
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3245
46 std::unique_ptr<views::Widget> widget_;
47 std::unique_ptr<ui::Layer> result_layer_;
Vladislav Kaznacheev35e2cdbd2017-08-04 22:40:2648 std::unique_ptr<base::OneShotTimer> animation_timer_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:3249
50 DISALLOW_COPY_AND_ASSIGN(HighlighterResultView);
51};
52
53} // namespace ash
54
55#endif // ASH_HIGHLIGHTER_HIGHLIGHTER_RESULT_VIEW_H_