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

Side by Side Diff: ash/shelf/voice_interaction_overlay.h

Issue 2972923002: Update voice interaction burst animation (Closed)
Patch Set: fix comments Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_ 5 #ifndef ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_
6 #define ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_ 6 #define ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/compositor/layer_animation_observer.h" 12 #include "ui/compositor/layer_animation_observer.h"
13 #include "ui/views/animation/ink_drop_painted_layer_delegates.h" 13 #include "ui/views/animation/ink_drop_painted_layer_delegates.h"
14 #include "ui/views/view.h" 14 #include "ui/views/view.h"
15 15
16 namespace ui {
17 class CallbackLayerAnimationObserver;
18 } // namespace ui
19
16 namespace ash { 20 namespace ash {
17 21
18 class AppListButton; 22 class AppListButton;
23 class VoiceInteractionIconBackground;
19 24
20 class ASH_EXPORT VoiceInteractionOverlay : public views::View { 25 class ASH_EXPORT VoiceInteractionOverlay : public views::View {
21 public: 26 public:
22 explicit VoiceInteractionOverlay(AppListButton* host_view); 27 explicit VoiceInteractionOverlay(AppListButton* host_view);
23 ~VoiceInteractionOverlay() override; 28 ~VoiceInteractionOverlay() override;
24 29
25 void StartAnimation(); 30 void StartAnimation(bool show_icon);
26 void EndAnimation(); 31 void EndAnimation();
27 void BurstAnimation(); 32 void BurstAnimation();
33 void HideAnimation();
34 bool IsBursting() const { return is_bursting_; }
28 35
29 private: 36 private:
37 bool AnimationEndedCallback(
38 const ui::CallbackLayerAnimationObserver& observer);
39
30 std::unique_ptr<ui::Layer> ripple_layer_; 40 std::unique_ptr<ui::Layer> ripple_layer_;
31 std::unique_ptr<ui::Layer> icon_layer_; 41 std::unique_ptr<ui::Layer> icon_layer_;
32 std::unique_ptr<ui::Layer> background_layer_; 42 std::unique_ptr<VoiceInteractionIconBackground> background_layer_;
33 43
34 AppListButton* host_view_; 44 AppListButton* host_view_;
35 45
36 // Indiates the current animation is in the bursting phase, which means no 46 // Indiates the current animation is in the bursting phase, which means no
37 // turning back. 47 // turning back.
38 bool is_bursting_; 48 bool is_bursting_;
39 49
50 // Whether showing the icon animation or not.
51 bool show_icon_;
52
53 // Whether we should hide the burst animation when the animation ends. This is
54 // used to synchronize the animation and the underlying window's appearance.
55 bool should_hide_animation_;
56
40 views::CircleLayerDelegate circle_layer_delegate_; 57 views::CircleLayerDelegate circle_layer_delegate_;
41 58
42 DISALLOW_COPY_AND_ASSIGN(VoiceInteractionOverlay); 59 DISALLOW_COPY_AND_ASSIGN(VoiceInteractionOverlay);
43 }; 60 };
44 61
45 } // namespace ash 62 } // namespace ash
46 #endif // ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_ 63 #endif // ASH_SHELF_VOICE_INTERACTION_OVERLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698