OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/timer/timer.h" |
| 13 #include "ui/gfx/animation/animation_delegate.h" |
| 14 |
| 15 class ExclusiveAccessBubbleViewsContext; |
| 16 class SubtleNotificationView; |
| 17 |
| 18 namespace gfx { |
| 19 class Animation; |
| 20 class Rect; |
| 21 class SlideAnimation; |
| 22 } |
| 23 |
| 24 namespace views { |
| 25 class View; |
| 26 class Widget; |
| 27 } |
| 28 |
| 29 // NewBackShortcutBubble shows a short-lived notification along the top of the |
| 30 // screen when the user presses the old Back/Forward shortcut, telling them how |
| 31 // to use the new shortcut. This will only be available for a few milestones to |
| 32 // let users adapt. |
| 33 // TODO(mgiuca): Remove this in M54 (https://crbug.com/610039). |
| 34 class NewBackShortcutBubble : public gfx::AnimationDelegate { |
| 35 public: |
| 36 NewBackShortcutBubble(ExclusiveAccessBubbleViewsContext* context, |
| 37 bool forward); |
| 38 ~NewBackShortcutBubble() override; |
| 39 |
| 40 void UpdateContent(bool forward); |
| 41 |
| 42 private: |
| 43 // gfx::AnimationDelegate: |
| 44 void AnimationProgressed(const gfx::Animation* animation) override; |
| 45 void AnimationEnded(const gfx::Animation* animation) override; |
| 46 |
| 47 gfx::Rect GetPopupRect(bool ignore_animation_state) const; |
| 48 void OnTimerElapsed(); |
| 49 |
| 50 ExclusiveAccessBubbleViewsContext* const bubble_view_context_; |
| 51 |
| 52 // Animation controlling showing/hiding of the bubble. |
| 53 std::unique_ptr<gfx::SlideAnimation> animation_; |
| 54 |
| 55 // Timer before the bubble disappears. |
| 56 base::OneShotTimer hide_timeout_; |
| 57 |
| 58 // The contents of the popup. |
| 59 SubtleNotificationView* const view_; |
| 60 |
| 61 views::Widget* const popup_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(NewBackShortcutBubble); |
| 64 }; |
| 65 |
| 66 #endif // CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ |
OLD | NEW |