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

Side by Side Diff: chrome/browser/ui/views/new_back_shortcut_bubble.h

Issue 2540523003: Use standardized accelerator-to-shortcut code for new backspace shortcut UI. (Closed)
Patch Set: Created 4 years 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 CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
6 #define CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ 6 #define CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 21 matching lines...) Expand all
32 // let users adapt. 32 // let users adapt.
33 // TODO(mgiuca): Remove this in M54 (https://crbug.com/610039). 33 // TODO(mgiuca): Remove this in M54 (https://crbug.com/610039).
34 class NewBackShortcutBubble : public gfx::AnimationDelegate { 34 class NewBackShortcutBubble : public gfx::AnimationDelegate {
35 public: 35 public:
36 explicit NewBackShortcutBubble(ExclusiveAccessBubbleViewsContext* context); 36 explicit NewBackShortcutBubble(ExclusiveAccessBubbleViewsContext* context);
37 ~NewBackShortcutBubble() override; 37 ~NewBackShortcutBubble() override;
38 38
39 // Returns whether the UI is currently visible. 39 // Returns whether the UI is currently visible.
40 bool IsVisible() const; 40 bool IsVisible() const;
41 41
42 // Ensures the UI is displaying the correct shortcut for forward/back based on 42 // Ensures the UI is displaying the correct shortcut for the given
43 // |forward|, and resets the hide timer. 43 // |command_id|, and resets the hide timer.
44 void UpdateContent(bool forward); 44 void UpdateContent(int command_id);
45 45
46 // Fades out the UI immediately. 46 // Fades out the UI immediately.
47 void Hide(); 47 void Hide();
48 48
49 private: 49 private:
50 // gfx::AnimationDelegate: 50 // gfx::AnimationDelegate:
51 void AnimationProgressed(const gfx::Animation* animation) override; 51 void AnimationProgressed(const gfx::Animation* animation) override;
52 void AnimationEnded(const gfx::Animation* animation) override; 52 void AnimationEnded(const gfx::Animation* animation) override;
53 53
54 gfx::Rect GetPopupRect(bool ignore_animation_state) const; 54 gfx::Rect GetPopupRect(bool ignore_animation_state) const;
55 void OnTimerElapsed(); 55 void OnTimerElapsed();
56 56
57 ExclusiveAccessBubbleViewsContext* const bubble_view_context_; 57 ExclusiveAccessBubbleViewsContext* const bubble_view_context_;
58 58
59 // Animation controlling showing/hiding of the bubble. 59 // Animation controlling showing/hiding of the bubble.
60 std::unique_ptr<gfx::SlideAnimation> animation_; 60 std::unique_ptr<gfx::SlideAnimation> animation_;
61 61
62 // Timer before the bubble disappears. 62 // Timer before the bubble disappears.
63 base::OneShotTimer hide_timeout_; 63 base::OneShotTimer hide_timeout_;
64 64
65 // The contents of the popup. 65 // The contents of the popup.
66 SubtleNotificationView* const view_; 66 SubtleNotificationView* const view_;
67 67
68 views::Widget* const popup_; 68 views::Widget* const popup_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(NewBackShortcutBubble); 70 DISALLOW_COPY_AND_ASSIGN(NewBackShortcutBubble);
71 }; 71 };
72 72
73 #endif // CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_ 73 #endif // CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698