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

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

Issue 2041293002: Add heuristics to limit showing of new backspace UI bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 6 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/new_back_shortcut_bubble.h ('k') | chrome/common/pref_names.h » ('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.cc
diff --git a/chrome/browser/ui/views/new_back_shortcut_bubble.cc b/chrome/browser/ui/views/new_back_shortcut_bubble.cc
index 7c9b115751c522b9f7b4bfa17b22e28c477111e6..21a62386cd9929edb22c869ebb05ce37e440ecf2 100644
--- a/chrome/browser/ui/views/new_back_shortcut_bubble.cc
+++ b/chrome/browser/ui/views/new_back_shortcut_bubble.cc
@@ -33,8 +33,7 @@ const int kShowDurationMs = 3800;
}
NewBackShortcutBubble::NewBackShortcutBubble(
- ExclusiveAccessBubbleViewsContext* context,
- bool forward)
+ ExclusiveAccessBubbleViewsContext* context)
: bubble_view_context_(context),
animation_(new gfx::SlideAnimation(this)),
view_(new SubtleNotificationView(nullptr)),
@@ -42,7 +41,6 @@ NewBackShortcutBubble::NewBackShortcutBubble(
bubble_view_context_->GetBubbleParentView(),
view_,
false)) {
- UpdateContent(forward);
}
NewBackShortcutBubble::~NewBackShortcutBubble() {
@@ -52,6 +50,10 @@ NewBackShortcutBubble::~NewBackShortcutBubble() {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, popup_);
}
+bool NewBackShortcutBubble::IsVisible() const {
+ return popup_->IsVisible();
+}
+
void NewBackShortcutBubble::UpdateContent(bool forward) {
// Note: The key names are parameters so that we can vary by operating system
// or change the direction of the arrow as necessary (see
@@ -85,6 +87,11 @@ void NewBackShortcutBubble::UpdateContent(bool forward) {
&NewBackShortcutBubble::OnTimerElapsed);
}
+void NewBackShortcutBubble::Hide() {
+ hide_timeout_.Stop();
+ OnTimerElapsed();
+}
+
void NewBackShortcutBubble::AnimationProgressed(
const gfx::Animation* animation) {
float opacity = static_cast<float>(animation_->CurrentValueBetween(0.0, 1.0));
« no previous file with comments | « chrome/browser/ui/views/new_back_shortcut_bubble.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698