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

Unified Diff: chrome/browser/ui/views/new_back_shortcut_bubble.h

Issue 1983803002: Added notification when user presses backspace to use new shortcut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@subtle-notification-view-refactor
Patch Set: Fix alphabetical order in chrome_browser_ui.gypi. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/new_back_shortcut_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/new_back_shortcut_bubble.h
diff --git a/chrome/browser/ui/views/new_back_shortcut_bubble.h b/chrome/browser/ui/views/new_back_shortcut_bubble.h
new file mode 100644
index 0000000000000000000000000000000000000000..38b2e9917ebc23d7f13ab0f037ce012240e159c1
--- /dev/null
+++ b/chrome/browser/ui/views/new_back_shortcut_bubble.h
@@ -0,0 +1,66 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
+#define CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
+
+#include <memory>
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/timer/timer.h"
+#include "ui/gfx/animation/animation_delegate.h"
+
+class ExclusiveAccessBubbleViewsContext;
+class SubtleNotificationView;
+
+namespace gfx {
+class Animation;
+class Rect;
+class SlideAnimation;
+}
+
+namespace views {
+class View;
+class Widget;
+}
+
+// NewBackShortcutBubble shows a short-lived notification along the top of the
+// screen when the user presses the old Back/Forward shortcut, telling them how
+// to use the new shortcut. This will only be available for a few milestones to
+// let users adapt.
+// TODO(mgiuca): Remove this in M54 (https://crbug.com/610039).
+class NewBackShortcutBubble : public gfx::AnimationDelegate {
+ public:
+ NewBackShortcutBubble(ExclusiveAccessBubbleViewsContext* context,
+ bool forward);
+ ~NewBackShortcutBubble() override;
+
+ void UpdateContent(bool forward);
+
+ private:
+ // gfx::AnimationDelegate:
+ void AnimationProgressed(const gfx::Animation* animation) override;
+ void AnimationEnded(const gfx::Animation* animation) override;
+
+ gfx::Rect GetPopupRect(bool ignore_animation_state) const;
+ void OnTimerElapsed();
+
+ ExclusiveAccessBubbleViewsContext* const bubble_view_context_;
+
+ // Animation controlling showing/hiding of the bubble.
+ std::unique_ptr<gfx::SlideAnimation> animation_;
+
+ // Timer before the bubble disappears.
+ base::OneShotTimer hide_timeout_;
+
+ // The contents of the popup.
+ SubtleNotificationView* const view_;
+
+ views::Widget* const popup_;
+
+ DISALLOW_COPY_AND_ASSIGN(NewBackShortcutBubble);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_NEW_BACK_SHORTCUT_BUBBLE_H_
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/new_back_shortcut_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698