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

Side by Side Diff: ash/system/toast/toast_overlay.h

Issue 1841563003: ARC Toast: Prevent onClosed event from being called multiple times (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SYSTEM_TOAST_TOAST_OVERLAY_H_ 5 #ifndef ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_
6 #define ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_ 6 #define ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/compositor/layer_animation_observer.h" 10 #include "ui/compositor/layer_animation_observer.h"
(...skipping 26 matching lines...) Expand all
37 37
38 ToastOverlay(Delegate* delegate, const std::string& text); 38 ToastOverlay(Delegate* delegate, const std::string& text);
39 ~ToastOverlay() override; 39 ~ToastOverlay() override;
40 40
41 // Shows or hides the overlay. 41 // Shows or hides the overlay.
42 void Show(bool visible); 42 void Show(bool visible);
43 43
44 private: 44 private:
45 friend class ToastManagerTest; 45 friend class ToastManagerTest;
46 46
47 void OnAnimationStopped();
48
47 // Returns the current bounds of the overlay, which is based on visibility. 49 // Returns the current bounds of the overlay, which is based on visibility.
48 gfx::Rect CalculateOverlayBounds(); 50 gfx::Rect CalculateOverlayBounds();
49 51
50 // gfx::LayerAnimationObserver overrides: 52 // gfx::LayerAnimationObserver overrides:
53 void OnLayerAnimationStarted(ui::LayerAnimationSequence* sequence) override;
51 void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override; 54 void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override;
52 void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override; 55 void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override;
53 void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override; 56 void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override;
57 bool RequiresNotificationWhenAnimatorDestroyed() const override;
54 58
55 views::Widget* widget_for_testing(); 59 views::Widget* widget_for_testing();
56 void ClickDismissButtonForTesting(const ui::Event& event); 60 void ClickDismissButtonForTesting(const ui::Event& event);
57 61
58 bool is_visible_ = false;
59 Delegate* const delegate_; 62 Delegate* const delegate_;
60 const std::string text_; 63 const std::string text_;
61 scoped_ptr<views::Widget> overlay_widget_; 64 scoped_ptr<views::Widget> overlay_widget_;
62 scoped_ptr<ToastOverlayView> overlay_view_; 65 scoped_ptr<ToastOverlayView> overlay_view_;
63 gfx::Size widget_size_; 66 gfx::Size widget_size_;
67 std::set<ui::LayerAnimationSequence*> inflight_animations_;
64 68
65 DISALLOW_COPY_AND_ASSIGN(ToastOverlay); 69 DISALLOW_COPY_AND_ASSIGN(ToastOverlay);
66 }; 70 };
67 71
68 } // namespace ash 72 } // namespace ash
69 73
70 #endif // ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_ 74 #endif // ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698